Example #1
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
     Database.SetInitializer <DepartmentContext>(new DepartmentContextInitializer());
 }
        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>();
 }
Example #4
0
        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();
     }
 }
Example #6
0
 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);
 }
Example #7
0
 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();
 }
Example #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();
 }
Example #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();
        }
Example #10
0
        /// <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();
            }
        }
        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();
                }
            }
        }
Example #13
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DbEngineDetector.PatchConnectionStringsAndConfigureEntityFrameworkDefaultConnectionFactory();
 }
Example #14
0
 private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
Example #15
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
Example #16
0
 private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
     DevExpress.Data.ShellHelper.TryCreateShortcut("mutest-notification", "NotificationService");
     Trace.Listeners.Add(new EventLogTraceListener("MuTestUI"));
 }
Example #17
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     ApplicationThemeHelper.UpdateApplicationThemeName();
     new Bootstrapper().Run();
 }
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
Example #19
0
 public App()
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
Example #20
0
 private void ApplicationExit(object sender, ExitEventArgs e)
 {
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
 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);
 }