public static SpeechSynthesizer GetSpeech(ExecutionEnvironment environment) { SpeechSynthesizer Speach = null; if (environment.HasValue(Name)) { Speach = environment.GetValue(Name) as SpeechSynthesizer; } else { Speach = new SpeechSynthesizer(); environment.GetBaseEnvironment().RegisterValue(Name, Speach); } return(Speach); }
public static ConsoleWindow GetConsole(ExecutionEnvironment enviroment) { if (!enviroment.HasValue("#$Console$#")) { Application.Current.Dispatcher.Invoke(() => { consoleWindow = new ConsoleWindow(); consoleWindow.Owner = Application.Current.MainWindow; consoleWindow.Show(); }); enviroment.GetBaseEnvironment().RegisterValue("#$Console$#", consoleWindow); } else { consoleWindow = enviroment.GetValue("#$Console$#") as ConsoleWindow; } return(consoleWindow); }
public static ConsoleWindow GetConsole(ExecutionEnvironment enviroment) { ConsoleWindow wnd = null; if (!enviroment.HasValue("#$Console$#")) { Application.Current.Dispatcher.Invoke(() => { wnd = new ConsoleWindow(); wnd.Owner = Application.Current.MainWindow; wnd.Show(); }); enviroment.GetBaseEnvironment().RegisterValue("#$Console$#", wnd); ConsoleBaseStatement.consoleWindow = wnd; } else { wnd = enviroment.GetValue("#$Console$#") as ConsoleWindow; } return(wnd); }
public static DrawWindow GetCanvas(ExecutionEnvironment environment) { DrawWindow canvas = null; if (!environment.HasValue(CanvasName)) { ExecutionEnvironment b = environment.GetBaseEnvironment(); Application.Current.Dispatcher.Invoke(() => { canvas = new DrawWindow(); if (Application.Current.MainWindow != null) { canvas.Owner = Application.Current.MainWindow; } canvas.Show(); }); b.RegisterValue(CanvasName, canvas); } else { canvas = environment.GetValue(CanvasName) as DrawWindow; } return(canvas); }