private static void ResolveArguments(string[] args) { var process = OtherProcessChecker.ThereIsOtherAutumnBoxProcess(); if (process != null && (!args.Contains("--wait"))) { NativeMethods.SetForegroundWindow(process.MainWindowHandle); Environment.Exit(0); } process?.WaitForExit(); }
private bool CheckOther(string[] args) { var process = OtherProcessChecker.ThereIsOtherAutumnBoxProcess(); if (process != null && (!args.Contains("--wait"))) { NativeMethods.SetForegroundWindow(process.MainWindowHandle); App.Current.Shutdown(0); return(false); } process?.WaitForExit(); return(true); }
private static void Run(Options options) { CliOptions = options; if (options.Wait == false) { var process = OtherProcessChecker.ThereIsOtherAutumnBoxProcess(); if (process != null) { NativeMethods.SetForegroundWindow(process.MainWindowHandle); Environment.Exit(0); process.WaitForExit(); } } var app = new App(); app.InitializeComponent(); app.Run(); }
public bool ThereIsOtherAutumnBoxProcess() { return(OtherProcessChecker.ThereIsOtherAutumnBoxProcess() != null); }