public void go() { if (executeThread != null && executeThread.IsAlive) { stop(); } fileManager.currentFile.synchronize(); if (fileManager.currentFile.compile(outputBox)) { toRunMode(); if (isInternalMode) { executeProcess = SystemCommand.init(CodeFileManager.virtualFilePrefix + StringGenerator.getBaseName(fileManager.currentFile.getFilename(false)) + ".exe", ""); executeProcess.Start(); executeThread = new Thread(new ThreadStart(() => { executeProcess.StandardInput.WriteAsync(inputBox.textField.Text + "\n"); executeProcess.WaitForExit(); string output = executeProcess.StandardOutput.ReadToEnd(); string error = executeProcess.StandardError.ReadToEnd(); string time = "\nProgram executed in " + executeProcess.TotalProcessorTime.TotalSeconds + "s"; this.Invoke(new SafeSetText((string text, TextBox textbox) => { textbox.Text = text; toEditorMode(); }), error + output + time, outputBox.textField); })); executeThread.IsBackground = true; executeThread.Start(); } else { SystemCommand.go(CodeFileManager.virtualFilePrefix + StringGenerator.getBaseName(fileManager.currentFile.getFilename(false)) + ".exe", ""); toEditorMode(); } } else { toBugMode(); showDebugBox(); } }
public CodeFile() { this.virtualPath = StringGenerator.aRandomFile(this.realPath, CodeFileManager.virtualFilePrefix); this.isSaved = false; this.createOnDisk(virtualPath); }