<PackageReference Include="Castle.Core" Version="4.0.0" />

ModuleScope

public class ModuleScope
Summary description for ModuleScope.
public static readonly string DEFAULT_ASSEMBLY_NAME

The default assembly (simple) name used for the assemblies generated by a ModuleScope instance.

public static readonly string DEFAULT_FILE_NAME

The default file name used when the assembly is saved using DEFAULT_FILE_NAME.

public Lock Lock { get; }

Users of this ModuleScope should use this lock when accessing the cache.

public INamingScope NamingScope { get; }

Gets the strong-named module generated by this scope, or null if none has yet been generated.

public string StrongNamedModuleDirectory { get; }

Gets the directory where the strongly named module generated by this scope will be saved, or null if the current directory is used.

public string StrongNamedModuleName { get; }

Gets the file name of the strongly named module generated by this scope.

Gets the weak-named module generated by this scope, or null if none has yet been generated.

public string WeakNamedModuleDirectory { get; }

Gets the directory where the weakly named module generated by this scope will be saved, or null if the current directory is used.

public string WeakNamedModuleName { get; }

Gets the file name of the weakly named module generated by this scope.

public ModuleScope()

Initializes a new instance of the ModuleScope class; assemblies created by this instance will not be saved.

public ModuleScope(bool savePhysicalAssembly)

Initializes a new instance of the ModuleScope class, allowing to specify whether the assemblies generated by this instance should be saved.

public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule)

Initializes a new instance of the ModuleScope class, allowing to specify whether the assemblies generated by this instance should be saved.

public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, string strongAssemblyName, string strongModulePath, string weakAssemblyName, string weakModulePath)

Initializes a new instance of the ModuleScope class, allowing to specify whether the assemblies generated by this instance should be saved and what simple names are to be assigned to them.

public ModuleScope(bool savePhysicalAssembly, bool disableSignedModule, INamingScope namingScope, string strongAssemblyName, string strongModulePath, string weakAssemblyName, string weakModulePath)

Initializes a new instance of the ModuleScope class, allowing to specify whether the assemblies generated by this instance should be saved and what simple names are to be assigned to them.

public static byte[] GetKeyPair()

Gets the key pair used to sign the strong-named assembly generated by this ModuleScope.

public TypeBuilder DefineType(bool inSignedModulePreferably, string name, TypeAttributes flags)

Returns a type from this scope's type cache, or null if the key cannot be found.

public void LoadAssemblyIntoCache(Assembly assembly)

Loads the generated types from the given assembly into this ModuleScope's cache.

public ModuleBuilder ObtainDynamicModule(bool isStrongNamed)

Gets the specified module generated by this scope, creating a new one if none has yet been generated.

Gets the strong-named module generated by this scope, creating a new one if none has yet been generated.

Gets the weak-named module generated by this scope, creating a new one if none has yet been generated.

public void RegisterInCache(CacheKey key, Type type)

Registers a type in this scope's type cache.

public string SaveAssembly()

Saves the generated assembly with the name and directory information given when this ModuleScope instance was created (or with the DEFAULT_FILE_NAME and current directory if none was given).

public string SaveAssembly(bool strongNamed)

Saves the specified generated assembly with the name and directory information given when this ModuleScope instance was created (or with the DEFAULT_FILE_NAME and current directory if none was given).