Beispiel #1
0
        public void StartPauseTimer()
        {
            if (!timerFromList)
            {
                SelectedTimer = RunningTimer.Clone() as Timer;
            }

            if (!TimerStarted)
            {
                runningDispatcherTimer          = new DispatcherTimer();
                runningDispatcherTimer.Interval = new TimeSpan(0, 0, 1);
                runningDispatcherTimer.Tick    += TimerTick;
                runningDispatcherTimer.Start();
                TimerStarted = true;
            }
            else if (!TimerPaused)
            {
                runningDispatcherTimer.Tick -= TimerTick;
                TimerPaused = true;
            }
            else
            {
                runningDispatcherTimer.Tick += TimerTick;
                TimerPaused = false;
            }
        }
Beispiel #2
0
        //Deze method geeft het speelbord weer na het invullen van een naam
        private void PlayRunningInthe90s()
        {
            if (Player1Textbox.Text == "")
            {
                MessageBox.Show("Je moet een naam invullen!");
            }

            else
            {
                axWindowsMediaPlayer1.URL = "Run90s.wav";
                axWindowsMediaPlayer1.Ctlcontrols.play();
                RunningTimer.Start();
                Button[] ButtonGrid = { GridButton1, GridButton1Dup, GridButton2, GridButton2Dup, GridButton3, GridButton3Dup, GridButton4, GridButton4Dup, GridButton5, GridButton5Dup, GridButton6, GridButton6Dup, GridButton7, GridButton7Dup, GridButton8, GridButton8Dup };

                foreach (var x in ButtonGrid)
                {
                    x.Visible = true;
                }
                Reset.Visible              = true;
                PuntenPlayer1              = 0;
                TotaalMatches              = 0;
                Points1.Text               = Convert.ToString(PuntenPlayer1);
                Player1Textbox.Visible     = false;
                Player1LabelInvoer.Visible = true;
                Points1.Visible            = true;
                Speler1.Visible            = true;
                pictureBox1.Visible        = false;
                Speler1.Visible            = true;
                play.Visible               = false;
                RunningTimer.Enabled       = false;

                Player1LabelInvoer.Text = Player1Textbox.Text;

                player1 = Player1LabelInvoer.Text;
                switch (thema)
                {
                case "Media":
                    this.BackgroundImage = Resources.media_achtergrond;
                    break;

                case "Films":
                    this.BackgroundImage           = Resources.popcorn_background;
                    GridButton1.BackgroundImage    = Resources.clapperboard;
                    GridButton1Dup.BackgroundImage = Resources.clapperboard;
                    GridButton2.BackgroundImage    = Resources.clapperboard;
                    GridButton2Dup.BackgroundImage = Resources.clapperboard;
                    GridButton3.BackgroundImage    = Resources.clapperboard;
                    GridButton3Dup.BackgroundImage = Resources.clapperboard;
                    GridButton4.BackgroundImage    = Resources.clapperboard;
                    GridButton4Dup.BackgroundImage = Resources.clapperboard;
                    GridButton5.BackgroundImage    = Resources.clapperboard;
                    GridButton5Dup.BackgroundImage = Resources.clapperboard;
                    GridButton6.BackgroundImage    = Resources.clapperboard;
                    GridButton6Dup.BackgroundImage = Resources.clapperboard;
                    GridButton7.BackgroundImage    = Resources.clapperboard;
                    GridButton7Dup.BackgroundImage = Resources.clapperboard;
                    GridButton8.BackgroundImage    = Resources.clapperboard;
                    GridButton8Dup.BackgroundImage = Resources.clapperboard;
                    break;

                case "Games":
                    this.BackgroundImage           = Resources.controller;
                    GridButton1.BackgroundImage    = Resources.controller_cardback;
                    GridButton1Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton2.BackgroundImage    = Resources.controller_cardback;
                    GridButton2Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton3.BackgroundImage    = Resources.controller_cardback;
                    GridButton3Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton4.BackgroundImage    = Resources.controller_cardback;
                    GridButton4Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton5.BackgroundImage    = Resources.controller_cardback;
                    GridButton5Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton6.BackgroundImage    = Resources.controller_cardback;
                    GridButton6Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton7.BackgroundImage    = Resources.controller_cardback;
                    GridButton7Dup.BackgroundImage = Resources.controller_cardback;
                    GridButton8.BackgroundImage    = Resources.controller_cardback;
                    GridButton8Dup.BackgroundImage = Resources.controller_cardback;
                    break;
                }
            }
        }