Пример #1
0
 public static void waiting5_2()
 {
     Melody.Melody2_stop();
     System.Threading.Thread.Sleep(5000);
 }
Пример #2
0
 public static void waiting7_1()
 {
     Melody.Melody1_stop();
     System.Threading.Thread.Sleep(7000);
 }
Пример #3
0
        //Alarm2 is for Melody2
        public void Alarm2()
        {
            //Yes==Dismiss && No=Snooze
            Melody.Melody2_play();
            string            message = "Do you want to close the alarm?";
            string            title   = "Close Window";
            MessageBoxButtons button  = MessageBoxButtons.YesNo;
            DialogResult      result  = MessageBox.Show(message, title, button, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                Melody.Melody2_stop();
            }
            else
            {
                if (cb_snooze.SelectedIndex == cb_snooze.FindStringExact("3 seconds"))
                {
                    waiting3_2();
                    for (; ;)
                    {
                        Melody.Melody2_play();
                        MessageBoxButtons button1 = MessageBoxButtons.YesNo;
                        DialogResult      result1 = MessageBox.Show(message, title, button1, MessageBoxIcon.Question);
                        if (result1 == DialogResult.Yes)
                        {
                            Melody.Melody2_stop();
                            break;
                        }
                        else
                        {
                            waiting3_2();
                        }
                    }
                }
                else if (cb_snooze.SelectedIndex == cb_snooze.FindStringExact("5 seconds"))
                {
                    waiting5_2();
                    for (; ;)
                    {
                        Melody.Melody2_play();
                        MessageBoxButtons button1 = MessageBoxButtons.YesNo;
                        DialogResult      result1 = MessageBox.Show(message, title, button1, MessageBoxIcon.Question);
                        if (result1 == DialogResult.Yes)
                        {
                            Melody.Melody2_stop();
                            break;
                        }
                        else
                        {
                            waiting5_2();
                        }
                    }
                }
                else if (cb_snooze.SelectedIndex == cb_snooze.FindStringExact("7 seconds"))
                {
                    waiting7_2();
                    for (; ;)
                    {
                        Melody.Melody2_play();
                        MessageBoxButtons button1 = MessageBoxButtons.YesNo;
                        DialogResult      result1 = MessageBox.Show(message, title, button1, MessageBoxIcon.Question);
                        if (result1 == DialogResult.Yes)
                        {
                            Melody.Melody2_stop();
                            break;
                        }
                        else
                        {
                            waiting7_2();
                        }
                    }
                }
            }
        }