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

ModuleScope

public class 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 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 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 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.