System.AttributeUsageAttribute.Inherited Property

Gets or sets a Boolean value indicating whether the indicated attribute can be inherited by derived classes and overriding members.

Syntax

public bool Inherited { get; set; }

Value

true indicates the attribute is inherited by subclasses; otherwise, false. The default is true.

Remarks

Information on an inherited attribute will be included in the metadata for the class on which it is applied, but will not be included in the metadata for classes that derive from it. A metadata consumer (such as reflection) is required therefore to traverse up the inheritance chain of a class if that consumer is interested in Attribute data that is marked inherited, but applied to an ancestor class. There is nothing for the compiler to validate at compile time.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0