Open sandboxFocus

Property AllowMultiple

AllowMultiple

Gets or sets a value indicating whether multiple instances of the custom attribute are allowed on a single declaration.

Declaration
public bool AllowMultiple { get; set; }
Property Value
Type Description
bool
Remarks

Unless a class sets it to false, multiple instances are allowed. When multiple instances are not allowed, each instance replaces the instances of the same attribute type processed before it, for example the ones multicast from the declaring type or the assembly. Applying two instances directly to the same declaration is then a build error.

The getter returns the value set on this instance of MulticastAttributeUsageAttribute, and false when the value is not set. The value that applies to a class is computed at build time from the MulticastAttributeUsageAttribute of the class and of its base classes, so reading this property by reflection does not give it.

See Also