示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            #region Splash Screen

            SplashScreen splash = new SplashScreen(Constants.SPLASH_SCREEN_FILE);
            splash.Show(false, true);

            base.OnStartup(e);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();
            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);

            // Step 4 - Make sure that the splash screen lasts at least two seconds
            timer.Stop();
            int remainingTimeToShowSplash = 1000 - (int)timer.ElapsedMilliseconds;
            if (remainingTimeToShowSplash > 0)
            {
                Thread.Sleep(remainingTimeToShowSplash);
            }

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(300));

            #endregion

            HomePage main = new HomePage();

            if (Helper.IsDatabaseServerConfigured())
            {
                main.Show();
            }
            else
            {
                ConfigureDatabase configureDB = new ConfigureDatabase();
                configureDB.ShowDialog();
                if (configureDB.IsDatabaseReady)
                {
                    main.Show();
                }
            }
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            #region Splash Screen

            SplashScreen splash = new SplashScreen(Constants.SPLASH_SCREEN_FILE);
            splash.Show(false, true);

            base.OnStartup(e);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();
            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);

            // Step 4 - Make sure that the splash screen lasts at least two seconds
            timer.Stop();
            int remainingTimeToShowSplash = 1000 - (int)timer.ElapsedMilliseconds;
            if (remainingTimeToShowSplash > 0)
                Thread.Sleep(remainingTimeToShowSplash);

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(300));

            #endregion

            HomePage main = new HomePage();

            if (Helper.IsDatabaseServerConfigured())
            {
                main.Show();
            }
            else
            {
                ConfigureDatabase configureDB = new ConfigureDatabase();
                configureDB.ShowDialog();
                if (configureDB.IsDatabaseReady)
                {
                    main.Show();
                }
            }
        }
示例#3
0
 private void btnConfigureDatase_Click(object sender, RoutedEventArgs e)
 {
     ConfigureDatabase configure = new ConfigureDatabase();
     configure.ShowDialog();
 }
示例#4
0
        private void btnConfigureDatase_Click(object sender, RoutedEventArgs e)
        {
            ConfigureDatabase configure = new ConfigureDatabase();

            configure.ShowDialog();
        }