A read-only collection of IAttribute representing the custom attributes applied to a declaration.
Namespace: Metalama.Framework.Code.Collections
Assembly: Metalama.Framework.dll
Syntax
public interface IAttributeCollection : IReadOnlyCollection<IAttribute>, IEnumerable<IAttribute>, IEnumerableRemarks
This collection is exposed via the Attributes property and provides methods to query attributes by type using OfAttributeType(IType) or check for attribute presence using Any(IType).
The order of items in this collection is undetermined and may change between versions.
To add attributes to existing declarations, use
Methods
| Name | Description |
|---|---|
| Any(IType) | Determines whether the collection contains any attribute whose type is convertible to the specified |
| Any(IType, ConversionKind) | Determines whether the collection contains any attribute whose type is convertible to the specified |
| Any(Type) | Determines whether the collection contains any attribute whose type is convertible to the specified reflection |
| Any(Type, ConversionKind) | Determines whether the collection contains any attribute whose type is convertible to the specified reflection |
| GetConstructedAttributesOfType<T>() | Gets the constructed attributes of a given type. |
| OfAttributeType(IType) | Gets all attributes whose type is convertible to the specified |
| OfAttributeType(IType, ConversionKind) | Gets all attributes whose type is convertible to the specified |
| OfAttributeType(Func<IType, bool>) | Gets all attributes whose type satisfies the specified |
| OfAttributeType(Type) | Gets all attributes whose type is convertible to the specified reflection |
| OfAttributeType(Type, ConversionKind) | Gets all attributes whose type is convertible to the specified reflection |