Open sandboxFocus

Interface INamedType

Represents a class, struct, interface, enum, or delegate.

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

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.

AllTypes

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

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.

ContainingNamespace

Gets the namespace of the current type.

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.

HasDefaultConstructor
ImplementedInterfaces

Gets the list of interfaces that the current type implements.

Indexers

Gets the list of indexers defined in the current type.

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
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.

MakeGenericInstance(IReadOnlyList<IType>)
ToNullable()
ToRef()
TryFindImplementationForInterfaceMember(IMember, out IMember?)

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

Extension Methods