Class TypeExtensions
Represents the type extensions.
Inherited Members
Namespace: Platform.Reflection
Assembly: Platform.Reflection.dll
Syntax
public static class TypeExtensions
Fields
| Improve this Doc View SourceDefaultDelegateMethodName
The default delegate method name.
Declaration
public static readonly string DefaultDelegateMethodName
Field Value
Type | Description |
---|---|
String |
StaticMemberBindingFlags
The static.
Declaration
public static readonly BindingFlags StaticMemberBindingFlags
Field Value
Type | Description |
---|---|
BindingFlags |
Methods
| Improve this Doc View SourceCanBeNumeric(Type)
Determines whether can be numeric.
Declaration
public static bool CanBeNumeric(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
GetAssembly(Type)
Gets the assembly using the specified type.
Declaration
public static Assembly GetAssembly(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Assembly | The assembly
|
GetBaseType(Type)
Gets the base type using the specified type.
Declaration
public static Type GetBaseType(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Type | The type
|
GetDelegateCharacteristics(Type, out Type, out Type[])
Gets the delegate characteristics using the specified delegate type.
Declaration
public static void GetDelegateCharacteristics(this Type delegateType, out Type returnType, out Type[] parameterTypes)
Parameters
Type | Name | Description |
---|---|---|
Type | delegateType | The delegate type.
|
Type | returnType | The return type.
|
Type[] | parameterTypes | The parameter types.
|
GetDelegateParameterTypes(Type)
Gets the delegate parameter types using the specified delegate type.
Declaration
public static Type[] GetDelegateParameterTypes(this Type delegateType)
Parameters
Type | Name | Description |
---|---|---|
Type | delegateType | The delegate type.
|
Returns
Type | Description |
---|---|
Type[] | The type array
|
GetDelegateReturnType(Type)
Gets the delegate return type using the specified delegate type.
Declaration
public static Type GetDelegateReturnType(this Type delegateType)
Parameters
Type | Name | Description |
---|---|---|
Type | delegateType | The delegate type.
|
Returns
Type | Description |
---|---|
Type | The type
|
GetFirstField(Type)
Gets the first field using the specified type.
Declaration
public static FieldInfo GetFirstField(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
FieldInfo | The field info
|
GetGenericMethod(Type, String, Type[], Type[])
Gets the generic method using the specified type.
Declaration
public static MethodInfo GetGenericMethod(this Type type, string name, Type[] genericParameterTypes, Type[] argumentTypes)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
String | name | The name.
|
Type[] | genericParameterTypes | The generic parameter types.
|
Type[] | argumentTypes | The argument types.
|
Returns
Type | Description |
---|---|
MethodInfo | The method.
|
GetSignedVersionOrNull(Type)
Gets the signed version or null using the specified unsigned type.
Declaration
public static Type GetSignedVersionOrNull(this Type unsignedType)
Parameters
Type | Name | Description |
---|---|---|
Type | unsignedType | The unsigned type.
|
Returns
Type | Description |
---|---|
Type | The type
|
GetStaticFieldValue<T>(Type, String)
Gets the static field value using the specified type.
Declaration
public static T GetStaticFieldValue<T>(this Type type, string name)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
String | name | The name.
|
Returns
Type | Description |
---|---|
T | The
|
Type Parameters
Name | Description |
---|---|
T | The .
|
GetStaticPropertyValue<T>(Type, String)
Gets the static property value using the specified type.
Declaration
public static T GetStaticPropertyValue<T>(this Type type, string name)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
String | name | The name.
|
Returns
Type | Description |
---|---|
T | The
|
Type Parameters
Name | Description |
---|---|
T | The .
|
GetUnsignedVersionOrNull(Type)
Gets the unsigned version or null using the specified signed type.
Declaration
public static Type GetUnsignedVersionOrNull(this Type signedType)
Parameters
Type | Name | Description |
---|---|---|
Type | signedType | The signed type.
|
Returns
Type | Description |
---|---|
Type | The type
|
IsFloatPoint(Type)
Determines whether is float point.
Declaration
public static bool IsFloatPoint(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsGeneric(Type)
Determines whether is generic.
Declaration
public static bool IsGeneric(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsGeneric(Type, Type)
Determines whether is generic.
Declaration
public static bool IsGeneric(this Type type, Type genericTypeDefinition)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Type | genericTypeDefinition | The generic type definition.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsNullable(Type)
Determines whether is nullable.
Declaration
public static bool IsNullable(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsNumeric(Type)
Determines whether is numeric.
Declaration
public static bool IsNumeric(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsSigned(Type)
Determines whether is signed.
Declaration
public static bool IsSigned(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsSubclassOf(Type, Type)
Determines whether is subclass of.
Declaration
public static bool IsSubclassOf(this Type type, Type superClass)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Type | superClass | The super.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|
IsValueType(Type)
Determines whether is value type.
Declaration
public static bool IsValueType(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type.
|
Returns
Type | Description |
---|---|
Boolean | The bool
|