Пример #1
0
        public static void PlaySound(DefaultSounds sound)
        {
            if (sound_enabled)
            {
                if (DateTime.Now.Subtract(last_played) > minimum_time_between_sounds)
                {
                    switch (sound)
                    {
                    case DefaultSounds.Logon:
                        logon.Play();
                        break;

                    case DefaultSounds.Logoff:
                        logoff.Play();
                        break;

                    case DefaultSounds.MessageIn:
                        message_in.Play();
                        break;

                    case DefaultSounds.MessageOut:
                        message_out.Play();
                        break;
                    }

                    last_played = DateTime.Now;
                }
            }
        }
Пример #2
0
        public static void PlaySound(DefaultSounds sound)
        {
            if (sound_enabled) {
                if (DateTime.Now.Subtract (last_played) > minimum_time_between_sounds) {
                    switch (sound) {
                        case DefaultSounds.Logon:
                            logon.Play ();
                            break;
                        case DefaultSounds.Logoff:
                            logoff.Play ();
                            break;
                        case DefaultSounds.MessageIn:
                            message_in.Play ();
                            break;
                        case DefaultSounds.MessageOut:
                            message_out.Play ();
                            break;
                    }

                    last_played = DateTime.Now;
                }
            }
        }