ReflectionExtensionMethods

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

Methods

AllPublicClassImplementations

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

FindInstanceMethod

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

FindStaticMethod

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

GetTypeConstraint

#Example
public static Type GetTypeConstraint(this IParameter parameter)
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>.
parameter (IParameter)

HasEmptyConstructor

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

IsConstructible

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

IsKindOf

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

IsReimplemented

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

IsReimplemented

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

UiInfo

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

UiName

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