Show / Hide Table of Contents

Class TypeExtensions

Contains Type extension methods for better support of generics.

Inheritance
System.Object
TypeExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Existential
Assembly: Existential.Net.dll
Syntax
public static class TypeExtensions

Methods

View Source

GetGenericAwareFullTypeName(Type)

Gets the full name of the type, including any generic type parameters.

Declaration
public static string GetGenericAwareFullTypeName(this Type inType)
Parameters
Type Name Description
System.Type inType

The type for which to get the full name.

Returns
Type Description
System.String

The full name of the type, including any generic type parameters.

View Source

GetGenericAwareFullTypeName<T>(T)

Gets the full name of the type, including any generic type parameters.

Declaration
public static string GetGenericAwareFullTypeName<T>(this T inInstance)
Parameters
Type Name Description
T inInstance

The instance for which to get the type name.

Returns
Type Description
System.String

The full name of the type, including any generic type parameters.

Type Parameters
Name Description
T

The type of the instance (will be inferred).

View Source

GetGenericAwareTypeName(Type)

Gets the name of the type, including any generic type parameters.

Declaration
public static string GetGenericAwareTypeName(this Type inType)
Parameters
Type Name Description
System.Type inType

The type for which to get the name.

Returns
Type Description
System.String

The name of the type, including any generic type parameters.

View Source

GetGenericAwareTypeName<T>(T)

Gets the name of the type, including any generic type parameters.

Declaration
public static string GetGenericAwareTypeName<T>(this T inInstance)
Parameters
Type Name Description
T inInstance

The instance for which to get the type name.

Returns
Type Description
System.String

The name of the type, including any generic type parameters.

Type Parameters
Name Description
T

The type of the instance (will be inferred).

View Source

IsInstanceOfType<T>(T, Type)

Determines whether this type is of the expected type.

Declaration
public static bool IsInstanceOfType<T>(this T inInstance, Type inExpectedType)
Parameters
Type Name Description
T inInstance

The instance to compare with the expected type.

System.Type inExpectedType

The expected type.

Returns
Type Description
System.Boolean

True if the types are same; otherwise false.

Type Parameters
Name Description
T

The type being extended.

  • View Source
In This Article
Back to top Copyright © 2021 Dr. Gavin T.D. Greig.