Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Code / INamed­Type

Interface INamedType

Represents a class, struct, enum, or delegate.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
public interface INamedType : IType, IGeneric, IMemberOrNamedType, INamedDeclaration, IDeclaration, IDisplayable, ICompilationElement, IDiagnosticLocation, IMeasurable

Properties

Name Description
AllEvents

Gets the list of events defined in the current type or inherited from the base types.

AllFields

Gets the list of fields defined in the current type or inherited from the base types. Note that fields can be promoted to properties by aspects, so a source code field can be represented in the Properties collection instead of the Fields collection.

AllFieldsAndProperties

Gets the union of the AllFields and AllProperties collections.

AllImplementedInterfaces

Gets the list of all interfaces (recursive) that the current type implements.

AllIndexers

Gets the list of indexers defined in the current type or inherited from the base types.

AllMethods

Gets the list of methods defined in the current type or inherited from the base type.

AllProperties

Gets the list of properties defined in the current type or inherited from the base types. Note that fields can be promoted to properties by aspects, so a source code field can be represented in the Properties collection instead of the Fields collection.

BaseType

Gets the type from which the current type derives.

Constructors

Gets the list of constructors, including the implicit default constructor if any, but not the static constructor.

Events

Gets the list of events defined in the current type, but not those inherited from the base types.

Fields

Gets the list of fields defined in the current type, but not those inherited from the base type. Note that fields can be promoted to properties by aspects, so a source code field can be represented in the Properties collection instead of the Fields collection.

FieldsAndProperties

Gets the union of the Fields and Properties collections.

Finalizer

Gets the finalizer of the type. For value types returns null.

FullName

Gets the name of the type including its namespace. The separator for nested types is the dot, and there is no suffix for generic types.

HasDefaultConstructor
ImplementedInterfaces

Gets the list of interfaces that the current type implements.

Indexers

Gets the list of indexers defined in the current type.

IsPartial

Gets a value indicating whether the type is marked as partial in source code.

IsReadOnly

Gets a value indicating whether the type is readonly.

Methods

Gets the list of methods defined in the current type, but not those inherited from the base type, and not constructors, finalizer or operators.

Namespace

Gets the namespace of the current type.

NestedTypes

Gets the nested types of the current type.

Properties

Gets the list of properties defined in the current type, but not those inherited from the base types. Note that fields can be promoted to properties by aspects, so a source code field can be represented in the Properties collection instead of the Fields collection.

StaticConstructor

Gets the static constructor.

TypeDefinition

Gets the type definition with unassigned type parameters. When the current INamedType is not a generic type instance , returns the current IMethod.

UnderlyingType

Gets the underlying type of an enum, the non-nullable type of a nullable type, or the current type.

Methods

Name Description
IsSubclassOf(INamedType)

Determines whether the type if subclass of the given class or interface.

TryFindImplementationForInterfaceMember(IMember, out IMember)

Finds the the implementation of the given interface member that is valid for this type.

Extension Methods

GenericExtensions.GetOriginalDefinition(INamedType)
GenericExtensions.WithTypeArguments(INamedType, IType[])
GenericExtensions.WithTypeArguments(INamedType, Type[])
GenericExtensions.WithTypeArguments(INamedType, IReadOnlyList<Type>)
GenericExtensions.ForTypeInstance(INamedType, INamedType)
NamedTypeExtensions.GetFullMetadataName(INamedType)
NamedTypeExtensions.MethodsAndAccessors(INamedType)
SymbolExtensions.GetSymbol(INamedType)
PresentingExtensions.AsHyperlink(Object)