Open sandboxFocus

Property AttributeReplace

AttributeReplace

Gets or sets a value indicating whether this attribute replaces other attributes found on the target declarations.

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

true if the current instance will replace previous ones, or false if it will be added to previous instances.

Remarks

Replacing is equivalent to excluding the previous instances of the same attribute type with AttributeExclude, then adding the current one. To make every new instance replace the previous ones, the aspect developer can instead set AllowMultiple to false. In this case, two instances applied directly to the same element still cause the error PS0065.

See Also