public NodeProcess(string exe, string args, string directory, bool breakOnAllExceptions, List <string[]> dirMapping = null) { DebugConnectionListener.RegisterProcess(_processGuid, this); if (directory.EndsWith("\\")) { directory = directory.Substring(0, directory.Length - 1); } _directory = directory; _breakOnAllExceptions = breakOnAllExceptions; _dirMapping = dirMapping; var processInfo = new ProcessStartInfo(exe) { UseShellExecute = false, Arguments = args, WorkingDirectory = directory, RedirectStandardError = true, RedirectStandardOutput = true }; Debug.WriteLine("Launching: {0} {1}", processInfo.FileName, processInfo.Arguments); _process = new Process { StartInfo = processInfo, EnableRaisingEvents = true }; _process.Exited += OnProcessExited; _process.ErrorDataReceived += OnProcessOutputData; _process.OutputDataReceived += OnProcessOutputData; }
internal void Unregister() { DebugConnectionListener.UnregisterProcess(_processGuid); GC.SuppressFinalize(this); }