Beispiel #1
0
        private void timerStartup_Tick(object sender, EventArgs e)
        {
            if (timerLocked)
            {
                return;
            }
            timerLocked = true;

            if (startupState == Enums.StartupState.Init)
            {
                Settings.Init();
                startupState          = Enums.StartupState.FadingIn;
                timerStartup.Interval = 50;
            }
            else if (startupState == Enums.StartupState.FadingIn)
            {
                if (Opacity < 1)
                {
                    Opacity += 0.05;
                }
                else
                {
                    Opacity = 1;
                    timerStartup.Interval = 100;
                    if (Settings.HasConfigFile())
                    {
                        startupState = Enums.StartupState.Loading;
                        SetLabel("Loading Config File");
                    }
                    else
                    {
                        startupState = Enums.StartupState.AwaitingInputConfig;
                        SetLabel("No Config File Found");
                        panelFirstLaunch.Visible = true;
                        panelFirstLaunch.BringToFront();
                        Height = heightLarge;
                        PlaySound(Resources.AlertTest);
                        this.BringToFront();
                    }
                }
            }
            else if (startupState == Enums.StartupState.Starting)
            {
                //MessageBox.Show("Welcome!");
            }
            else if (startupState == Enums.StartupState.Loading)
            {
            }
            timerLocked = false;
        }
Beispiel #2
0
        private void StartupForm_Load(object sender, EventArgs e)
        {
            Height = heightStart;
            Rectangle resolution = Screen.PrimaryScreen.Bounds;

            panelFirstLaunch.Location = new Point(5, 107);
            panelFirstLaunch.Parent   = this;
            this.Location             = new Point(resolution.Width / 2 - 150, resolution.Height / 2 - 256);
            this.BringToFront();
            SetLabel("Starting Up...");
            Globals.startupForm  = this;
            startupState         = Enums.StartupState.Init;
            timerStartup.Enabled = true;
        }