Say I have the following hierarchy:
public class MyClass
{
protected virtual void Method() { ... }
}
public class MySubClass : MyClass
{
public new virtual void Method() { ... }
}
public class MySubSubClass : MySubClass
{
// how do I reference the protected Method() to override it?
}
Is it possible to override the implementation of the protected Method() so that invocations from other methods defined in MyClass are dispatched to an implementation in MySubSubClass?
If not possible, it’d be nice to be enlightened as to why.
If you’re attempting to override the version of Method defined in
MyClassthen the answer is you cannot. The definition inMySubClasshides this implementation from you and it’s not possible for you to further override it.