private static IList <TreeNodeData> GetChildProcesses(WindowCache wc, MainForm mf, int pid, bool visibleOnly) { List <TreeNodeData> result = new List <TreeNodeData>(); foreach (Process p in wc.ChildProcesses(pid)) { if (!visibleOnly || wc.IsProcessVisible(p)) { result.Add(new ProcessData(mf, p)); } } sortProcesses(result); return(result); }
internal static IList <TreeNodeData> GetAllProcesses(WindowCache wc, MainForm mf, bool visibleOnly) { List <TreeNodeData> result = new List <TreeNodeData>(); foreach (Process p in Process.GetProcesses()) { if (!visibleOnly || wc.IsProcessVisible(p)) { result.Add(new ProcessData(mf, p)); } } sortProcesses(result); return(result); }
private bool HasChildProcesses(WindowCache wc, MainForm mf, bool visibleOnly) { if (visibleOnly) { foreach (Process p in wc.ChildProcesses(this.process.Id)) { if (wc.IsProcessVisible(p)) { return(true); } } return(false); } else { return(wc.ChildProcesses(this.process.Id).Count > 0); } }