ReflectionExtensionMethods

public static class ReflectionExtensionMethods
Provides a set of extension methods for System.Reflection.Assembly.

Methods

AllPublicClassImplementations

#Example
Enumerate over all public types which derive from a specific class or interface. Abstract classes are skipped, but generic classes are included.
public static IEnumerable<Type> AllPublicClassImplementations(
this Assembly
assembly,
Assembly to iterate over.
type,
Type representing a class or interface to be inherited from.
filterEmptyConstructors
If true, only types with parameterless constructors will be returned.
)
Enumerable collection of types.

FindInstanceMethod

#Example
Find the instance method on a type.
public static MethodInfo FindInstanceMethod(
this Type
type,
Type to search.
name,
Name of method.
public = true,
If true, private, protected, and internal methods will not be searched.
constraint = null
If not null, type constraint for method.
)
Found method or null.

FindStaticMethod

#Example
Find the static method on a type.
public static MethodInfo FindStaticMethod(
this Type
type,
Type to search.
name,
Name of method.
public = true,
If true, private, protected, and internal methods will not be searched.
constraint = null
If not null, type constraint for method.
)
Found method or null.

GetTypeConstraint

#Example
Gets the type constraint of this parameter. It will either be object If the parameter derives from Parameter or implements IParameter directly, or the T constraint for a type which derives from Parameter<T>.
public static Type GetTypeConstraint(
parameter
)

HasEmptyConstructor

#Example
Test whether a type has an empty, public constructor.
public static bool HasEmptyConstructor(
this Type
type
Type to check.
)
True if a public, empty constructor exists.

IsConstructible

#Example
Gets whether a type is a final type. Interfaces, abstract classes and classes with generic constraints are not final.
public static bool IsConstructible(
this Type
type
)

IsKindOf

#Example
Gets whether one type if a kind of another type. I.e. whether 'type' can be assigned to 'other'.
public static bool IsKindOf(
this Type
type,
other
)

IsReimplemented

#Example
Test whether a virtual method has been re-implemented in a more derived type.
public static bool IsReimplemented(
this Type
derivedType,
Derived type.
baseType,
Type of (abstract) base class which contains the default implementations.
methodName
Method name.
)
True if the method has been re-implemented.

IsReimplemented

#Example
Test whether a virtual method has been re-implemented.
public static bool IsReimplemented(
this Type
type,
Type to check.
methodName
Method name.
)
True if the method has been re-implemented in the specified type.

UiInfo

#Example
Gets the sentence used in the user interface decribing the character of the given conversion merit.
public static string UiInfo(
this Merit
merit
)

UiName

#Example
Gets the name used in the user interface for the given conversion merit.
public static string UiName(
this Merit
merit,
wordCase = true
)