Пример #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
        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
 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
 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
        /// <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
 private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
 {
     ApplicationThemeHelper.UpdateApplicationThemeName();
 }
Пример #15
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     ApplicationThemeHelper.SaveApplicationThemeName();
 }
Пример #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"));
 }
Пример #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();
 }
Пример #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);
 }