Table of Contents

Class Reflector

Namespace
NMF.Transformations
Assembly
NMF.Transformations.dll

A helper class that reflects the transformation rules that reside as nested classes within a given type

public static class Reflector
Inheritance
Reflector
Inherited Members

Methods

ReflectDictionary<T>(Stack<Type>, Func<IEnumerable<T>>, Func<IEnumerable<T>>)

Obtains the rules from the given type stack

public static IDictionary<Type, T> ReflectDictionary<T>(Stack<Type> typeStack, Func<IEnumerable<T>> createDefaults, Func<IEnumerable<T>> createCustoms) where T : class

Parameters

typeStack Stack<Type>

A stack of types from which to reflect the rules

createDefaults Func<IEnumerable<T>>

A function that returns the defaults

createCustoms Func<IEnumerable<T>>

A function that returns the customs

Returns

IDictionary<Type, T>

A collection of rules

Type Parameters

T

The type of rules

ReflectInType<T>(Type, Action<Type, T>)

Reflects a type and instantiates all transformation rules contained in this type as nested classes

public static void ReflectInType<T>(Type transformationType, Action<Type, T> persistor) where T : class

Parameters

transformationType Type

The type that should be reflected

persistor Action<Type, T>

A method that should be executed to save the reflected transformation rule

Type Parameters

T

Remarks

This method reflects the nested classes contained in the given type. It does not look in base types!

Exceptions

ArgumentNullException

An ArgumentNullException is thrown if the transformationType parameter is passed a null instance

ArgumentNullException

An ArgumentNullException is thrown if the persistor parameter is passed a null instance