本文整理汇总了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);
}
示例2: AppShutdownDispatcher
public static void AppShutdownDispatcher(Dispatcher theMainDispatcher)
{
if (theMainDispatcher.CheckAccess())
{
theMainDispatcher.InvokeShutdown();
}
else
{
Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Send, (Action)(() =>
{
theMainDispatcher.InvokeShutdown();
}));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}