コード例 #1
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
     Database.SetInitializer <DepartmentContext>(new DepartmentContextInitializer());
 }
コード例 #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            //Configure theme manager
            DXSplashScreen.Show <SETSplashScreen>();
            ApplicationThemeHelper.UpdateApplicationThemeName();
            ThemeManager.ApplicationThemeChanged += this.ThemeManager_ApplicationThemeChanged;
            GridControl.AllowInfiniteGridSize     = true;

            //DomainManager domainManager = new DomainManager();
            //UserServiceProvider userServiceProvider = new UserServiceProvider(new InventoryContext(), domainManager);
            //LogInService logInService = new LogInService(domainManager, userServiceProvider);
            //var responce = logInService.LogInWithPassword("AElmendo", "Drizzle123!", false, InventorySoftwareType.PRODUCTS_SALES);
            //this.userService = responce.Service;
            Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
            if (this.ShowLogin())
            {
                Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
            }
            else
            {
                Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
                this.Shutdown();
            }
            base.OnStartup(e);
        }
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
     Database.SetInitializer <SchoolContext>(new SchoolContextInitializer());
     MetadataLocator.Default = MetadataLocator.Create().AddMetadata <SchoolContextMetadata>();
 }
コード例 #4
0
ファイル: App.xaml.cs プロジェクト: LhomNoir/MdManager
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ApplicationThemeHelper.UpdateApplicationThemeName();

            InitializeInstances();
        }
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     using (var context = new DepartmentContext()) {
         context.Database.Migrate();
         context.EnsureSeedData();
     }
 }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: jinyuttt/WPFRibbon
 protected override void OnStartup(StartupEventArgs e)
 {
     //DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName =
     //    DevExpress.Xpf.Core.Theme.Office2016ColorfulFullName;
     /// DevExpress.Xpf.Core.ThemeManager.ApplicationThemeName = DevExpress.Xpf.Core.Theme.Office2016ColorfulFullName;
     ///   protected override void OnStartup(StartupEventArgs e) {
     ApplicationThemeHelper.ApplicationThemeName = DevExpress.Xpf.Core.Theme.NoneName;
     ApplicationThemeHelper.SaveApplicationThemeName();
     base.OnStartup(e);
 }
コード例 #7
0
ファイル: App.xaml.cs プロジェクト: chasik/mbaf
 protected override void OnStartup(StartupEventArgs e)
 {
     PresentationTraceSources.Refresh();
     PresentationTraceSources.DataBindingSource.Listeners.Add(new ConsoleTraceListener());
     PresentationTraceSources.DataBindingSource.Listeners.Add(new DebugTraceListener());
     PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning | SourceLevels.Error;
     base.OnStartup(e);
     DXSplashScreen.Show <SplashScreenView>();
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
コード例 #8
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     RxApp.MainThreadScheduler = new DispatcherScheduler(Dispatcher);
     DXSplashScreen.Show <StartScreen>();
     ApplicationThemeHelper.UpdateApplicationThemeName();
     bootstrapper = new Bootstrapper();
     bootstrapper.Run();
     Current.MainWindow.Show();
     DXSplashScreen.Close();
 }
コード例 #9
0
        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            ApplicationThemeHelper.UpdateApplicationThemeName();

            DXSplashScreen.Show <SplashWindow>();

            var mainWindow          = new MainWindow();
            var mainWindowViewModel = new MainWindowViewModel();

            mainWindow.DataContext = mainWindowViewModel;
            LoadWindowSettings(mainWindow);
            mainWindow.Closed += MainWindow_Closed;
            mainWindow.Loaded += MainWindow_Loaded;
            mainWindow.ShowDialog();
        }
コード例 #10
0
ファイル: MainWindow.xaml.cs プロジェクト: YB9527/CG
        /// <summary>
        /// 窗口关闭要做的事情
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DXRibbonWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("确定退出程序?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);

            ApplicationThemeHelper.SaveApplicationThemeName();
            if (result == MessageBoxResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                //TaskForm.Close_Click();
                IList <PropertyNodeItem> items = tvProperty.ItemsSource as IList <PropertyNodeItem>;
                if (items != null)
                {
                    PropertyNodeItemCustom.SaveDMToHibernate(items);
                    HibernateUtils.GetInstance().CloseSession();
                }
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }
        }
コード例 #11
0
        protected override void OnStartup(StartupEventArgs z)
        {
            if (!File.Exists("Data\\KeycipherLicensing.db"))
            {
                var file = new FileInfo("Data\\KeycipherLicensing.db");
                file.Directory.Create(); // If the directory already exists, this method does nothing.
                File.WriteAllBytes(file.FullName, ManagementApp.Properties.Resources.KeycipherLicensing);
            }

            AppDomain.CurrentDomain.FirstChanceException += (sender, e) =>
            {
                var msg = new StringBuilder();
                msg.AppendLine(e.Exception.GetType().FullName);
                msg.AppendLine(e.Exception.Message);
                var st = new StackTrace();
                msg.AppendLine(st.ToString());
                msg.AppendLine();
                File.AppendAllText("errorlog.txt", msg.ToString());
                ApplicationThemeHelper.UpdateApplicationThemeName();
            };

            base.OnStartup(z);
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ApplicationThemeHelper.UpdateApplicationThemeName();
            DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();

            //var deleteContext = new DevAVDb();
            //if(deleteContext.Database.Exists())
            //    deleteContext.Database.Delete();

            var context = new DevAVDb();

            if (!context.Database.Exists())
            {
                DXSplashScreen.Show <GenerateDBSplashScreen>();
                DXSplashScreen.SetState("Generating database...");
                try {
                    Database.SetInitializer <DevAVDb>(new DatabaseInitializer());
                    context.Customers.Count();
                } finally {
                    DXSplashScreen.Close();
                }
            }
        }
コード例 #13
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
 }
コード例 #14
0
ファイル: App.xaml.cs プロジェクト: chasik/mbaf
 private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
コード例 #15
0
ファイル: App.xaml.cs プロジェクト: chasik/mbaf
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
コード例 #16
0
ファイル: App.xaml.cs プロジェクト: mdaniyalkhan/MuTest
 private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DevExpress.Data.ShellHelper.TryCreateShortcut("mutest-notification", "NotificationService");
     Trace.Listeners.Add(new EventLogTraceListener("MuTestUI"));
 }
コード例 #17
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     new Bootstrapper().Run();
 }
コード例 #18
0
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
コード例 #19
0
 public App()
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
コード例 #20
0
 private void ApplicationExit(object sender, ExitEventArgs e)
 {
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
コード例 #21
0
 private void ThemeManager_ApplicationThemeChanged(DependencyObject sender, ThemeChangedRoutedEventArgs e)
 {
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
     Database.SetInitializer <DepartmentContext>(new DepartmentContextInitializer());
 }
 protected override void OnStartup(StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     base.OnStartup(e);
 }