How do I create a "Custom Attribute" so that it can only be applied to "virtual" methods?
Here should be fine:
[OnlyOnVirtual]
public virtual void VirtualMethod()
{
//do something
}
And here, I would like to raise a compilation or execution error:
[OnlyOnVirtual]
public void NonVirtualMethod()
{
//do something
}
Is it possible to create a "Custom Attribute" with that kind of restriction?