Open sandboxFocus

Method AddAttributes

AddAttributes(IEnumerable<AttributeConstruction>)

Adds custom attributes to the current declaration.

Declaration
void AddAttributes(IEnumerable<AttributeConstruction> attributes)
Parameters
Type Name Description
IEnumerable<AttributeConstruction> attributes

The attribute constructions to add.

AddAttributes(IEnumerable<IAttribute>)

Adds custom attributes to the current declaration by copying them from existing IAttribute instances. This is useful when replacing or introducing a declaration and copying the attributes from the original declaration. Callers can filter the sequence (e.g. using LINQ Where) before passing it.

Declaration
void AddAttributes(IEnumerable<IAttribute> attributes)
Parameters
Type Name Description
IEnumerable<IAttribute> attributes

The attributes to copy. Each attribute is converted to an AttributeConstruction via ToAttributeConstruction(IAttribute).