public void IsProcessFinished(ScriptThread thread) { Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process; if (process == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called IsProcessFinished with an invalid object.", LogAlertLevel.Error); return; } thread.SetReturnValue(process.IsFinished); }
public void DestroyProcess(ScriptThread thread) { Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process; if (process == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called DestroyProcess with an invalid object.", LogAlertLevel.Error); return; } process.Finish(ProcessResult.Failed); }
public void DeactiveProcess(ScriptThread thread) { Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process; if (process == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called DeactivateProcess with an invalid object.", LogAlertLevel.Error); return; } ProcessManager.DettachProcess(process); }
public void MakeProcessWait(ScriptThread thread) { Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process; Runtime.Processes.Process waitForProcess = ((NativeObject)thread.GetObjectParameter(1)).Object as Runtime.Processes.Process; if (process == null || waitForProcess == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called MakeProcessWait with an invalid object.", LogAlertLevel.Error); return; } process.WaitForProcess(waitForProcess, (ProcessResult)thread.GetIntegerParameter(2)); }
public void WaitForProcessToFinish(ScriptThread thread) { Runtime.Processes.Process process = ((NativeObject)thread.GetObjectParameter(0)).Object as Runtime.Processes.Process; if (process == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called WaitForProcessToFinish with an invalid object.", LogAlertLevel.Error); return; } thread.IsWaiting = true; // Stop the thread. // Create a script that will start this thread again when the process // has finished. StartScriptProcess waitProcess = new StartScriptProcess(thread); waitProcess.WaitForProcess(process, ProcessResult.Success); ProcessManager.AttachProcess(waitProcess); }
public ProcessScriptObject(Runtime.Processes.Process process) { _nativeObject = process; }