C# Class Castle.DynamicProxy.ModuleScope

Summary description for ModuleScope.
Afficher le fichier Open project: Jarvin-Guan/CleanAOP Class Usage Examples

Méthodes publiques

Свойство Type Description
DEFAULT_ASSEMBLY_NAME String
DEFAULT_FILE_NAME String

Méthodes publiques

Méthode Description
DefineType ( bool inSignedModulePreferably, string name, TypeAttributes flags ) : TypeBuilder
GetFromCache ( Castle.DynamicProxy.Generators.CacheKey key ) : Type

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

GetKeyPair ( ) : byte[]

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

LoadAssemblyIntoCache ( Assembly assembly ) : void

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

This method can be used to load previously generated and persisted proxy types from disk into this scope's type cache, eg. in order to avoid the performance hit associated with proxy generation.

ModuleScope ( ) : System

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

ModuleScope ( bool savePhysicalAssembly ) : System

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

ModuleScope ( bool savePhysicalAssembly, bool disableSignedModule ) : System

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

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

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.

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

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.

ObtainDynamicModule ( bool isStrongNamed ) : ModuleBuilder

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

ObtainDynamicModuleWithStrongName ( ) : ModuleBuilder

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

ObtainDynamicModuleWithWeakName ( ) : ModuleBuilder

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

RegisterInCache ( Castle.DynamicProxy.Generators.CacheKey key, Type type ) : void

Registers a type in this scope's type cache.

SaveAssembly ( ) : string

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).

This method stores the generated assembly in the directory passed as part of the module information specified when this instance was constructed (if any, else the current directory is used). If both a strong-named and a weak-named assembly have been generated, it will throw an exception; in this case, use the SaveAssembly (bool) overload.

If this ModuleScope was created without indicating that the assembly should be saved, this method does nothing.

SaveAssembly ( bool strongNamed ) : string

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

This method stores the specified generated assembly in the directory passed as part of the module information specified when this instance was constructed (if any, else the current directory is used).

If this ModuleScope was created without indicating that the assembly should be saved, this method does nothing.

Private Methods

Méthode Description
AddCacheMappings ( AssemblyBuilder builder ) : void
CreateModule ( bool signStrongName ) : ModuleBuilder
GetAssemblyName ( bool signStrongName ) : AssemblyName

Method Details

DefineType() public méthode

public DefineType ( bool inSignedModulePreferably, string name, TypeAttributes flags ) : TypeBuilder
inSignedModulePreferably bool
name string
flags TypeAttributes
Résultat System.Reflection.Emit.TypeBuilder

GetFromCache() public méthode

Returns a type from this scope's type cache, or null if the key cannot be found.
public GetFromCache ( Castle.DynamicProxy.Generators.CacheKey key ) : Type
key Castle.DynamicProxy.Generators.CacheKey The key to be looked up in the cache.
Résultat System.Type

GetKeyPair() public static méthode

Gets the key pair used to sign the strong-named assembly generated by this ModuleScope.
public static GetKeyPair ( ) : byte[]
Résultat byte[]

LoadAssemblyIntoCache() public méthode

Loads the generated types from the given assembly into this ModuleScope's cache.
This method can be used to load previously generated and persisted proxy types from disk into this scope's type cache, eg. in order to avoid the performance hit associated with proxy generation.
public LoadAssemblyIntoCache ( Assembly assembly ) : void
assembly System.Reflection.Assembly The assembly to load types from. This assembly must have been saved via or /// , or it must have the manually applied.
Résultat void

ModuleScope() public méthode

Initializes a new instance of the ModuleScope class; assemblies created by this instance will not be saved.
public ModuleScope ( ) : System
Résultat System

ModuleScope() public méthode

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 ) : System
savePhysicalAssembly bool If set to true saves the generated module.
Résultat System

ModuleScope() public méthode

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 ) : System
savePhysicalAssembly bool If set to true saves the generated module.
disableSignedModule bool If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions.
Résultat System

ModuleScope() public méthode

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 ) : System
savePhysicalAssembly bool If set to true saves the generated module.
disableSignedModule bool If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions.
namingScope INamingScope Naming scope used to provide unique names to generated types and their members (usually via sub-scopes).
strongAssemblyName string The simple name of the strong-named assembly generated by this .
strongModulePath string The path and file name of the manifest module of the strong-named assembly generated by this .
weakAssemblyName string The simple name of the weak-named assembly generated by this .
weakModulePath string The path and file name of the manifest module of the weak-named assembly generated by this .
Résultat System

ModuleScope() public méthode

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, string strongAssemblyName, string strongModulePath, string weakAssemblyName, string weakModulePath ) : System
savePhysicalAssembly bool If set to true saves the generated module.
disableSignedModule bool If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions.
strongAssemblyName string The simple name of the strong-named assembly generated by this .
strongModulePath string The path and file name of the manifest module of the strong-named assembly generated by this .
weakAssemblyName string The simple name of the weak-named assembly generated by this .
weakModulePath string The path and file name of the manifest module of the weak-named assembly generated by this .
Résultat System

ObtainDynamicModule() public méthode

Gets the specified module generated by this scope, creating a new one if none has yet been generated.
public ObtainDynamicModule ( bool isStrongNamed ) : ModuleBuilder
isStrongNamed bool If set to true, a strong-named module is returned; otherwise, a weak-named module is returned.
Résultat System.Reflection.Emit.ModuleBuilder

ObtainDynamicModuleWithStrongName() public méthode

Gets the strong-named module generated by this scope, creating a new one if none has yet been generated.
public ObtainDynamicModuleWithStrongName ( ) : ModuleBuilder
Résultat System.Reflection.Emit.ModuleBuilder

ObtainDynamicModuleWithWeakName() public méthode

Gets the weak-named module generated by this scope, creating a new one if none has yet been generated.
public ObtainDynamicModuleWithWeakName ( ) : ModuleBuilder
Résultat System.Reflection.Emit.ModuleBuilder

RegisterInCache() public méthode

Registers a type in this scope's type cache.
public RegisterInCache ( Castle.DynamicProxy.Generators.CacheKey key, Type type ) : void
key Castle.DynamicProxy.Generators.CacheKey The key to be associated with the type.
type System.Type The type to be stored in the cache.
Résultat void

SaveAssembly() public méthode

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).

This method stores the generated assembly in the directory passed as part of the module information specified when this instance was constructed (if any, else the current directory is used). If both a strong-named and a weak-named assembly have been generated, it will throw an exception; in this case, use the SaveAssembly (bool) overload.

If this ModuleScope was created without indicating that the assembly should be saved, this method does nothing.

Both a strong-named and a weak-named assembly have been generated.
public SaveAssembly ( ) : string
Résultat string

SaveAssembly() public méthode

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

This method stores the specified generated assembly in the directory passed as part of the module information specified when this instance was constructed (if any, else the current directory is used).

If this ModuleScope was created without indicating that the assembly should be saved, this method does nothing.

No assembly has been generated that matches the parameter. ///
public SaveAssembly ( bool strongNamed ) : string
strongNamed bool True if the generated assembly with a strong name should be saved (see ); /// false if the generated assembly without a strong name should be saved (see .
Résultat string

Property Details

DEFAULT_ASSEMBLY_NAME public_oe static_oe property

The default assembly (simple) name used for the assemblies generated by a ModuleScope instance.
public static String DEFAULT_ASSEMBLY_NAME
Résultat String

DEFAULT_FILE_NAME public_oe static_oe property

The default file name used when the assembly is saved using DEFAULT_FILE_NAME.
public static String DEFAULT_FILE_NAME
Résultat String