Dan Holmes wrote:
Quote:
Suppose i have this class declaration:
>
public abstract class ConfigurableComponent : Component, IConfigure
>
if IConfigure has a method with this signature:
>
List<ParameterListParameters(Identity identity)
>
Would i need to implement it in the abstract class with as virtual in
order for it to be overrideable in a descendant class?
>
public virtual List<ParameterListParameters(Identity identity)
>
dan
>
Where in the docs would this kind of stuff live? I don't know how to
find this kind of theory.
If you want your method to be overridable in derived classes, then yes, you
must apply the 'virtual' modifier to the method declaration. If you want
to force derived classes to override the method, then apply the 'abstract'
modifier to the method declaration.
The interface is implemented on the class to which you specify in the class
declaration, i.e. on the class ConfigurableComponent in your case. Derived
classes in order to override your implementation need to be given the
virtual method.
--
Hope this helps,
Tom Spink
Google first, ask later.