12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using Aitex.Core.RT.Log;
- using Aitex.Core.Util;
- using Prism.Ioc;
- using Prism.Modularity;
- using Prism.Services.Dialogs;
- using Prism.Unity;
- using System;
- using System.Threading;
- using System.Windows;
- using System.Windows.Media.Animation;
- using Venus_MainPages.Roles;
- using Venus_MainPages.Views;
- using Venus_UI.Views;
- using WPF.Themes.UserControls;
- namespace Venus_UI
- {
- /// <summary>
- /// App.xaml 的交互逻辑
- /// </summary>
- public partial class App : PrismApplication
- {
- System.Threading.Mutex mutex;
- protected override void OnStartup(StartupEventArgs e)
- {
- bool ret;
- mutex = new System.Threading.Mutex(true, "Venus_UI", out ret);
- if (!ret)
- {
- WPFMessageBox.ShowError("Only One Venus_UI is allowed");
- Environment.Exit(0);
- }
- FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;
- DispatcherUnhandledException += App_DispatcherUnhandledException;
- Singleton<LogManager>.Instance.Initialize();
- //LoginView loginView = new LoginView();
- //loginView.ShowDialog();
- //CurrentUser = loginView.CurrentUser;
- //if (!loginView.IsLoginSuccess)
- //{
- // Current.Shutdown();
- // return;
- //}
- //Timeline.DesiredFrameRateProperty.OverrideMetadata(
- //typeof(Timeline),
- //new FrameworkPropertyMetadata { DefaultValue = 20 }
- //);
- base.OnStartup(e);
- }
- void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
- {
- //MessageBox.Show("程序异常." + Environment.NewLine + e.Exception.Message);
- e.Handled = true;
- }
- protected override Window CreateShell()
- {
- return Container.Resolve<ShellView>();
- }
- protected override void RegisterTypes(IContainerRegistry containerRegistry)
- {
- }
- protected override IModuleCatalog CreateModuleCatalog()
- {
- return new ConfigurationModuleCatalog();
- }
- }
- }
|