# DXGfxLib.ScriptManager Class Reference

With the addition of scripts to scene node, we needed a central class to perform compilation and other services for the Script class so that it becomes usable. This is the role of the script manager. This class keeps track of whether the script are up to date and everything. It manage the compilation of the scripts... More...

Collaboration diagram for DXGfxLib.ScriptManager:

[legend]

List of all members.

## Public Member Functions
| ScriptManager ()
| Constructor. As we want to authorise only one instance of this class per AppDomain we check if we have already created one and if we have we throw an exception here.
void | Dispose ()
| This should dispose all resources owned by the script manager.
void | RegisterScript (Script script)
| When a Script is added to a scene node, the script needs to be registered to the ScriptManage if you want it to be compiled. At the moment this is done by the scene node code itself. If the script is already registerd it won't be registered twice you can safely call this method without creating havok.
void | ScriptUpdated (Script script)
| If a script has been updated by the user you should call this.
void | UnRegisterScript (Script script)
| When you don't want a script anymore you can unregister it.
void | GetReady ()
| Ask the ScriptManager instance to compile all script if needed.
Assembly | Compile (ref string errors)
| This method will compile everything and return errors if any in the string errors.
void | BuildReferences ()
| This method build a list of string containing all the references we should need.
string[] | GetReferences ()
| This method return the list of references.
void | SetReferences (string[] references)
| This allow us to set a new list of references to the ScriptManager is we want to.
ExecutableBlock | GetNewExecutableBlock (string name)
| This will create an instance of a class deriving from ExecutableBlock for us. This is central to how our scripts run.
| ScriptManager ()
| Constructor. As we want to authorise only one instance of this class per AppDomain we check if we have already created one and if we have we throw an exception here.
void | Dispose ()
| This should dispose all resources owned by the script manager.
void | RegisterScript (Script script)
| When a Script is added to a scene node, the script needs to be registered to the ScriptManage if you want it to be compiled. At the moment this is done by the scene node code itself. If the script is already registerd it won't be registered twice you can safely call this method without creating havok.
void | ScriptUpdated (Script script)
| If a script has been updated by the user you should call this.
void | UnRegisterScript (Script script)
| When you don't want a script anymore you can unregister it.
void | GetReady ()
| Ask the ScriptManager instance to compile all script if needed.
Assembly | Compile (ref string errors)
| This method will compile everything and return errors if any in the string errors.
void | BuildReferences ()
| This method build a list of string containing all the references we should need.
string[] | GetReferences ()
| This method return the list of references.
void | SetReferences (string[] references)
| This allow us to set a new list of references to the ScriptManager is we want to.
ExecutableBlock | GetNewExecutableBlock (string name)
| This will create an instance of a class deriving from ExecutableBlock for us. This is central to how our scripts run.
## Static Public Member Functions
static ScriptManager | GetGlobalInstance ()
| This static method will return a ref on our unique instance of ScriptManager in this appDomain.
static ScriptManager | GetGlobalInstance ()
| This static method will return a ref on our unique instance of ScriptManager in this appDomain.
## Public Attributes
bool | scriptsAreReady = false
| Are our scripts ready to be executed or do we know that some scripts have been modified since last compilation.
string | lastCompilationErrorMessage = ""
| Potential errors that have happened during last compilation.

## Detailed Description

With the addition of scripts to scene node, we needed a central class to perform compilation and other services for the Script class so that it becomes usable. This is the role of the script manager. This class keeps track of whether the script are up to date and everything. It manage the compilation of the scripts...

Important Note!! At the moment it is not possible to unload a specific assembly from an AppDomain although it is possible to fully unload an AppDomain. Each time script are modified an assembly is created on the fly. As they are never unloaded this means that sometime it might be good to restart the editor :). This is a bit ugly I confess. One option would be to have script run in a different app domain but this makes things much more complicated. Another option would be to have a loader for the editor which restart the editor from time to time. Need to double check if something was added with .Net 2.0 which would allow me to change the design of this. TODO.

Definition at line 40 of file ScriptManager.cs.

## Constructor & Destructor Documentation

DXGfxLib.ScriptManager.ScriptManager | ( |  | ) |

Constructor. As we want to authorise only one instance of this class per AppDomain we check if we have already created one and if we have we throw an exception here.

Definition at line 76 of file ScriptManager.cs.

Here is the call graph for this function:

DXGfxLib.ScriptManager.ScriptManager | ( |  | ) |

Constructor. As we want to authorise only one instance of this class per AppDomain we check if we have already created one and if we have we throw an exception here.

Definition at line 76 of file ScriptManager.cs.

Here is the call graph for this function:

## Member Function Documentation

void DXGfxLib.ScriptManager.BuildReferences | ( |  | ) |

This method build a list of string containing all the references we should need.

Definition at line 238 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.BuildReferences | ( |  | ) |

This method build a list of string containing all the references we should need.

Definition at line 238 of file ScriptManager.cs.

Here is the caller graph for this function:

Assembly DXGfxLib.ScriptManager.Compile | ( | ref string | errors | ) |

This method will compile everything and return errors if any in the string errors.

Parameters:

  | errors |

Returns:

Definition at line 167 of file ScriptManager.cs.

Here is the call graph for this function:

Assembly DXGfxLib.ScriptManager.Compile | ( | ref string | errors | ) |

This method will compile everything and return errors if any in the string errors.

Parameters:

  | errors |

Returns:

Definition at line 167 of file ScriptManager.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

void DXGfxLib.ScriptManager.Dispose | ( |  | ) |

This should dispose all resources owned by the script manager.

Definition at line 93 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.Dispose | ( |  | ) |

This should dispose all resources owned by the script manager.

Definition at line 93 of file ScriptManager.cs.

Here is the caller graph for this function:

static ScriptManager DXGfxLib.ScriptManager.GetGlobalInstance | ( |  | ) | `[static]`

This static method will return a ref on our unique instance of ScriptManager in this appDomain.

Returns:

Definition at line 102 of file ScriptManager.cs.

static ScriptManager DXGfxLib.ScriptManager.GetGlobalInstance | ( |  | ) | `[static]`

This static method will return a ref on our unique instance of ScriptManager in this appDomain.

Returns:

Definition at line 102 of file ScriptManager.cs.

ExecutableBlock DXGfxLib.ScriptManager.GetNewExecutableBlock | ( | string | name | ) |

This will create an instance of a class deriving from ExecutableBlock for us. This is central to how our scripts run.

Parameters:

  | name |

Returns:

Definition at line 279 of file ScriptManager.cs.

ExecutableBlock DXGfxLib.ScriptManager.GetNewExecutableBlock | ( | string | name | ) |

This will create an instance of a class deriving from ExecutableBlock for us. This is central to how our scripts run.

Parameters:

  | name |

Returns:

Definition at line 279 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.GetReady | ( |  | ) |

Ask the ScriptManager instance to compile all script if needed.

Definition at line 147 of file ScriptManager.cs.

Here is the call graph for this function:

void DXGfxLib.ScriptManager.GetReady | ( |  | ) |

Ask the ScriptManager instance to compile all script if needed.

Definition at line 147 of file ScriptManager.cs.

Here is the call graph for this function:

string [] DXGfxLib.ScriptManager.GetReferences | ( |  | ) |

This method return the list of references.

Returns:

Definition at line 259 of file ScriptManager.cs.

string [] DXGfxLib.ScriptManager.GetReferences | ( |  | ) |

This method return the list of references.

Returns:

Definition at line 259 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.RegisterScript | ( | Script | script | ) |

When a Script is added to a scene node, the script needs to be registered to the ScriptManage if you want it to be compiled. At the moment this is done by the scene node code itself. If the script is already registerd it won't be registered twice you can safely call this method without creating havok.

Parameters:

  | script |

Definition at line 117 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.RegisterScript | ( | Script | script | ) |

When a Script is added to a scene node, the script needs to be registered to the ScriptManage if you want it to be compiled. At the moment this is done by the scene node code itself. If the script is already registerd it won't be registered twice you can safely call this method without creating havok.

Parameters:

  | script |

Definition at line 117 of file ScriptManager.cs.

Here is the caller graph for this function:

void DXGfxLib.ScriptManager.ScriptUpdated | ( | Script | script | ) |

If a script has been updated by the user you should call this.

Parameters:

  | script |

Definition at line 129 of file ScriptManager.cs.

Here is the call graph for this function:

void DXGfxLib.ScriptManager.ScriptUpdated | ( | Script | script | ) |

If a script has been updated by the user you should call this.

Parameters:

  | script |

Definition at line 129 of file ScriptManager.cs.

Here is the call graph for this function:

void DXGfxLib.ScriptManager.SetReferences | ( | string[] | references | ) |

This allow us to set a new list of references to the ScriptManager is we want to.

Parameters:

  | references |

Definition at line 268 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.SetReferences | ( | string[] | references | ) |

This allow us to set a new list of references to the ScriptManager is we want to.

Parameters:

  | references |

Definition at line 268 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.UnRegisterScript | ( | Script | script | ) |

When you don't want a script anymore you can unregister it.

Parameters:

  | script |

Definition at line 139 of file ScriptManager.cs.

void DXGfxLib.ScriptManager.UnRegisterScript | ( | Script | script | ) |

When you don't want a script anymore you can unregister it.

Parameters:

  | script |

Definition at line 139 of file ScriptManager.cs.

## Member Data Documentation

string DXGfxLib.ScriptManager::lastCompilationErrorMessage = ""

Potential errors that have happened during last compilation.

Definition at line 70 of file ScriptManager.cs.

bool DXGfxLib.ScriptManager::scriptsAreReady = false

Are our scripts ready to be executed or do we know that some scripts have been modified since last compilation.

Definition at line 65 of file ScriptManager.cs.

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

- D:/guillaume/guillara/3D/DXGfx/Backup/DXGfxLib/ScriptManager.cs
- D:/guillaume/guillara/3D/DXGfx/DXGfxLib/ScriptManager.cs