C# Класс Composite.Core.Types.CodeGenerationManager

Handles all dynamic type compilations and the generation of Composite.Generated.dll
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
AddCompiledAssembly void
ClearOldTempFiles void
CodeGenerationManager System
Compile void
Flush void
LoadAssembliesToMemory Exception>>.ICollection
PopulateBuilder void
ValidateCompositeGenerate void

Открытые методы

Метод Описание
AddAssemblyCodeProvider ( ICodeProvider codeProvider ) : void

Use this method to add a ICodeProvider implementation that will be used when (and only) generating the final Composite.Generated.dll.

CompileRuntimeTempTypes ( Composite.Core.Types.CodeGenerationBuilder codeGenerationBuilder, bool verbose = true ) : IEnumerable

This method will compile the type defined in codeGenerationBuilder and return the result types. These types exists in a temp assembly, that will be deleted when the app domain is terminated.

GenerateCompositeGeneratedAssembly ( bool forceGeneration = false ) : void

This method will recompile Composite.Generated.dll and drop it into bin.

GetCompiledType ( string fullName ) : Type

Gets the compiled types.

IsCompiledAtRuntime ( Type type ) : bool

This method returns true if the given type type is compiled at runetime. Otherwise false.

IsRecompileNeeded ( Type dependableType, IEnumerable dependingTypes ) : bool

This method returns true if the types given by dependingTypes needs a recompile because they either is null or the type given by dependableType has changed and there for exists in a compiled at runtime assembly.

Приватные методы

Метод Описание
AddCompiledAssembly ( Assembly newAssembly ) : void
ClearOldTempFiles ( ) : void
CodeGenerationManager ( ) : System
Compile ( Composite.Core.Types.CodeGenerationBuilder builder ) : void
Flush ( ) : void
LoadAssembliesToMemory ( StringCollection assemblyLocations ) : Exception>>.ICollection
PopulateBuilder ( Composite.Core.Types.CodeGenerationBuilder builder ) : void
ValidateCompositeGenerate ( System.DateTime time ) : void

Validates that the current Composite.Generated.dll is not compiled after the given time. If it is compiled after the given time. Any attempts to recompile Composite.Generated.dll will be ignored. This is used to stop app domains from shutting each other down by recompiles.

Описание методов

AddAssemblyCodeProvider() публичный статический Метод

Use this method to add a ICodeProvider implementation that will be used when (and only) generating the final Composite.Generated.dll.
public static AddAssemblyCodeProvider ( ICodeProvider codeProvider ) : void
codeProvider ICodeProvider
Результат void

CompileRuntimeTempTypes() публичный статический Метод

This method will compile the type defined in codeGenerationBuilder and return the result types. These types exists in a temp assembly, that will be deleted when the app domain is terminated.
public static CompileRuntimeTempTypes ( Composite.Core.Types.CodeGenerationBuilder codeGenerationBuilder, bool verbose = true ) : IEnumerable
codeGenerationBuilder Composite.Core.Types.CodeGenerationBuilder
verbose bool
Результат IEnumerable

GenerateCompositeGeneratedAssembly() публичный статический Метод

This method will recompile Composite.Generated.dll and drop it into bin.
public static GenerateCompositeGeneratedAssembly ( bool forceGeneration = false ) : void
forceGeneration bool
Результат void

GetCompiledType() публичный статический Метод

Gets the compiled types.
public static GetCompiledType ( string fullName ) : Type
fullName string
Результат System.Type

IsCompiledAtRuntime() публичный статический Метод

This method returns true if the given type type is compiled at runetime. Otherwise false.
public static IsCompiledAtRuntime ( Type type ) : bool
type System.Type
Результат bool

IsRecompileNeeded() публичный статический Метод

This method returns true if the types given by dependingTypes needs a recompile because they either is null or the type given by dependableType has changed and there for exists in a compiled at runtime assembly.
public static IsRecompileNeeded ( Type dependableType, IEnumerable dependingTypes ) : bool
dependableType System.Type A type that all the types given by depends on.
dependingTypes IEnumerable All types in this enumerable should either be null or depend on the typoe given by
Результат bool