/// <summary> /// End the current process, and verify if the process queue has ended, and if we have to execute postponed processes /// </summary> public void EndProcess(bool processPostPoned) { if (_processes.Count > 0) { TrackedProcess proc = CurrentProcess; _processes.Remove(proc); if (_processes.Count == 0) { if (processPostPoned) { foreach (PostponedProcess process in _postPonedProcesses) { process.Processor.PostProcess(process.Name, process.Data); } _postPonedProcesses.Clear(); } if (_postPonedProcesses.Count == 0) { RestoreEnvironment(); HideProgressBar(); ProgressBarIsShowing = false; _forcedNodes.Clear(); } } LogSteps(proc.End()); } }
/// <summary> /// Launch a node process /// </summary> /// <param name="Name">Name of the process</param> /// <param name="Loops">Number of repetitions of the process (used for importance in progressBars)</param> /// <returns>The TrackedProcess instance</returns> public TrackedProcess LaunchProcess(string Name, int Loops) { TrackedProcess proc = new TrackedProcess(Name, _processes.Count); if (_processes.Count == 0) { SetEnvironment(); } if (Loops > 0) { if (!ProgressBarIsShowing) { ShowProgressBar(Loops, Name); ProgressBarIsShowing = true; } else { if (proc.Level < 2) { ProgressBarSetText(proc.Name); } } } _processes.Add(proc); LogSteps(proc.Start()); return(proc); }
private void TrackProcess(Process process) { string description = MakeProcessDescription(process); Process procDumpProcess = _procDump.MonitorProcess(process.Id, description); if (TrackedProcess.TryCreate(process, procDumpProcess, description, out var trackedProcess)) { _trackedProcesses.Add(trackedProcess); } }
internal static bool TryCreate( Process process, Process procDumpProcess, string description, out TrackedProcess trackedProcess) { bool result = false; trackedProcess = null; if (UniqueProcess.TryCreate(process, out var uniqueProcess) && UniqueProcess.TryCreate(procDumpProcess, out var uniqueProcDumpProcess)) { trackedProcess = new TrackedProcess(uniqueProcess, uniqueProcDumpProcess, description); result = true; } return(result); }
internal static bool TryCreate( Process process, Process procDumpProcess, string description, out TrackedProcess trackedProcess) { bool result = false; trackedProcess = null; UniqueProcess uniqueProcess; UniqueProcess uniqueProcDumpProcess; if (UniqueProcess.TryCreate(process, out uniqueProcess) && UniqueProcess.TryCreate(procDumpProcess, out uniqueProcDumpProcess)) { trackedProcess = new TrackedProcess(uniqueProcess, uniqueProcDumpProcess, description); result = true; } return result; }