MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeINamed­Type
Open sandboxFocus

INamedType Interface

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

Definition

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

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.

IsRef

Gets a value indicating whether the type is a ref struct.

Methods

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

Namespace

Gets the namespace of the current type.

NestedTypes

Gets the nested types of the current type.

PrimaryConstructor

Gets the primary constructor if it is defined, otherwise returns null.

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
UnderlyingType

Gets the underlying type of an enum, the non-nullable type of a nullable reference 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.GetMetadataName(INamedType)
NamedTypeExtensions.GetFullMetadataName(INamedType)
NamedTypeExtensions.MethodsAndAccessors(INamedType)
NamedTypeExtensions.Members(INamedType)
NamedTypeExtensions.AllMembers(INamedType)
TypeExtensions.DerivesFrom(INamedType, INamedType, DerivedTypesOptions)
TypeExtensions.DerivesFrom(INamedType, Type, DerivedTypesOptions)
TypeFactory.ToNullableType(INamedType)
TypeFactory.ToNonNullableType(INamedType)
SymbolExtensions.GetSymbol(INamedType)
ContractExtensions.GetContractOptions(INamedType)