Class ReflectionUtil
Simple utility class for working with the reflection API. Used to manipulate types.
public static class ReflectionUtil
- Inheritance
-
ReflectionUtil
- Inherited Members
Methods
CreateTypesDictionary(IEnumerable<Type>)
Creates a dictionary from specified types where the key is the type name and value is the type.
public static IDictionary<string, Type> CreateTypesDictionary(IEnumerable<Type> types)
Parameters
types
IEnumerable<Type>The specified types.
Returns
- IDictionary<string, Type>
Returns dictionary with inherited types.
CreateTypesString(IDictionary<string, Type>)
Creates a coma-separated string with types names from types dictionary.
public static string CreateTypesString(IDictionary<string, Type> types)
Parameters
types
IDictionary<string, Type>The specified types.
Returns
- string
Returns comma-separated string with inherited types.
CreateTypesString(IEnumerable<Type>)
Creates a coma-separated string with types names from types enumerable.
public static string CreateTypesString(IEnumerable<Type> types)
Parameters
types
IEnumerable<Type>The specified types.
Returns
- string
Returns comma-separated string with inherited types.
GetInheritedTypes(Type)
Gets all inherited types form the specified type. Abstract classes and interfaces ignored.
public static IEnumerable<Type> GetInheritedTypes(Type type)
Parameters
type
TypeThe specified type.
Returns
- IEnumerable<Type>
Returns enumerable with inherited types.
Exceptions
- NullReferenceException
If cannot find specified type.
GetInheritedTypesDictionary(Type)
Gets all inherited types form the specified type, and creates a dictionary where the key is the type name and value is the type. Abstract classes and interfaces ignored.
public static IDictionary<string, Type> GetInheritedTypesDictionary(Type type)
Parameters
type
TypeThe specified type.
Returns
- IDictionary<string, Type>
Returns dictionary with inherited types.
Exceptions
- NullReferenceException
If cannot find specified type.
GetInheritedTypesString(Type)
Gets all inherited types form the specified type, and creates a coma-separated string with types names. Abstract classes and interfaces ignored.
public static string GetInheritedTypesString(Type type)
Parameters
type
TypeThe specified type.
Returns
- string
Returns comma-separated string with inherited types.
Exceptions
- NullReferenceException
If cannot find specified type.