S
Steve B.
Hi,
I wonder if it is possible in C# to create an attribute and an interface,
and to force the developpement to use both or none on his classes...
For exemple, if I have :
public MyAttribute : Attribute
{}
public interface MyInterface
{}
I'd like to allow this :
[MyAttribute]
public class class1 : MyInteface
{}
or
public class class1
But neither
[MyAttribute]
public class class1
{}
nor
public class class1 : MyInterface
Is it possible usng only the C# syntax ? I can check during run-time if it
is OK, but I'd like to avoid compilationin other ways...
Thanks,
Steve
I wonder if it is possible in C# to create an attribute and an interface,
and to force the developpement to use both or none on his classes...
For exemple, if I have :
public MyAttribute : Attribute
{}
public interface MyInterface
{}
I'd like to allow this :
[MyAttribute]
public class class1 : MyInteface
{}
or
public class class1
But neither
[MyAttribute]
public class class1
{}
nor
public class class1 : MyInterface
Is it possible usng only the C# syntax ? I can check during run-time if it
is OK, but I'd like to avoid compilationin other ways...
Thanks,
Steve