示例#1
0
        private void soundTestCommand_actionAsync(object obj)
        {
            string path = "";

            switch (obj.ToString())
            {
            case "2":
                path = config.options.Tomato.WorkStartSoundPath;
                break;

            case "3":
                path = config.options.Tomato.WorkEndSoundPath;
                break;

            default:
                path = config.options.General.SoundPath;
                break;
            }
            if (!string.IsNullOrEmpty(path))
            {
                bool resultTest = sound.Test(path);
                Modal(resultTest ? "自定义音效已被正确加载" : "自定义音效不能被加载");
            }
            else
            {
                sound.Play();
                Modal("当前播放的是默认提示音");
            }
        }
示例#2
0
        private void soundTestCommand_actionAsync(object obj)
        {
            string path = "";

            switch (obj.ToString())
            {
            case "2":
                path = config.options.Tomato.WorkStartSoundPath;
                break;

            case "3":
                path = config.options.Tomato.WorkEndSoundPath;
                break;

            default:
                path = config.options.General.SoundPath;
                break;
            }
            if (!string.IsNullOrEmpty(path))
            {
                bool resultTest = sound.Test(path);
                Modal(resultTest ? $"{Application.Current.Resources["Lang_Success"]}" : $"{Application.Current.Resources["Lang_Failed"]}");
            }
            else
            {
                sound.Play();
                Modal("Ding!");
            }
        }
示例#3
0
 private void resetCompleted(object sender, int timed)
 {
     //休息结束
     Init();
     //播放提示音
     if (config.options.General.Sound)
     {
         sound.Play();
     }
 }
示例#4
0
 private void RulesEnginePlayWindowsAudio(object sender, PlayWindowsAudioEventArgs args)
 {
     // note: not doing an invoke because so far this code doesn't require the UI thread
     _soundService.Play(args.Location);
 }
示例#5
0
 protected override void OnTriggerEnter()
 {
     SoundService.Play(sound);
 }