ReflectionTypeHelper Class
Namespace: PTS.Reflection
Assembly: PTS.Reflection.dll
Provides reflection methods for Type
.
Syntax
public static class ReflectionTypeHelper
Inheritance
Methods
DerivedTypes(Type)
Gets types inheriting from specified base type.
Declaration
public static ICollection<Type> DerivedTypes(this Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Base type to get the inherited types for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.Type> | Collection of types inheriting from speciefied base type. |
GetInstanceMethods(Type)
Gets methods accessible in instance scope on specified type.
Declaration
public static List<MethodInfo> GetInstanceMethods(this Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Type to get instance methods for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Reflection.MethodInfo> | Collection of instance method meta data objects in specified type. |
HasInterfaces(Type, ICollection<Type>)
Checks wether the specified type implements the range of interfaces.
Declaration
public static bool HasInterfaces(this Type type, ICollection<Type> interfaces)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Type to check if the range of interfaces is implemented on. |
System.Collections.Generic.ICollection<System.Type> | interfaces | Interfaces the types must implement. |
Returns
Type | Description |
---|---|
System.Boolean | If the speciefied implementes the range of interfaces then |
TypesWithInterface(Type)
Gets object types that implement specified interface type.
Declaration
public static ICollection<Type> TypesWithInterface(this Type iface)
Parameters
Type | Name | Description |
---|---|---|
System.Type | iface | Interface type to get the implementing object types for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.Type> | Collection of object types that implement the specified interface. |
TypesWithInterfaces(ICollection<Type>)
Gets collection of types that implement range of interfaces.
Declaration
public static List<Type> TypesWithInterfaces(this ICollection<Type> interfaces)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<System.Type> | interfaces | Interfaces the types must implement. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Type> | Types that implement the specified range of interfaces. |