C# Class Aura.Shared.Scripting.ScriptManager

Datei anzeigen Open project: aura-project/aura

Protected Properties

Property Type Description
_compilers Compiler>.Dictionary
_scripts Type>.Dictionary
_scriptsToDispose List

Public Methods

Method Description
GetScriptType ( string typeName ) : Type

Returns the type of the script with the given name.

LoadScripts ( string scriptListFile ) : void

Loads scripts from list file.

ScriptManager ( ) : Aura.Data

Creates new script manager.

Protected Methods

Method Description
DisposeScripts ( ) : void

Disposes all disposable scripts and clears internal script list.

GetAssembly ( string path ) : Assembly

Loads assembly for script, compiles it if necessary. Returns null if there was a problem.

GetCachePath ( string path ) : string

Returns path for the compiled version of the script. Creates directory structure if it doesn't exist.

GetJITtedTypes ( Assembly asm, string filePath ) : IEnumerable

TODO: We might want to stop loading if this is a problem, scripts might depend on each other, which could lead to more errors.

ReadScriptList ( string scriptListFile ) : List

Returns list of script files loaded from scripts.txt.

Private Methods

Method Description
InitializeScripts ( ) : void

Initializes all scripts loaded from assemblies.

LoadScript ( string scriptPath ) : bool

Loads script from given path.

LoadScriptAssembly ( Assembly asm, string filePath ) : void

Reads script classes from assembly and adds them to internal script list.

LoadScripts ( ICollection scriptFileList ) : int

Loads scripts from collection.

Method Details

DisposeScripts() protected method

Disposes all disposable scripts and clears internal script list.
protected DisposeScripts ( ) : void
return void

GetAssembly() protected method

Loads assembly for script, compiles it if necessary. Returns null if there was a problem.
protected GetAssembly ( string path ) : Assembly
path string
return System.Reflection.Assembly

GetCachePath() protected method

Returns path for the compiled version of the script. Creates directory structure if it doesn't exist.
protected GetCachePath ( string path ) : string
path string
return string

GetJITtedTypes() protected static method

TODO: We might want to stop loading if this is a problem, scripts might depend on each other, which could lead to more errors.
protected static GetJITtedTypes ( Assembly asm, string filePath ) : IEnumerable
asm System.Reflection.Assembly
filePath string
return IEnumerable

GetScriptType() public method

Returns the type of the script with the given name.
public GetScriptType ( string typeName ) : Type
typeName string
return System.Type

LoadScripts() public method

Loads scripts from list file.
public LoadScripts ( string scriptListFile ) : void
scriptListFile string Text file containing paths to script files.
return void

ReadScriptList() protected method

Returns list of script files loaded from scripts.txt.
protected ReadScriptList ( string scriptListFile ) : List
scriptListFile string
return List

ScriptManager() public method

Creates new script manager.
public ScriptManager ( ) : Aura.Data
return Aura.Data

Property Details

_compilers protected_oe property

protected Dictionary _compilers
return Compiler>.Dictionary

_scripts protected_oe property

protected Dictionary _scripts
return Type>.Dictionary

_scriptsToDispose protected_oe property

protected List _scriptsToDispose
return List