G
Gecko
I noticed that every time I override a class member, the intellisense
behavior is to automatically add a call to the base class of the overridden
member such as:
public override void SomeMethod()
{
/// Some quality code goes here.
base.SomeMethod();
}
1) What would happen if I create an overridable member that for some reason
or another, should not be called (via the *base* keyword) from a class that
overrides it? How can I know if the method is being called from an inheritor
so I can raise an error?
2) Is the expect behavior of all overridable member be implemented so that
overriding them and calling them via the "base" keyword is completely safe?
Thank you.
behavior is to automatically add a call to the base class of the overridden
member such as:
public override void SomeMethod()
{
/// Some quality code goes here.
base.SomeMethod();
}
1) What would happen if I create an overridable member that for some reason
or another, should not be called (via the *base* keyword) from a class that
overrides it? How can I know if the method is being called from an inheritor
so I can raise an error?
2) Is the expect behavior of all overridable member be implemented so that
overriding them and calling them via the "base" keyword is completely safe?
Thank you.