Exemple #1
0
        public static void Continue(int n, Window w)
        {
            SoundPlayer click = new System.Media.SoundPlayer(Properties.Resources.click);

            click.Play();
            switch (n)
            {
            case 1:
                huone1 main1 = w.Owner as huone1;
                if (main1 != null)
                {
                    main1.TimerStart();
                }
                break;

            case 2:
                huone2 main2 = w.Owner as huone2;
                if (main2 != null)
                {
                    main2.TimerStart();
                }
                break;

            case 3:
                huone3 main3 = w.Owner as huone3;
                if (main3 != null)
                {
                    main3.TimerStart();
                }
                break;

            case 4:
                huone4 main4 = w.Owner as huone4;
                if (main4 != null)
                {
                    main4.TimerStart();
                }
                break;

            case 5:
                huone5 main5 = w.Owner as huone5;
                if (main5 != null)
                {
                    main5.TimerStart();
                }
                break;
            }
            w.Close();
        }
Exemple #2
0
        public static void ExitPause(int n, Window w)
        {
            SoundPlayer click = new System.Media.SoundPlayer(Properties.Resources.click);

            click.Play();
            switch (n)
            {
            case 1:
                huone1     main1 = w.Owner as huone1;
                MainWindow h1    = new harjoitus.View.MainWindow();
                w.Close();
                main1.Close();
                h1.ShowDialog();
                break;

            case 2:
                huone2     main2 = w.Owner as huone2;
                MainWindow h2    = new harjoitus.View.MainWindow();
                w.Close();
                main2.Close();
                h2.ShowDialog();
                break;

            case 3:
                huone3     main3 = w.Owner as huone3;
                MainWindow h3    = new harjoitus.View.MainWindow();
                w.Close();
                main3.Close();
                h3.ShowDialog();
                break;

            case 4:
                huone4     main4 = w.Owner as huone4;
                MainWindow h4    = new harjoitus.View.MainWindow();
                w.Close();
                main4.Close();
                h4.ShowDialog();
                break;

            case 5:
                huone5     main5 = w.Owner as huone5;
                MainWindow h5    = new harjoitus.View.MainWindow();
                w.Close();
                main5.Close();
                h5.ShowDialog();
                break;
            }
        }