I want to do something like this:
[Notes("Remember to blah blah blah")]
public class Foo {
[Notes("Redo this to include blah blah")]
public string Bar { get; set; }
// etc.
}
I know about the ConditionalAttribute
, but it's sealed so I can't subclass my NotesAttribute
from it.
Can this be done?
Yes this can be done!
See my related question and answer here.
You need to do this:
[Conditional("DEBUG")]
public class NotesAttribute : Attribute { }