Exemple #1
0
        private const int MINIMUM_SPLASH_TIME = 1500; // Miliseconds

        protected override void OnStartup(StartupEventArgs e)
        {
            Common.SetTaskManager(false);
            SentrySdk.Init(Settings.Default.SENTRY_DSN);

            var devMode = Environment.GetEnvironmentVariable("ANTIDOTE_DEV_MODE");

            AppState.DEV_MODE = (devMode == "YES");


            SplashScreen splash = new SplashScreen();

            splash.Show();
            // 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);
            ReadRegistry();
            if (AppState.INIT_SETUP_COMPLETE)
            {
                LoginWindow main = new LoginWindow();
                main.Show();
                AppState.isLoginWindowOpen = true;
                WSClient ws = WSClient.Instance;
                AppState.loginWindow = main;
            }
            else
            {
                InitSetup initSetup = new InitSetup();
                initSetup.Show();
            }
            timer.Stop();

            int remainingTimeToShowSplash = MINIMUM_SPLASH_TIME - (int)timer.ElapsedMilliseconds;

            if (remainingTimeToShowSplash > 0)
            {
                Thread.Sleep(remainingTimeToShowSplash);
            }

            splash.Close();

            worker         = new BackgroundWorker();
            worker.DoWork += worker_DoWork;
            System.Timers.Timer workerTimer = new System.Timers.Timer(5000);
            workerTimer.Elapsed += timer_Elapsed;
            workerTimer.Start();

            Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));
        }
Exemple #2
0
 public InitSetupComputerRegPage(InitSetup initSetup)
 {
     InitializeComponent();
     this.parentWindow = initSetup;
 }
Exemple #3
0
 public InitSetupAdminLoginPage(InitSetup parentWindow)
 {
     this.parentWindow = parentWindow;
     InitializeComponent();
 }