Exemplo n.º 1
0
        async private void ht_FileWatchEvent(object sender, CompleteEventArgs e)
        {
            result.Clear();
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                LBResult.DataContext = null;
            });

            list = LRCSer.GecimeLyricDeserializer(e.Node);
            if (list.Result.Count() == 0)
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    JMessBox jb = new JMessBox("没有结果");
                    jb.Show();
                });
            }
            else
            {
                foreach (var item in list.Result)
                {
                    //执行对每个artistid的查询
                    DoHttpWebRequestArtist(item.artist_id);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 替换已存在的歌词文件
 /// </summary>
 /// <param name="content">歌词内容</param>
 private async void GetCompleted(string content)
 {
     string fileName = "MatoLrc\\" + songName + "-" + artistName + ".lrc";
     await FileHelper.DeleteFileAsync(fileName);
     if (await FileHelper.CreateAndWriteFileAsync(fileName, content))
     {
         await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
         {
             JMessBox jb = new JMessBox(string.Format("已更新 {0}", songName + "-" + artistName + ".lrc"));
             jb.Show();
         });
     }
     else
     {
         await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
         {
             JMessBox jb = new JMessBox("更新失败");
             jb.Show();
         });
     }
 }
Exemplo n.º 3
0
 private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
 {
     Frame frame = Window.Current.Content as Frame;
     if (frame == null)
     {
         return;
     }
     e.Handled = true;
     JMessBox jb = new JMessBox("再按一次离开");
     jb.Completed += (b) =>
     {
         if (b)
         {
             //退出代码
             if (SettingsViewModel.Current.IsStopWhenTerminate)
             {
                 //暂停播放
                 LibraryViewModel.Current.PlayQueue.ExecutePlayPausePlayer(null);
             }
             Application.Current.Exit();
         }
     };
     jb.Show();
 }
Exemplo n.º 4
0
        private void BTNSearch_Click(object sender, RoutedEventArgs e)
        {
            songName = this.TBSongName.Text;
            artistName = this.TBArtistName.Text;
            if (!string.IsNullOrEmpty(songName))
            {
                DoHttpWebRequest(songName);

            }
            else
            {
                JMessBox jb = new JMessBox("至少填写歌曲名称");
                jb.Show();
            }
        }
Exemplo n.º 5
0
        private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;
            if (frame == null)
            {
                return;
            }

            if (frame.CanGoBack)
            {
                frame.GoBack();
                e.Handled = true;
            }
            else
            {
                e.Handled = true;
                JMessBox jb = new JMessBox("再按一次离开");
                jb.Completed += (b) =>
                {
                    if (b)
                    {
                        //退出代码

                        Application.Current.Exit();
                    }
                };
                jb.Show();

            }
        }