Is there a way to enforce a compile requirement for certain attributes on a class or interface implementation?
For example, let's say my application uses a series of static classes that contain const int
resource values. I'd like to decorate the class in a Description
attribute to describe its contents. In concept, I'd like to apply this attribute requirement to an interface, then each static class would implement it with its required Description
. I could write a run-time check or a unit test to check compliance. But really a compile-time check would be best.
Is there such a thing?