C# Class csscript.CSExecutor

CSExecutor is an class that implements execution of *.cs files.
Inheritance: IScriptExecutor
Mostrar archivo Open project: oleg-shilo/cs-script Class Usage Examples

Public Properties

Property Type Description
lastException System.Exception

Public Methods

Method Description
AddReferencedAssemblies ( CompilerParameters compilerParams, string scriptFileName, CSScriptLibrary.ScriptParser parser ) : void
CSExecutor ( ) : System

Constructor

CSExecutor ( bool rethrow, ExecuteOptions optionsBase ) : System

Constructor

Compile ( string scriptFile, string assemblyFile, bool debugBuild ) : string

Compiles C# script file into assembly.

CreateDefaultConfigFile ( ) : void

Creates the default config file in the CurrentDirectory.

DoCacheOperations ( string command ) : void

Performs the cache operations and shows the operation output.

Execute ( string args, PrintDelegate printDelg, string primaryScript ) : void

The main entry point for the application.

ExecuteImpl ( ) : void

This method implements compiling and execution of the script.

GetCacheDirectory ( string file ) : string

Generates the name of the cache directory for the specified script file.

GetOptions ( ) : ExecuteOptions
GetScriptTempDir ( ) : string

Returns the name of the temporary folder in the CSSCRIPT subfolder of Path.GetTempPath().

Under certain circumstances it may be desirable to the use the alternative location for the CS-Script temporary files. In such cases use SetScriptTempDir() to set the alternative location.

GetScriptTempFile ( ) : string

Returns the name of the temporary file in the CSSCRIPT subfolder of Path.GetTempPath().

ProcessCompilingResult ( CompilerResults results, CompilerParameters compilerParams, CSScriptLibrary.ScriptParser parser, string scriptFileName, string assemblyFileName, string additionalDependencies ) : void
SetScriptCacheDir ( string scriptFile ) : void

Generates the name of the temporary cache folder in the CSSCRIPT subfolder of Path.GetTempPath(). The cache folder is specific for every script file.

SetScriptTempDir ( string path ) : void

Sets the location for the CS-Script temporary files directory.

ShowHelp ( ) : void

Prints Help info.

ShowPrecompilerSample ( ) : void

Show sample precompiler C# script file.

ShowSample ( ) : void

Show sample C# script file.

ShowVersion ( ) : void

Show CS-Script version information.

Private Methods

Method Description
AggregateReferencedAssemblies ( CSScriptLibrary.ScriptParser parser ) : string[]
CoInitializeSecurity ( IntPtr pVoid, int cAuthSvc, IntPtr asAuthSvc, IntPtr pReserved1, int level, int impers, IntPtr pAuthList, int capabilities, IntPtr pReserved3 ) : int
ComInitSecurity ( int RpcImpLevel, int EoAuthnCap ) : void
Compile ( string scriptFileName ) : string

Compiles C# script file.

CompileAssembly ( ICodeCompiler compiler, CompilerParameters compilerParams, string filesToCompile ) : CompilerResults
GetAvailableAssembly ( string scripFileName ) : string

Checks/returns if compiled C# script file (ScriptName + ".compiled") available and valid.

GetCustomAppConfig ( string args ) : string

Returns custom application config file.

GetPersistedSettings ( ArrayList appArgs ) : Settings
GetPersistedSettings ( List appArgs ) : Settings
GetScriptTempFile ( string subDir ) : string
GetTempFileName ( string lpPathName, string lpPrefixString, uint uUnique, [ lpTempFileName ) : uint
LoadCompiler ( string scriptFileName, string &filesToInject ) : ICodeCompiler
LoadDefaultCompiler ( ) : ICodeCompiler
NormalizeGacAssemblyPath ( string asm ) : string
SaveDebuggingMetadata ( string scriptFile ) : void
SetEnvironmentVariable ( string lpName, string lpValue ) : bool
VoidPrint ( string msg ) : void

Dummy 'print' to suppress displaying application messages.

Method Details

AddReferencedAssemblies() public method

public AddReferencedAssemblies ( CompilerParameters compilerParams, string scriptFileName, CSScriptLibrary.ScriptParser parser ) : void
compilerParams System.CodeDom.Compiler.CompilerParameters
scriptFileName string
parser CSScriptLibrary.ScriptParser
return void

CSExecutor() public method

Constructor
public CSExecutor ( ) : System
return System

CSExecutor() public method

Constructor
public CSExecutor ( bool rethrow, ExecuteOptions optionsBase ) : System
rethrow bool
optionsBase ExecuteOptions
return System

Compile() public method

Compiles C# script file into assembly.
public Compile ( string scriptFile, string assemblyFile, bool debugBuild ) : string
scriptFile string
assemblyFile string
debugBuild bool
return string

CreateDefaultConfigFile() public method

Creates the default config file in the CurrentDirectory.
public CreateDefaultConfigFile ( ) : void
return void

DoCacheOperations() public method

Performs the cache operations and shows the operation output.
public DoCacheOperations ( string command ) : void
command string The command.
return void

Execute() public method

The main entry point for the application.
public Execute ( string args, PrintDelegate printDelg, string primaryScript ) : void
args string
printDelg PrintDelegate
primaryScript string
return void

ExecuteImpl() public method

This method implements compiling and execution of the script.
public ExecuteImpl ( ) : void
return void

GetCacheDirectory() public static method

Generates the name of the cache directory for the specified script file.
public static GetCacheDirectory ( string file ) : string
file string Script file name.
return string

GetOptions() public method

public GetOptions ( ) : ExecuteOptions
return ExecuteOptions

GetScriptTempDir() static public method

Returns the name of the temporary folder in the CSSCRIPT subfolder of Path.GetTempPath().

Under certain circumstances it may be desirable to the use the alternative location for the CS-Script temporary files. In such cases use SetScriptTempDir() to set the alternative location.

static public GetScriptTempDir ( ) : string
return string

GetScriptTempFile() static public method

Returns the name of the temporary file in the CSSCRIPT subfolder of Path.GetTempPath().
static public GetScriptTempFile ( ) : string
return string

ProcessCompilingResult() public method

public ProcessCompilingResult ( CompilerResults results, CompilerParameters compilerParams, CSScriptLibrary.ScriptParser parser, string scriptFileName, string assemblyFileName, string additionalDependencies ) : void
results System.CodeDom.Compiler.CompilerResults
compilerParams System.CodeDom.Compiler.CompilerParameters
parser CSScriptLibrary.ScriptParser
scriptFileName string
assemblyFileName string
additionalDependencies string
return void

SetScriptCacheDir() static public method

Generates the name of the temporary cache folder in the CSSCRIPT subfolder of Path.GetTempPath(). The cache folder is specific for every script file.
static public SetScriptCacheDir ( string scriptFile ) : void
scriptFile string script file
return void

SetScriptTempDir() static public method

Sets the location for the CS-Script temporary files directory.
static public SetScriptTempDir ( string path ) : void
path string The path for the temporary directory.
return void

ShowHelp() public method

Prints Help info.
public ShowHelp ( ) : void
return void

ShowPrecompilerSample() public method

Show sample precompiler C# script file.
public ShowPrecompilerSample ( ) : void
return void

ShowSample() public method

Show sample C# script file.
public ShowSample ( ) : void
return void

ShowVersion() public method

Show CS-Script version information.
public ShowVersion ( ) : void
return void

Property Details

lastException public_oe property

This method implements compiling and execution of the script.
public Exception,System lastException
return System.Exception