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
kindTypeKindThe kind of the type.
modifiersTypeModifiersThe modifiers of the type.
TypeDefinitionInfo(Type)
Initializes a new instance of the TypeDefinitionInfo class from a type.
public TypeDefinitionInfo(Type type)
Parameters
typeTypeThe type whose type definition info to get.
Fields
Kind
The kind of the type.
public TypeKind Kind
Field Value
Modifiers
The modifiers of the type.
public TypeModifiers Modifiers
Field Value
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
IsArray
Determines whether the type is an array.
public bool IsArray { get; }
Property Value
IsAttribute
Determines whether the type is an attribute.
public bool IsAttribute { get; }
Property Value
IsByRef
Determines whether the type is by ref.
public bool IsByRef { get; }
Property Value
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
IsDelegate
Determines whether the type is a delegate.
public bool IsDelegate { get; }
Property Value
IsEnum
Determines whether the type is an enum.
public bool IsEnum { get; }
Property Value
IsException
Determines whether the type is an exception.
public bool IsException { get; }
Property Value
IsFile
Determines whether the type is file.
public bool IsFile { get; }
Property Value
IsInterface
Determines whether the type is an interface.
public bool IsInterface { get; }
Property Value
IsInternal
Determines whether the type is internal.
public bool IsInternal { get; }
Property Value
IsNullableStruct
Determines whether the type is a nullable struct.
public bool IsNullableStruct { get; }
Property Value
IsNullableTuple
Determines whether the type is a nullable tuple.
public bool IsNullableTuple { get; }
Property Value
IsNullableType
Determines whether the type is a nullable type; that is, any reference, nullable struct or pointer type.
public bool IsNullableType { get; }
Property Value
IsNullableValueType
Determines whether the type is a nullable value type; that is, any nullable struct or pointer type.
public bool IsNullableValueType { get; }
Property Value
IsPointer
Determines whether the type is a pointer.
public bool IsPointer { get; }
Property Value
IsPrivate
Determines whether the type is private.
public bool IsPrivate { get; }
Property Value
IsPrivateProtected
Determines whether the type is private protected.
public bool IsPrivateProtected { get; }
Property Value
IsProtected
Determines whether the type is protected.
public bool IsProtected { get; }
Property Value
IsProtectedInternal
Determines whether the type is protected internal.
public bool IsProtectedInternal { get; }
Property Value
IsPublic
Determines whether the type is public.
public bool IsPublic { get; }
Property Value
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
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
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
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
IsSealed
Determines whether the type is sealed.
public bool IsSealed { get; }
Property Value
IsStatic
Determines whether the type is static.
public bool IsStatic { get; }
Property Value
IsStruct
Determines whether the type is a struct.
public bool IsStruct { get; }
Property Value
IsTrueClass
Determines whether the type is a class.
public bool IsTrueClass { get; }
Property Value
IsTuple
Determines whether the type is a tuple.
public bool IsTuple { get; }
Property Value
IsValueType
Determines whether the type is a reference type; that is, any struct, enum, tuple or pointer type.
public bool IsValueType { get; }
Property Value
IsVoid
Determines whether the type is void.
public bool IsVoid { get; }
Property Value
Methods
EqualsCore(TypeDefinitionInfo)
protected override bool EqualsCore(TypeDefinitionInfo other)
Parameters
otherTypeDefinitionInfo
Returns
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
typeTypeThe type whose type kind to get.
Returns
GetTypeModifiers(Type?)
Gets the type modifiers of the type.
public static TypeModifiers GetTypeModifiers(Type? type)
Parameters
typeTypeThe 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.