Table of Contents

Class TypeDefinitionInfo

Namespace
Garyon.Reflection
Assembly
Garyon.dll

Contains information about the definition of a Type.

public class TypeDefinitionInfo : BaseEquatable<TypeDefinitionInfo>, IEquatable<TypeDefinitionInfo>
Inheritance
TypeDefinitionInfo
Implements
Inherited Members
Extension Methods

Constructors

TypeDefinitionInfo()

Initializes a new instance of the TypeDefinitionInfo class.

public TypeDefinitionInfo()

TypeDefinitionInfo(TypeKind, TypeModifiers)

Initializes a new instance of the TypeDefinitionInfo class from a type kind and the type modifiers.

public TypeDefinitionInfo(TypeKind kind, TypeModifiers modifiers)

Parameters

kind TypeKind

The kind of the type.

modifiers TypeModifiers

The modifiers of the type.

TypeDefinitionInfo(Type)

Initializes a new instance of the TypeDefinitionInfo class from a type.

public TypeDefinitionInfo(Type type)

Parameters

type Type

The type whose type definition info to get.

Fields

Kind

The kind of the type.

public TypeKind Kind

Field Value

TypeKind

Modifiers

The modifiers of the type.

public TypeModifiers Modifiers

Field Value

TypeModifiers

Properties

CanBeInherited

Determines whether this type can be inherited by any type.

public bool CanBeInherited { get; }

Property Value

bool

true if the type can be inherited by any type; that is it is not sealed, is a true class or an interface, otherwise false.

CanInherit

Determines whether this type can inherit any type, either a class or an interface.

public bool CanInherit { get; }

Property Value

bool

true if the type can inherit any type; that is, it is not a pointer or a by reference type, otherwise false.

CanInheritClasses

Determines whether this type can inherit any class.

public bool CanInheritClasses { get; }

Property Value

bool

true if the type can inherit any interface; that is, it is not a pointer, a by reference, or a delegate type, otherwise false.

CanInheritCustomClasses

Determines whether this type can inherit any custom class.

public bool CanInheritCustomClasses { get; }

Property Value

bool

true if the type can inherit any interface; that is, it is not a pointer, a by reference, a static class, or a delegate type, otherwise false.

CanInheritCustomTypes

Determines whether this type can inherit any type, either a class or an interface.

public bool CanInheritCustomTypes { get; }

Property Value

bool

true if the type can inherit any type; that is, it is not a pointer, a by reference, a static class, a delegate, an enum or an array type, otherwise false.

CanInheritInterfaces

Determines whether this type can inherit any interface.

public bool CanInheritInterfaces { get; }

Property Value

bool

true if the type can inherit any interface; that is, it is not a pointer, a by reference, a static class, a delegate, an enum or an array type, otherwise false.

IsAbstract

Determines whether the type is abstract.

public bool IsAbstract { get; }

Property Value

bool

IsArray

Determines whether the type is an array.

public bool IsArray { get; }

Property Value

bool

IsAttribute

Determines whether the type is an attribute.

public bool IsAttribute { get; }

Property Value

bool

IsByRef

Determines whether the type is by ref.

public bool IsByRef { get; }

Property Value

bool

IsClass

Determines whether the type is either a class or an array. For the non-array variant, use IsTrueClass.

public bool IsClass { get; }

Property Value

bool

IsDelegate

Determines whether the type is a delegate.

public bool IsDelegate { get; }

Property Value

bool

IsEnum

Determines whether the type is an enum.

public bool IsEnum { get; }

Property Value

bool

IsException

Determines whether the type is an exception.

public bool IsException { get; }

Property Value

bool

IsFile

Determines whether the type is file.

public bool IsFile { get; }

Property Value

bool

IsInterface

Determines whether the type is an interface.

public bool IsInterface { get; }

Property Value

bool

IsInternal

Determines whether the type is internal.

public bool IsInternal { get; }

Property Value

bool

IsNullableStruct

Determines whether the type is a nullable struct.

public bool IsNullableStruct { get; }

Property Value

bool

IsNullableTuple

Determines whether the type is a nullable tuple.

public bool IsNullableTuple { get; }

Property Value

bool

IsNullableType

Determines whether the type is a nullable type; that is, any reference, nullable struct or pointer type.

public bool IsNullableType { get; }

Property Value

bool

IsNullableValueType

Determines whether the type is a nullable value type; that is, any nullable struct or pointer type.

public bool IsNullableValueType { get; }

Property Value

bool

IsPointer

Determines whether the type is a pointer.

public bool IsPointer { get; }

Property Value

bool

IsPrivate

Determines whether the type is private.

public bool IsPrivate { get; }

Property Value

bool

IsPrivateProtected

Determines whether the type is private protected.

public bool IsPrivateProtected { get; }

Property Value

bool

IsProtected

Determines whether the type is protected.

public bool IsProtected { get; }

Property Value

bool

IsProtectedInternal

Determines whether the type is protected internal.

public bool IsProtectedInternal { get; }

Property Value

bool

IsPublic

Determines whether the type is public.

public bool IsPublic { get; }

Property Value

bool

IsReadonly

Determines whether the type is readonly. NOTE: This property will always return false since the reflection API does not have any mechanism to determine that.

public bool IsReadonly { get; }

Property Value

bool

IsReadonlyRef

Determines whether the type is readonly ref. NOTE: This property will always return false since the reflection API does not have any mechanism to determine that.

public bool IsReadonlyRef { get; }

Property Value

bool

IsRef

Determines whether the type is ref. NOTE: This property will always return false for ref struct type definitions, since the reflection API does not have any mechanism to determine that. However, by ref types (types with the ref modifier in argument type declarations) will be detected as such.

public bool IsRef { get; }

Property Value

bool

IsReferenceType

Determines whether the type is a reference type; that is, any class, interface, delegate or by reference type. Pointers do not count as reference types.

public bool IsReferenceType { get; }

Property Value

bool

IsSealed

Determines whether the type is sealed.

public bool IsSealed { get; }

Property Value

bool

IsStatic

Determines whether the type is static.

public bool IsStatic { get; }

Property Value

bool

IsStruct

Determines whether the type is a struct.

public bool IsStruct { get; }

Property Value

bool

IsTrueClass

Determines whether the type is a class.

public bool IsTrueClass { get; }

Property Value

bool

IsTuple

Determines whether the type is a tuple.

public bool IsTuple { get; }

Property Value

bool

IsValueType

Determines whether the type is a reference type; that is, any struct, enum, tuple or pointer type.

public bool IsValueType { get; }

Property Value

bool

IsVoid

Determines whether the type is void.

public bool IsVoid { get; }

Property Value

bool

Methods

EqualsCore(TypeDefinitionInfo)

protected override bool EqualsCore(TypeDefinitionInfo other)

Parameters

other TypeDefinitionInfo

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetTypeKind(Type?)

Gets the type kind of the type.

public static TypeKind GetTypeKind(Type? type)

Parameters

type Type

The type whose type kind to get.

Returns

TypeKind

A TypeKind which determines the type's type kind.

GetTypeModifiers(Type?)

Gets the type modifiers of the type.

public static TypeModifiers GetTypeModifiers(Type? type)

Parameters

type Type

The type whose type modifiers to get.

Returns

TypeModifiers

A TypeModifiers value that contains the type modifiers.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.