In This Article

ITypeDefinition Interface

Provides the base requirements of a type definition.

public interface ITypeDefinition : IReflectionDefinition, ITypeReference

Properties

Access

Gets a TypeAccess indicating the current type's access visibility.

TypeAccess Access { get; }

Property Value

TypeAccess:

A TypeAccess indicating the current type's access visibility.

ArrayRank

Gets the number of dimensions in the current type, if the type is an array.

int ArrayRank { get; }

Property Value

Int32:

The number of dimensions in the current type, if the type is an array.

BaseTypes

Gets the collection of base types inherited/implemented by the current type.

ITypeReferenceCollection BaseTypes { get; }

Property Value

ITypeReferenceCollection:

The collection of base types inherited/implemented by the current type.

DeclaringType

Gets the type that declares the current type, if it is nested.

ITypeDefinition DeclaringType { get; }

Property Value

ITypeDefinition:

An ITypeDefinition object representing the enclosing type, if the current type is a nested type.

DocumentationComment

Gets the optional documentation comment, if the current type is defined in source code.

string DocumentationComment { get; }

Property Value

String:

The optional documentation comment, if the current type is defined in source code.

ElementType

Gets the type of the object encompassed or referred to by the current array, pointer or reference type.

ITypeDefinition ElementType { get; }

Property Value

ITypeDefinition:

The type of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current type is not an array or a pointer, or is not passed by reference, or represents a generic type or a type parameter in the definition of a generic type or generic method.

FullName

Gets the fully qualified name of the type, including the namespace of the type but not the assembly.

string FullName { get; }

Property Value

String:

The fully qualified name of the type, including the namespace of the type but not the assembly.

IsAbstract

Gets whether the current type is abstract and must be overridden.

bool IsAbstract { get; }

Property Value

Boolean:

true if the current type is abstract and must be overridden; otherwise, false.

IsAdvanced

Gets whether the current type is decorated such that it should only be visible to advanced users within an editor.

bool IsAdvanced { get; }

Property Value

Boolean:

true if the current type is decorated such that it should only be visible to advanced users within an editor; otherwise, false.

IsAnonymous

Gets whether the current type is an anonymous type.

bool IsAnonymous { get; }

Property Value

Boolean:

true if the current type is an anonymous type; otherwise, False.

IsArray

Gets whether the current type is an array.

bool IsArray { get; }

Property Value

Boolean:

true if the current type is an array; otherwise, False.

IsByReference

Gets whether the current type is passed by reference.

bool IsByReference { get; }

Property Value

Boolean:

true if the current type is passed by reference; otherwise, False.

IsExtension

Gets whether the current type is decorated as a static class that can contain extension methods.

bool IsExtension { get; }

Property Value

Boolean:

true if the current type is decorated as a static class that can contain extension methods; otherwise, false.

IsGenericTypeDefinition

Gets whether the current type is a generic type definition, from which other generic types can be constructed.

bool IsGenericTypeDefinition { get; }

Property Value

Boolean:

true if the current type is a generic type definition, from which other generic types can be constructed; otherwise, false.

IsHidden

Gets whether the current type is decorated such that it should never be visible within an editor.

bool IsHidden { get; }

Property Value

Boolean:

true if the current type is decorated such that it should never be visible within an editor; otherwise, false.

IsNested

Gets a value indicating whether the current type object represents a type whose definition is nested inside the definition of another type.

bool IsNested { get; }

Property Value

Boolean:

true if the Type is nested inside another type; otherwise, false.

IsObsolete

Gets whether the current type is decorated as obsolete.

bool IsObsolete { get; }

Property Value

Boolean:

true if the current type is decorated as obsolete; otherwise, false.

IsPointer

Gets whether the current type is a pointer.

bool IsPointer { get; }

Property Value

Boolean:

true if the current type is a pointer; otherwise, False.

IsSealed

Gets whether the current type is declared sealed.

bool IsSealed { get; }

Property Value

Boolean:

true if the current type is declared sealed; otherwise, false.

IsStandardModule

Gets whether the current type is decorated as a standard module class.

bool IsStandardModule { get; }

Property Value

Boolean:

true if the current type is decorated as a standard module class; otherwise, false.

Kind

Gets a TypeDefinitionKind that indicates the kind of type definition.

TypeDefinitionKind Kind { get; }

Property Value

TypeDefinitionKind:

A TypeDefinitionKind that indicates the kind of type definition.

Members

Gets the collection of members that are defined within the current type.

ITypeMemberDefinitionCollection Members { get; }

Property Value

ITypeMemberDefinitionCollection:

The collection of members that are defined within the current type.

Namespace

Gets the namespace of the type.

string Namespace { get; }

Property Value

String:

The namespace of the type.

NestedTypes

Gets the collection of nested types that are defined within the current type.

ITypeDefinitionCollection NestedTypes { get; }

Property Value

ITypeDefinitionCollection:

The collection of nested types that are defined within the current type.

SourceFileLocations

Gets the collection of source file locations that contain the current type's declarations.

ISourceFileLocationCollection SourceFileLocations { get; }

Property Value

ISourceFileLocationCollection:

The collection of source file locations that contain the current type's declarations.

Remarks

This property only knows source file locations for type definitions loaded from code.

TypeParameters

Gets the collection of generic type parameters, when the current type is a generic type definition.

ITypeParameterCollection TypeParameters { get; }

Property Value

ITypeParameterCollection:

The collection of generic type parameters, when the current type is a generic type definition.

Methods

GetNamespaceDeclaration(ISourceFileLocation)

Returns the INamespaceDeclaration that declared the current type, if the type came from a parsed source file.

INamespaceDeclaration GetNamespaceDeclaration(ISourceFileLocation location)
Parameter Type Description
location ISourceFileLocation

The optional ISourceFileLocation that provides contextual information, used when this is a merged type definition to select the most appropriate namespace declaration result.

Returns

INamespaceDeclaration:

The INamespaceDeclaration that declared the current type, if the type came from a parsed source file.

Inherited Members