示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (!Startuper.CheckSingleInstance(new Guid(appGuid), App.Current, "Diagnosis Server"))
            {
                inExit = true;
                return;
            }

            // command line args
            for (int i = 0; i != e.Args.Length; ++i)
            {
                if (e.Args[i] == "-inmemory")
                {
                    NHibernateHelper.Default.InMemory = true;
                }
            }

            SettingsMaintenance();

            Startuper.SetWpfCulture();

#if DEBUG
            StartDebugTools();
#endif

            DbMaintenance();

            var main = new MainWindow(demoMode);
            main.DataContext = new ServerMainWindowViewModel(demoMode);

            Application.Current.MainWindow   = main;
            Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
            main.Show();
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (!Startuper.CheckSingleInstance(new Guid(appGuid), App.Current, "Diagnosis"))
            {
                inExit = true;
                return;
            }

            // command line args
            for (int i = 0; i != e.Args.Length; ++i)
            {
                if (e.Args[i] == "-inmemory")
                {
                    NHibernateHelper.Default.InMemory = true;
                }
            }

#if !DEBUG
            splash = new SplashScreen(@"Resources\Images\splash.png");
            splash.Show(false);
#endif
            SettingsMaintenance();

            Startuper.SetWpfCulture();

            // enum localization
            LocalizableDescriptionAttribute.ResourcesType = typeof(Diagnosis.Client.App.Properties.Resources);

            // themes
            MyThemeManager.Initialize();

#if DEBUG
            StartDebugTools();
#endif

            DbMaintenance();

            StartMainWindow();
        }