|
static List< string > | usings = new List<string>() |
|
◆ Script() [1/2]
BioGTK.Scripting.Script.Script |
( |
string |
file, |
|
|
string |
scriptStr |
|
) |
| |
|
inline |
205 {
206 name = System.IO.Path.GetFileName(
file);
208 if (
file.EndsWith(
".txt") ||
file.EndsWith(
".ijm"))
210 }
ScriptType type
Definition Scripting.cs:202
string name
Definition Scripting.cs:191
string file
Definition Scripting.cs:192
string scriptString
Definition Scripting.cs:193
ScriptType
Definition Scripting.cs:421
◆ Script() [2/2]
BioGTK.Scripting.Script.Script |
( |
string |
file | ) |
|
|
inline |
214 {
215 name = System.IO.Path.GetFileName(
file);
218 if (
file.EndsWith(
".txt") ||
file.EndsWith(
".ijm"))
220 }
◆ Run() [1/2]
void BioGTK.Scripting.Script.Run |
( |
| ) |
|
|
inline |
It creates a new thread and starts it.
312 {
315 scriptName = this.
name;
316 thread =
new Thread(
new ThreadStart(RunScript));
318 }
Thread thread
Definition Scripting.cs:201
static Dictionary< string, Script > scripts
Definition Scripting.cs:183
◆ Run() [2/2]
static void BioGTK.Scripting.Script.Run |
( |
Script |
rn | ) |
|
|
inlinestatic |
It creates a new thread and starts it.
The thread is started by calling the RunScript function.
- Parameters
-
Script | The script you want to run. |
226 {
227 scriptName = rn.name;
228 Thread t = new Thread(new ThreadStart(RunScript));
229 t.Start();
230 }
◆ RunString()
static object BioGTK.Scripting.Script.RunString |
( |
string |
st | ) |
|
|
inlinestatic |
It takes a string, adds using statements, wraps it in a class, and then runs it.
- Parameters
-
st | The string to be executed |
- Returns
- The return value of the last statement in the script.
276 {
277 try
278 {
279 string loader =
280 @"//css_reference " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + @".dll
281 using System;
282 using Gtk;
283 using System.Threading;
284 using BioGTK;
285 using AForge;";
286 foreach (
string s
in usings)
287 {
288 loader +=
usings + Environment.NewLine;
289 }
290 loader += @"
291 public class Loader
292 {
293 public object Load()
294 {" +
295 st + @";
296 return true;
297 }
298 }";
299 dynamic
script = CSScript.Evaluator.LoadCode(loader);
301 }
302 catch (Exception e)
303 {
304 MessageDialog md =
new MessageDialog(
window,
305 DialogFlags.DestroyWithParent, MessageType.Info,
306 ButtonsType.Close, e.Message + ", " + e.Source);
307 return e;
308 }
309 }
dynamic script
Definition Scripting.cs:195
static List< string > usings
Definition Scripting.cs:199
static Window window
Definition Scripting.cs:177
◆ Stop()
void BioGTK.Scripting.Script.Stop |
( |
| ) |
|
|
inline |
It stops the thread.
321 {
323 }
bool exit
Definition Scripting.cs:194
◆ ToString()
override string BioGTK.Scripting.Script.ToString |
( |
| ) |
|
|
inline |
If the thread is not null, return the name and the thread state. Otherwise, return the name
- Returns
- The name of the thread and the state of the thread.
329 {
331 {
332 return name.ToString() +
", " +
thread.ThreadState.ToString();
333 }
334 else
335 return name.ToString();
336 }
◆ done
bool BioGTK.Scripting.Script.done = false |
◆ ex
Exception BioGTK.Scripting.Script.ex = null |
◆ exit
bool BioGTK.Scripting.Script.exit = false |
◆ file
string BioGTK.Scripting.Script.file |
◆ name
string BioGTK.Scripting.Script.name |
◆ obj
object BioGTK.Scripting.Script.obj |
◆ output
string BioGTK.Scripting.Script.output = "" |
◆ script
dynamic BioGTK.Scripting.Script.script |
◆ scriptString
string BioGTK.Scripting.Script.scriptString |
◆ thread
Thread BioGTK.Scripting.Script.thread |
◆ type
◆ usings
List<string> BioGTK.Scripting.Script.usings = new List<string>() |
|
static |
The documentation for this class was generated from the following file: