A
Andy
Why can't I create an interface and make its implementation static/shared?
Is there some pattern that lets me work around this?
Any explanation of why this is would be appreciated.
This is the message I get for the following code:
'staticInterface.Class1' does not implement interface member
'staticInterface.foo.doSomething(int)'.
'staticInterface.Class1.doSomething(int)' is either static, not public, or
has the wrong return type.
interface foo
{
bool doSomething(int y);
}
public class Class1 : foo
{
public bool x() { }
static public bool doSomething(int y)
{
// TODO: Add Class1.doSomething implementation
return false;
}
}
Is there some pattern that lets me work around this?
Any explanation of why this is would be appreciated.
This is the message I get for the following code:
'staticInterface.Class1' does not implement interface member
'staticInterface.foo.doSomething(int)'.
'staticInterface.Class1.doSomething(int)' is either static, not public, or
has the wrong return type.
interface foo
{
bool doSomething(int y);
}
public class Class1 : foo
{
public bool x() { }
static public bool doSomething(int y)
{
// TODO: Add Class1.doSomething implementation
return false;
}
}