Gives access to the aspects, options and annotations on a declaration.
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public readonly struct DeclarationEnhancements<T> where T : class, IDeclaration
Type Parameters
Name | Description |
---|---|
T |
Methods
Name | Description |
---|---|
GetAnnotations<TAnnotation>() | Gets the list of annotations of a given type on the current declaration. |
GetAspectInstances() | Gets the set of aspects (represented by their IAspectInstance) that have been applied to a specified declaration. |
GetAspects<TAspect>() | Gets the set of instances of a specified type of aspects that have been applied to a specified declaration. |
GetOptions<TOptions>() | Gets the options effective for the current declarations. Options provided by aspects through the IHierarchicalOptionsProvider are available only when and after the given aspect instance has been initialized; options provided by other means are available immediately. |
HasAspect(Type) | Determines if the current declaration has at least one aspect of the given type. |
HasAspect<TAspect>() | Determines if the current declaration has at least one aspect of the given type. |