MetalamaAPI documentationAspect APIMetalama.​Framework.​Code
Open sandboxFocusImprove this doc

Metalama.Framework.Code Namespace

This namespace encompasses the representation of both the source code and the transformed code.

Simplified class diagram

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


      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

Describes conversion between types possible during comparison.

DeclarationEnhancements<T>

Gives access to the aspects, options and annotations on a declaration.

DeclarationExtensions

Extension methods for IDeclaration.

DeclarationKind

Kinds of IDeclaration.

DeclarationOriginKind

Kinds of IDeclarationOrigin.

DerivedTypesOptions

Options for the GetDerivedTypes(INamedType, DerivedTypesOptions) method.

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.

SourceReference

Represents a syntax node in source code.

SourceSpan

Represents a span of source code.

SpecialType

Special types, such as Void.

TypedConstant

Represents a typed value that can be defined, defined to null, or undefined. Used to represent default values, for instance DefaultValue, or 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

IAnnotation

A non-generic base interface for the generic IAnnotation<T>. You should always implement the generic interface.

IAnnotation<T>

An annotation is an arbitrary but serializable object that can then be retrieved using the GetAnnotations<TAnnotation>() method of the Enhancements<T>(T) object. Annotations are a way of communication between aspects or classes of aspects.

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.

IDeclarationCache

A service that caches declarations of the current compilation. It is typically used to cache often-used declarations across aspect instances.

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.

IHasAccessors

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

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, IFieldOrPropertyOrIndexer, IEvent, and INamedType.

IMethod

Represents a method, but not a constructor.

IMethodBase

Represents a method or a constructor.

INamedDeclaration

INamedType

Represents a class, struct, interface, 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.

ISourceExpression

Represents an IExpression defined in source code, as opposed to a generated expression.

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.