Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Code

Namespace Metalama.Framework.Code

This namespace contains the representation of the source code or the transformed code.

Simplified class diagram

classDiagram IMemberOrNamedType --|> IDeclaration IMember --|> IMemberOrNamedType INamedType --|> IMemberOrNamedType IFieldOrProperty --|> IMember IField --|> IFieldOrProperty IProperty --|> IFieldOrProperty IMethodBase --|> IMember IMethod --|> IMethodBase IConstructor --|> IMethodBase IParameter --|> IDeclaration IGenericParameter --|> IDeclaration IAttribute --|> IDeclaration INamespace --|> IDeclaration ICompilation --|> IDeclaration IMethodBase o-- IParameter IProperty o-- IParameter IDeclaration o-- IAttribute IMethod o-- IGenericParameter INamedType o-- IGenericParameter INamedType o-- IMemberOrNamedType ICompilation o-- INamespace INamespace o-- INamedType

Classes

Accessibility

Accessibility of types and members, for instance Private or Public.

AccessibilityExtensions

AsyncInfo

Information about an async method, returned by the GetAsyncInfo(IMethod) extension method of IMethod.

AttributeExtensions

Extension methods for the IAttribute interface.

CodeDisplayContext

Reserved for future use. Specifies the context for which the display string must be generated.

CodeDisplayFormat

Defines the formatting options of ToDisplayString(CodeDisplayFormat, CodeDisplayContext). Only well-known instances of this classes, exposed as properties, are currently supported.

ConstructorCollectionExtensions

Provides extension methods to the IConstructorCollection interface.

ConstructorInitializerKind

Describes the kind of constructor initializer.

ConversionKind

DeclarationExtensions

Extension methods for IDeclaration.

DeclarationKind

Kinds of IDeclaration.

DeclarationOriginKind

Kinds of IDeclarationOrigin.

EnumerableKind

Kinds of iterators.

ExecutionScope

Enumerates the possible execution scopes of a declaration i.e. RunTime, CompileTime or RunTimeOrCompileTime.

GenericExtensions

Provides extension methods to work with generic declarations.

IteratorInfo

Information about an iterator method, returned by the GetIteratorInfo(IMethod) extension method of IMethod.

MemberExtensions

Extension methods for the IMember interface.

MethodCollectionExtensions

Provides extension methods to the IMethodCollection interface.

MethodExtensions

Extension methods for the IMethod interface.

MethodKind

Kinds of IMethodBase.

NamedTypeExtensions

Extension methods for the INamedType interface.

NamespaceExtensions

OperatorCategory

OperatorKind

Kinds of operators.

OperatorKindExtensions

ReferenceResolutionOptions

Options that determine how GetTarget(ICompilation, ReferenceResolutionOptions) and related methods work.

RefExtensions

Extension methods for the IRef<T> interface.

RefKind

Kinds of parameters, such as ref, in, out...

RefKindExtensions

Extension methods for RefKind.

SerializableDeclarationId

Encapsulates a string that uniquely identifies a declaration within a compilation (except in the situation where the compilation contains several assemblies providing types of the same name) and that is safe to persist in a file.

SerializableTypeId

Encapsulates a string that uniquely identifies a type within a compilation (except in the situation where the compilation contains several assemblies providing types of the same name) and that is safe to persist in a file.

SpecialType

Special types, such as Void.

SyntaxReference

Represents a syntax node or a syntax token.

TypedConstant

Represents a typed value that can be defined, defined to null, or undefined. Used to represent default values, for instance DefaultValue, or custom attribute arguments.

TypeExtensions

Provides extension methods for IType.

TypeFactory

Exposes methods that return instances of the IType interface.

TypeKind

Kinds of IType.

TypeKindConstraint

VarianceKind

Specifies the kind variance: In, Out or None.

Writeability

Enumerates the different abilities of a field or property to be written (set).

Interfaces

IAspectDeclarationOrigin

IAssembly

Represents an assembly (typically a reference assembly).

IAssemblyIdentity

Represents an assembly identity, used in project references.

IAttribute

Represent a custom attributes.

IAttributeData

Represent the members of a custom attribute, but not its relationship to the containing declaration.

ICompilation

Represents a set of types compiled together. See also IProject.

ICompilationElement

Exposes a Compilation property.

IConstructor

Represents an instance constructor or a static constructor.

IDeclaration

Represent a declaration.

IDeclarationOrigin

Represents the origin of the code, i.e. the artefact or function created the declaration.

IDisplayable

Defines a method ToDisplayString(CodeDisplayFormat, CodeDisplayContext) that renders the current declaration into a human-readable string.

IEvent

Represent an event.

IExpression

A compile-time representation of a run-time expression. To create an expression, use ExpressionFactory or ExpressionBuilder.

IField

Represents a field. Note that fields can be promoted to properties by aspects.

IFieldOrProperty

A base interface for IField and IProperty.

IFieldOrPropertyOrIndexer

A base interface for IProperty, IField and IIndexer.

IGeneric

An interface, common to INamedType and IMethod, that represents a generic declaration, i.e. a declaration with type parameters.

IHasParameters

Represents a method, constructor, or indexer.

IHasType

Exposes a Type property.

IIndexer

Represents an indexer, i.e. a this[*] property.

IManagedResource

Represents a managed resource.

IMember

Base interface for IMethod, IFieldOrProperty, IEvent, but not INamedType.

IMemberOrNamedType

Base interface for IMethod, IFieldOrProperty, IEvent, and INamedType.

IMemberWithAccessors

A base interface for IProperty and IEvent. Exposes GetAccessor(MethodKind).

IMethod

Represents a method, but not a constructor.

IMethodBase

Represents a method or a constructor.

INamedDeclaration

INamedType

Represents a class, struct, enum, or delegate.

INamespace

Represents a namespace inside the current compilation or an external assembly, according to the DeclaringAssembly property.

IParameter

Represents a parameter of a method or property.

IProperty

Represents a property.

IPropertyOrIndexer

IRef<T>

Represents a reference to a declaration that can be resolved using GetTarget(ICompilation, ReferenceResolutionOptions), given an compilation, or using the GetTarget<T>(IRef<T>, ReferenceResolutionOptions) extension method for the compilation of the current context.

IType

Represents a constructed type, for instance an array, a generic type instance, a pointer. A class, struct, enum or delegate are represented as an INamedType, which derive from IType.

ITypeParameter

Represents a generic parameter of a method or type.