当前位置: 首页>>代码示例>>C#>>正文


C# Dispatcher.InvokeShutdown方法代码示例

本文整理汇总了C#中System.Windows.Threading.Dispatcher.InvokeShutdown方法的典型用法代码示例。如果您正苦于以下问题:C# Dispatcher.InvokeShutdown方法的具体用法?C# Dispatcher.InvokeShutdown怎么用?C# Dispatcher.InvokeShutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Threading.Dispatcher的用法示例。


在下文中一共展示了Dispatcher.InvokeShutdown方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        protected override void Run()
        {
            this.Engine.Log(LogLevel.Verbose, "Launching Sparrow.Chart.Installer");
            BootstrapperDispatcher = Dispatcher.CurrentDispatcher;
            MainViewModel viewModel = new MainViewModel(this);
            viewModel.Bootstrapper.Engine.Detect();

            if (viewModel.Bootstrapper.Command.Action == LaunchAction.Install && !isInstalled)
            {
                MainView view = new MainView();
                view.DataContext = viewModel;
                view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
                view.Show();
                isInstalled = true;
            }

            if (viewModel.Bootstrapper.Command.Action == LaunchAction.Uninstall && !isUninstalled)
            {
                MainView view = new MainView();
                view.DataContext = viewModel;
                view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
                view.Show();
                isUninstalled = true;
            }

            Dispatcher.Run();

            this.Engine.Quit(0);
        }
开发者ID:jcw-,项目名称:sparrowtoolkit,代码行数:29,代码来源:SparrowInstaller.cs

示例2: AppShutdownDispatcher

 public static void AppShutdownDispatcher(Dispatcher theMainDispatcher)
 {
     if (theMainDispatcher.CheckAccess())
     {
         theMainDispatcher.InvokeShutdown();
     }
     else
     {
         Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Send, (Action)(() =>
         {
             theMainDispatcher.InvokeShutdown();
         }));
     }
 }
开发者ID:JoergTiedemann,项目名称:KatanaTest,代码行数:14,代码来源:Program.cs

示例3: Run

        // entry point for our custom UI
        protected override void Run()
        {
            try
            {
                this.Engine.Log(LogLevel.Verbose, "Launching OSA BA UX");
                BootstrapperDispatcher = Dispatcher.CurrentDispatcher;

                MainViewModel viewModel = new MainViewModel(this);
                viewModel.Bootstrapper.Engine.Detect();

                MainView view = new MainView();

                view.DataContext = viewModel;
                view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
                view.Show();

                Dispatcher.Run();
            }
            catch (Exception ex)
            {
                this.Engine.Log(LogLevel.Verbose, "Exception Caught by BA details:" + ex.Message);
                // change to use engine log
                MessageBox.Show("Exception" + ex.Message);
            }

            this.Engine.Quit(0);
        }
开发者ID:jesszgc,项目名称:Open-Source-Automation,代码行数:28,代码来源:OSA+BA.cs

示例4: Run

		protected override void Run()
        {
            this.Engine.Log(LogLevel.Verbose, "Launching Firesec Bootstrapper Application UX");
            BootstrapperDispatcher = Dispatcher.CurrentDispatcher;
			MainView view = new MainView();
			view.DataContext = new MainViewModel(this);
            view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
            view.Show();
			Dispatcher.Run();
			this.Engine.Quit(0);
        }
开发者ID:xbadcode,项目名称:Rubezh,代码行数:11,代码来源:FiresecBootstrapperApplication.cs

示例5: Run

        protected override void Run()
        {
            Engine.Log(LogLevel.Verbose, "Launching Magic Setup UX");
            BootstrapperDispatcher = Dispatcher.CurrentDispatcher;

            Window window = GetSetupWindow();

            Engine.Detect();
            window.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
            window.Show();
            Dispatcher.Run();
            Engine.Quit(0);
        }
开发者ID:baluubas,项目名称:Magic,代码行数:13,代码来源:ApplicationSetup.cs

示例6: Run

        protected override void Run()
        {
            this.Engine.Log(LogLevel.Verbose, "Launching InstallerBootstrapperApplication");
            BootstrapperDispatcher = Dispatcher.CurrentDispatcher;

            var viewModel = new MainWindowModel(this);
            viewModel.Bootstrapper.Engine.Detect();

            Util.Log("Installer running: " + this.Command.Action + " " + this.Command.Display);
            if (this.Command.Action == LaunchAction.Uninstall && this.Command.Display == Display.Embedded)
            {
                Util.Log("viewModel.Uninstall");
                viewModel.Uninstall();
                Util.Log("BootstrapperDispatcher.InvokeShutdown");
                BootstrapperDispatcher.InvokeShutdown();
            }
            else
            {
                var view = new MainWindow(viewModel);
                view.Closed += (sender, e) =>
                {
                    Util.Log("BootstrapperDispatcher.InvokeShutdown");
                    BootstrapperDispatcher.InvokeShutdown();
                    Util.Log("Engine.Quit");
                    viewModel.Dispose();
                    Engine.Quit((int)ActionResult.Success);
                };
                Util.Log("view.Show");
                view.Show();
                Util.Log("Dispatcher.Run");
                Dispatcher.Run();
            }
            Util.Log("viewModel.Dispose");
            viewModel.Dispose();

            this.Engine.Quit((int)ActionResult.Success);
        }
开发者ID:alex8b,项目名称:gta5eyetracking,代码行数:37,代码来源:InstallerBootstrapperApplication.cs

示例7: Run

		protected override void Run()
		{
			this.Engine.Log(LogLevel.Verbose, "Launching custom TestBA UX");
			BootstrapperDispatcher = Dispatcher.CurrentDispatcher;

			MainViewModel viewModel = new MainViewModel(this);
			MainView view = new MainView();
			viewModel.Bootstrapper.Engine.Detect();
			view.DataContext = viewModel;
			view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
			view.Show();

			Dispatcher.Run();

			this.Engine.Quit(0);
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:16,代码来源:UIBootstrapper.cs

示例8: Run

        // entry point for our custom UI
        protected override void Run()
        {
            try
            {
                Engine.Log(LogLevel.Verbose, "Launching custom ManagedBootstrapperApplication UX");
                BootstrapperDispatcher = Dispatcher.CurrentDispatcher;

                var viewModel = new MainViewModel(this);
                Engine.Detect();

                var view = new MainView();
                view.DataContext = viewModel;
                view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
                view.Show();
                Dispatcher.Run();

                Engine.Quit(0);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
                Engine.Quit(0);
            }
        }
开发者ID:bhattvishal,项目名称:CalendarSyncplus,代码行数:25,代码来源:ManagedBootstrapperApplication.cs


注:本文中的System.Windows.Threading.Dispatcher.InvokeShutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。