Craig's Utility Library  4.0 Beta
Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase Class Reference

Compiler base class More...

Inheritance diagram for Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase:
Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass Utilities.DataTypes.CodeGen.Compiler

Public Member Functions

override string ToString ()
 Outputs basic information about the compiler as a string More...
 
- Public Member Functions inherited from Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass
void Dispose ()
 Dispose function More...
 

Protected Member Functions

 CompilerBase (string AssemblyName, string AssemblyDirectory="", bool Optimize=true)
 Constructor More...
 
Type Add (string ClassName, string Code, IEnumerable< string > Usings, params Assembly[] References)
 Compiles and adds the item to the module More...
 
IEnumerable< Type > Add (string Code, IEnumerable< string > Usings, params Assembly[] References)
 Adds the specified code. More...
 
Type Add (string ClassName, string Code, params Assembly[] References)
 Compiles and adds the item to the module More...
 
override void Dispose (bool Managed)
 Disposes of the object More...
 
void Save ()
 Saves the assembly More...
 
- Protected Member Functions inherited from Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass
 SafeDisposableBaseClass ()
 Construct More...
 

Static Protected Member Functions

static T Create< T > (Type TypeToCreate, params object[] Args)
 Creates an object using the type specified More...
 

Properties

string AssemblyDirectory [get]
 Assembly directory More...
 
string AssemblyName [get]
 Assembly name More...
 
ICollection< Type > Classes [get]
 Dictionary containing generated types and associates it with original type More...
 
MemoryStream AssemblyStream [get]
 Gets the assembly stream. More...
 
bool Optimize [get]
 Should this be optimized? More...
 
bool RegenerateAssembly [get]
 Determines if the assembly needs to be regenerated More...
 

Detailed Description

Compiler base class

Definition at line 38 of file CompilerBase.cs.

Constructor & Destructor Documentation

Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.CompilerBase ( string  AssemblyName,
string  AssemblyDirectory = "",
bool  Optimize = true 
)
protected

Constructor

Parameters
AssemblyDirectoryDirectory to save the generated types (optional)
AssemblyNameAssembly name to save the generated types as
OptimizeShould this be optimized (defaults to true)

Definition at line 46 of file CompilerBase.cs.

Member Function Documentation

Type Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Add ( string  ClassName,
string  Code,
IEnumerable< string >  Usings,
params Assembly[]  References 
)
protected

Compiles and adds the item to the module

Parameters
ClassNameClass name
CodeCode to compile
UsingsUsings for the code
ReferencesReferences to add for the compiler
Returns
This

Definition at line 132 of file CompilerBase.cs.

IEnumerable<Type> Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Add ( string  Code,
IEnumerable< string >  Usings,
params Assembly[]  References 
)
protected

Adds the specified code.

Parameters
CodeThe code.
UsingsThe usings.
ReferencesThe references.
Returns
The list of types that have been added
Exceptions
System.ExceptionAny errors that are sent back by Roslyn

Definition at line 147 of file CompilerBase.cs.

Type Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Add ( string  ClassName,
string  Code,
params Assembly[]  References 
)
protected

Compiles and adds the item to the module

Parameters
ClassNameClass name
CodeCode to compile
ReferencesReferences to add for the compiler
Returns
This

Definition at line 174 of file CompilerBase.cs.

static T Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Create< T > ( Type  TypeToCreate,
params object[]  Args 
)
staticprotected

Creates an object using the type specified

Template Parameters
TType to cast to
Parameters
TypeToCreateType to create
ArgsArgs to pass to the constructor
Returns
The created object

Definition at line 118 of file CompilerBase.cs.

override void Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Dispose ( bool  Managed)
protectedvirtual

Disposes of the object

Parameters
ManagedDestroy managed

Implements Utilities.DataTypes.Patterns.BaseClasses.SafeDisposableBaseClass.

Definition at line 183 of file CompilerBase.cs.

void Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Save ( )
protected

Saves the assembly

Definition at line 197 of file CompilerBase.cs.

override string Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.ToString ( )

Outputs basic information about the compiler as a string

Returns
The string version of the compiler

Definition at line 106 of file CompilerBase.cs.

Property Documentation

string Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.AssemblyDirectory
get

Assembly directory

Definition at line 74 of file CompilerBase.cs.

string Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.AssemblyName
get

Assembly name

Definition at line 79 of file CompilerBase.cs.

MemoryStream Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.AssemblyStream
getprotected

Gets the assembly stream.

The assembly stream.

Definition at line 90 of file CompilerBase.cs.

ICollection<Type> Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Classes
get

Dictionary containing generated types and associates it with original type

Definition at line 84 of file CompilerBase.cs.

bool Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.Optimize
getprotected

Should this be optimized?

Definition at line 95 of file CompilerBase.cs.

bool Utilities.DataTypes.CodeGen.BaseClasses.CompilerBase.RegenerateAssembly
getprotected

Determines if the assembly needs to be regenerated

Definition at line 100 of file CompilerBase.cs.


The documentation for this class was generated from the following file: