我想限制受保护方法对某些继承类的访问.
例如,有一个基类
TBase = Class Protected Method1; Method2; Method3; Method4; End;
我有两个派生自TBase的课程
TDerived1 = Class(TBase) //Here i must access only Method1,Method2 and Method3 End; TDerived2 = Class(TBase) //Here i must access only Method3 and Method4 End;
那么有可能吗?
当我使用TDerived1和的对象时,只访问Method1,Method2和Method3
当我使用TDerived2的对象时,方法3和方法4