Exemplo n.º 1
0
        public void ShowAutoRunWindow()
        {
            // Run the AutoRunWindow on its own thread
            Thread mGingerThread = new Thread(() =>
            {
                mAutoRunWindow = new AutoRunWindow();
                mAutoRunWindow.Show();

                GingerCore.General.DoEvents();
                SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
                Dispatcher.Run();
            });

            // Makes the thread support message pumping
            // Configure the thread
            mGingerThread.SetApartmentState(ApartmentState.STA);
            mGingerThread.IsBackground = true;
            mGingerThread.Start();

            Stopwatch stopwatch = Stopwatch.StartNew();

            while (mAutoRunWindow == null && stopwatch.ElapsedMilliseconds < 5000) // max 5 seconds
            {
                Thread.Sleep(100);
            }
            if (!WorkSpace.Instance.RunningInExecutionMode)
            {
                mAutoRunWindow.Dispatcher.Invoke(() =>
                {
                    Thread.Sleep(100);  // run something on main window so we know it is active and pumping messages
                });
            }
        }
Exemplo n.º 2
0
        public void RunRunSetFromCommandLine()
        {
            App.MainWindow.Hide();
            App.AppSplashWindow.Close();
            AutoRunWindow RP = new AutoRunWindow();

            RP.Show();
        }
Exemplo n.º 3
0
        public void RunRunSetFromCommandLine()
        {
            AutoRunWindow RP = new AutoRunWindow();

            RP.Show();
        }