C# Class ReflectionMagic.PrivateReflectionUsingDynamicExtensions

Show file Open project: davidebbo/ReflectionMagic

Public Methods

Method Description
AsDynamic ( this o ) : dynamic

Wraps the specified object in a dynamic object that allows access to private members.

Does not wrap null, string, primitive types, and already wrapped objects.

AsDynamicType ( this type ) : dynamic

Wraps the specified type in a dynamic object which allows easy instantion through the PrivateReflectionDynamicObjectStatic.New method.

CreateDynamicInstance ( this assembly, string typeName ) : dynamic

Tries to instantiate the type with the specified type name from the specified assembly instance using the specified constructor arguments.

GetDynamicType ( this assembly, string typeName ) : dynamic

Gets the type with the specified name from the specified assembly instance, and returns it as a dynamic object. See also AsDynamicType.

Method Details

AsDynamic() public static method

Wraps the specified object in a dynamic object that allows access to private members.
Does not wrap null, string, primitive types, and already wrapped objects.
public static AsDynamic ( this o ) : dynamic
o this The object to wrap
return dynamic

AsDynamicType() public static method

Wraps the specified type in a dynamic object which allows easy instantion through the PrivateReflectionDynamicObjectStatic.New method.
public static AsDynamicType ( this type ) : dynamic
type this The type to wrap.
return dynamic

CreateDynamicInstance() public static method

Tries to instantiate the type with the specified type name from the specified assembly instance using the specified constructor arguments.
Thrown when no suitable constructor can be found.
public static CreateDynamicInstance ( this assembly, string typeName ) : dynamic
assembly this The assembly instance to search.
typeName string The full type name.
return dynamic

GetDynamicType() public static method

Gets the type with the specified name from the specified assembly instance, and returns it as a dynamic object. See also AsDynamicType.
public static GetDynamicType ( this assembly, string typeName ) : dynamic
assembly this The assembly instance to search for the type.
typeName string The type name.
return dynamic