Skip to content

TypeEx ​

Kind: Static class

Namespace: CrowdControl.Common

Public Static Functions

bool

ImplementsInterface(Type toCheck, Type interfaceType)

bool

IsOpenGeneric(Type toCheck)

bool

InheritsOpenGeneric(Type toCheck, Type generic)

bool

IsAssignableToGenericType(Type givenType, Type genericType)

bool

IsAssignableToWithConversion(Type fromType, Type toType)

bool

HasConversionOperatorTo(Type fromType, Type toType)

T

Preconstruct<T>(Action preconstructor, object[] constructorParameters)

Creates a new object, but runs code on the instantiated object prior to the constructor.

ConstructorInfo

GetConstructor(Type type, object[] parameters)

ConstructorInfo

GetConstructor(Type type, BindingFlags bindingAttr, object[] parameters)

string

GetSimpleName(Type type)

bool

IsNumeric(Type type)

bool

IsIntegral(Type type)

bool

IsSignedIntegral(Type type)

bool

IsUnsignedIntegral(Type type)

bool

IsFloatingPoint(Type type)

bool

IsNullable(Type type)

bool

IsNullableValueType(Type type)

T

GetCustomAttribute<T>(Type type)

IEnumerable

GetMethodsWithAttribute<T>(Type type)

object

InvokeStaticMethod(Type type, string methodName, object[] parameters)

TResult

InvokeStaticMethod<TResult>(Type type, string methodName)

TResult

InvokeStaticMethod<T1, TResult>(Type type, string methodName, T1 arg1)

bool

IsReferenceOrContainsReferences(Type type)

bool

TryFindByName(string typeName, Type out type)