Exemplo n.º 1
0
 private void CheckOtherAutumnBox()
 {
     if (!OtherProcessChecker.Do())
     {
         Fail();
     }
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 public bool ThereIsOtherAutumnBoxProcess()
 {
     return(OtherProcessChecker.ThereIsOtherAutumnBoxProcess() != null);
 }