Class TypeUtility
Assembly: Unity.VisualScripting.Core.dll
Syntax
public static class TypeUtility
Methods
AndBaseTypeAndInterfaces(Type)
Declaration
public static IEnumerable<Type> AndBaseTypeAndInterfaces(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
AndHierarchy(Type)
Declaration
public static IEnumerable<Type> AndHierarchy(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
AndInterfaces(Type)
Declaration
public static IEnumerable<Type> AndInterfaces(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
BaseTypeAndInterfaces(Type, bool)
Declaration
public static IEnumerable<Type> BaseTypeAndInterfaces(this Type type, bool inheritedInterfaces = true)
Parameters
Type |
Name |
Description |
Type |
type |
|
bool |
inheritedInterfaces |
|
Returns
CanMakeGenericTypeVia(Type, Type)
Declaration
public static bool CanMakeGenericTypeVia(this Type openConstructedType, Type closedConstructedType)
Parameters
Type |
Name |
Description |
Type |
openConstructedType |
|
Type |
closedConstructedType |
|
Returns
Default(Type)
Declaration
public static object Default(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDictionaryItemType(Type, bool, int)
Declaration
public static Type GetDictionaryItemType(Type dictionaryType, bool allowNonGeneric, int genericArgumentIndex)
Parameters
Type |
Name |
Description |
Type |
dictionaryType |
|
bool |
allowNonGeneric |
|
int |
genericArgumentIndex |
|
Returns
GetDictionaryKeyType(Type, bool)
Declaration
public static Type GetDictionaryKeyType(Type dictionaryType, bool allowNonGeneric)
Parameters
Type |
Name |
Description |
Type |
dictionaryType |
|
bool |
allowNonGeneric |
|
Returns
GetDictionaryValueType(Type, bool)
Declaration
public static Type GetDictionaryValueType(Type dictionaryType, bool allowNonGeneric)
Parameters
Type |
Name |
Description |
Type |
dictionaryType |
|
bool |
allowNonGeneric |
|
Returns
GetEnumerableElementType(Type, bool)
Declaration
public static Type GetEnumerableElementType(Type enumerableType, bool allowNonGeneric)
Parameters
Type |
Name |
Description |
Type |
enumerableType |
|
bool |
allowNonGeneric |
|
Returns
GetInterfaces(Type, bool)
Declaration
public static IEnumerable<Type> GetInterfaces(this Type type, bool includeInherited)
Parameters
Type |
Name |
Description |
Type |
type |
|
bool |
includeInherited |
|
Returns
GetListElementType(Type, bool)
Declaration
public static Type GetListElementType(Type listType, bool allowNonGeneric)
Parameters
Type |
Name |
Description |
Type |
listType |
|
bool |
allowNonGeneric |
|
Returns
GetTypesSafely(Assembly)
Declaration
public static IEnumerable<Type> GetTypesSafely(this Assembly assembly)
Parameters
Returns
Hierarchy(Type)
Declaration
public static IEnumerable<Type> Hierarchy(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
Instantiate(Type, bool, params object[])
Declaration
public static object Instantiate(this Type type, bool nonPublic = true, params object[] args)
Parameters
Returns
Instantiator(Type, bool)
Declaration
public static Func<object> Instantiator(this Type type, bool nonPublic = true)
Parameters
Type |
Name |
Description |
Type |
type |
|
bool |
nonPublic |
|
Returns
Instantiator(Type, bool, params Type[])
Declaration
public static Func<object[], object> Instantiator(this Type type, bool nonPublic = true, params Type[] parameterTypes)
Parameters
Type |
Name |
Description |
Type |
type |
|
bool |
nonPublic |
|
Type[] |
parameterTypes |
|
Returns
IsAbstract(Type)
Declaration
public static bool IsAbstract(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsAssignableFrom(Type, object)
Declaration
public static bool IsAssignableFrom(this Type type, object value)
Parameters
Returns
IsBasic(Type)
Declaration
public static bool IsBasic(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsConcrete(Type)
Declaration
public static bool IsConcrete(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsNullable(Type)
Declaration
public static bool IsNullable(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsNumeric(Type)
Declaration
public static bool IsNumeric(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsNumericConstruct(Type)
Declaration
public static bool IsNumericConstruct(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsReferenceType(Type)
Declaration
public static bool IsReferenceType(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsStatic(Type)
Declaration
public static bool IsStatic(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
IsStruct(Type)
Declaration
public static bool IsStruct(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
MakeGenericTypeVia(Type, Type, Dictionary<Type, Type>, bool)
Declaration
public static Type MakeGenericTypeVia(this Type openConstructedType, Type closedConstructedType, Dictionary<Type, Type> resolvedGenericParameters, bool safe = true)
Parameters
Returns
Namespace(Type)
Declaration
public static Namespace Namespace(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
PseudoDefault(Type)
Declaration
public static object PseudoDefault(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
ToShortString(object, int)
Declaration
public static string ToShortString(this object o, int maxLength = 20)
Parameters
Returns
TryInstantiate(Type, bool, params object[])
Declaration
public static object TryInstantiate(this Type type, bool nonPublic = true, params object[] args)
Parameters
Returns