May 2010
Intermediate to advanced
1272 pages
61h 18m
English
There are situations where you create classes that inherit from other classes that are decorated with attributes. Attribute inheritance is not automatic in that you can establish whether your attributes are inheritable. You establish this behavior by setting the Inherited property at AttributeUsage level. By default, if you do not explicitly set Inherited, it is considered as True. The following example shows how you enable attribute inheritance:

The following snippet shows instead how to make an attribute not inheritable:
Inheritance is enabled by default because if a base class is decorated with attributes, derived classes ...
Read now
Unlock full access