MustOverride Shared Methods in .Net

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-04-07T15:11:08Z Indexed on 2010/04/07 15:13 UTC
Read the original article Hit count: 251

Filed under:
|
|
|

Hi

I have a few class's that inherit from a base class. I want to enforce that all of these Class's implement a shared method foo(). I am not able to create the following on the base class

Public MustOvveride Shared Sub foo()

as this is not allowed. I also cant create an Interface that defines a Shared Sub Foo() and implement that in my derrived class's, as this also is not allowed.

Does anyone know how i should implement this?

p.s i realise my example is in VB and i have also tagged C#, the same problem applies to both languages and presumably the same fix would apply.

© Stack Overflow or respective owner

Related posts about c#

Related posts about vb.net