C# Class Spring.Util.DynamicCodeManager

Use this class for obtaining ModuleBuilder instances for dynamic code generation.

The purpose of this class is to provide a simple abstraction for creating and managing dynamic assemblies.

Using this factory you can't define several modules within a single dynamic assembly - only a simple one2one relation between assembly/module is used.
Show file Open project: spring-projects/spring-net

Public Methods

Method Description
Clear ( ) : void

Removes all registered ModuleBuilders.

GetModuleBuilder ( string assemblyName ) : ModuleBuilder

Returns the ModuleBuilder for the dynamic module within the specified assembly.

If the assembly does not exist yet, it will be created.
This factory caches any dynamic assembly it creates - calling GetModule() twice with the same name will *not* create 2 distinct modules!

Private Methods

Method Description
DynamicCodeManager ( ) : System

prevent instantiation

SaveAssembly ( string assemblyName ) : void

Method Details

Clear() public static method

Removes all registered ModuleBuilders.
public static Clear ( ) : void
return void

GetModuleBuilder() public static method

Returns the ModuleBuilder for the dynamic module within the specified assembly.
If the assembly does not exist yet, it will be created.
This factory caches any dynamic assembly it creates - calling GetModule() twice with the same name will *not* create 2 distinct modules!
public static GetModuleBuilder ( string assemblyName ) : ModuleBuilder
assemblyName string The assembly-name of the module to be returned
return System.Reflection.Emit.ModuleBuilder