Open sandboxFocus

Interface IDeclarationBuilder

Allows to complete the construction of a declaration that has been created by an advice.

Namespace: Metalama.Framework.Code.DeclarationBuilders
Assembly: Metalama.Framework.dll
Syntax
public interface IDeclarationBuilder : IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>

Properties

Name Description
IsFrozen

Gets a value indicating whether the builder has been frozen. When the value is true, modifications can no longer be performed.

Methods

Name Description
AddAttribute(AttributeConstruction)

Adds a custom attribute to the current declaration.

AddAttributes(IEnumerable<AttributeConstruction>)

Adds custom attributes to the current declaration.

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.

Freeze()

Freezes the declaration so that modifications can no longer be performed.

RemoveAttributes(INamedType)

Removes all custom attributes of a given type from the current declaration.

Extension Methods

See Also