protected virtual List <int> GetChildren(int pid) { if (string.IsNullOrEmpty(Configuration.ChildProcessAlgorithm)) { switch (Configuration.GetPlatform()) { case Platform.Mac: return(GetChildrenImplPS(pid)); case Platform.Linux: default: return(GetChildrenImplPgrep(pid)); } } else { switch (Configuration.ChildProcessAlgorithm.ToLowerInvariant()) { case "pgrep": return(GetChildrenImplPgrep(pid)); case "ps": default: return(GetChildrenImplPS(pid)); } } }
private static IProcessHelper GetHelper() { if (helper == null) { switch (Configuration.GetPlatform()) { case Platform.Windows: helper = new ProcessHelperWindows(); break; case Platform.Mac: helper = new ProcessHelperMac(); break; case Platform.Linux: default: if (Configuration.IsCygwin) { helper = new ProcessHelperWindows(); } else { helper = new ProcessHelperLinux(); } break; } } return(helper); }
public static Job CreateJob() { if (Configuration.GetPlatform() == Platform.Windows || Configuration.IsCygwin) { return(new JobWindows()); } return(new Job()); }