Static method in Interface (C#)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've come across a problem; I need a number of classes to implement a sertain static method. But I can’t seem to enforce this through an interface.

Ideas to another solution

Regard
 
Look at your design. Does the method have to be static? Could you implement
an abstract base class?

--

Chris Rolon

This posting is provided "AS IS" with no warranties, and confers no rights.

Rasmus said:
I've come across a problem; I need a number of classes to implement a
sertain static method. But I can't seem to enforce this through an
interface.
 
No can do.
I've looked it over and since multible inheritence is not an option i'll need another solution

Any ideas?
 
One idea: create another interface, which provides the methods you want to
make static. The implementation of this method will call the static members
for the implementation of the first interface. This could be considered an
interface to the class that implements the first interface (as opposed to an
interface to an instance of the class).

Craig Bryant
Tektronix, Inc.
 
Back
Top