C# Class RiotNet.ReflectionUtils

Contains reflection-related helper methods.
Datei anzeigen Open project: aj-r/RiotNet

Public Methods

Method Description
GetDictionaryInterface ( Type type ) : Type

Gets the IDictionary<,> interface that the type implements, if any.

GetGenericInterface ( Type type, Type genericInterfaceDefinition ) : Type

Gets the interface that a type implements that matches the specified generic interface definition.

GetListInterface ( Type type ) : Type

Gets the IList<> interface that the type implements, if any.

IsSubclassOfGenericTypeDefinition ( Type objectType, Type genericTypeDefinition ) : bool

Gets whether the specified type is a subclass of a generic type represented by the specified generic type definition.

Method Details

GetDictionaryInterface() public static method

Gets the IDictionary<,> interface that the type implements, if any.
public static GetDictionaryInterface ( Type type ) : Type
type System.Type The type of object that implements the interface.
return System.Type

GetGenericInterface() public static method

Gets the interface that a type implements that matches the specified generic interface definition.
public static GetGenericInterface ( Type type, Type genericInterfaceDefinition ) : Type
type System.Type The type of object that implements the interface.
genericInterfaceDefinition System.Type A generic type definition for an interface (e.g. typeof(IEnumerable<>)).
return System.Type

GetListInterface() public static method

Gets the IList<> interface that the type implements, if any.
public static GetListInterface ( Type type ) : Type
type System.Type The type of object that implements the interface.
return System.Type

IsSubclassOfGenericTypeDefinition() public static method

Gets whether the specified type is a subclass of a generic type represented by the specified generic type definition.
public static IsSubclassOfGenericTypeDefinition ( Type objectType, Type genericTypeDefinition ) : bool
objectType System.Type The type to check.
genericTypeDefinition System.Type A generic type definition (e.g. typeof(List<>))
return bool