我有这个:
public class Base {
public virtual void Connect()
{
// do stuff
}
}
public class Derived1 : Base {
public override void Connect()
{
base.Connect();
// do other stuff
}
}
public class Derived2 : Derived {
public override void Connect()
{
base.Connect() // Here I want to call Base::Connect(), not Derived::Connect()
}
}
有没有办法可以从 Derived2 调用 Base::Connect,因为我想跳过 Derived1::Connect() 中的“做其他事情”部分?
编辑:我必须从 Derived1 派生。