Example #1
0
        public static void PlayNew(int index)
        {
            if ((Application.Current as App).CurrentSc01.Count != 0)
            {
                MediaPlayer.Play((Application.Current as App).CurrentSc01, index);

            }
            else
            {
                JMessBox jb = new JMessBox("没有歌曲");
                jb.Show();
            }
        }
 private void CustomListLB_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     if (XmlManipulate.AddItem((this.CustomListLB.SelectedItem as string), Tools.GetSong(this.itemName)) == false)
     {
         JMessBox jb = new JMessBox("重复");
         jb.Show();
     }
     else
     {
         JMessBox jb = new JMessBox("已添加");
         jb.Show();
     }
     NavigationService.GoBack();
 }
 private void BTNCreate_Click(object sender, RoutedEventArgs e)
 {
     if (this.TBContent.Text != "")
     {
         if (XmlManipulate.EstablishPlaylist(this.TBContent.Text) == false)
         {
             JMessBox jb = new JMessBox("已经包含" + this.TBContent.Text);
             jb.Show();
         }
         else NavigationService.GoBack();
     }
     else
     {
         JMessBox jb = new JMessBox("请输入内容");
         jb.Show();
     }
 }
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi01 = sender as MenuItem;
            string header = mi01.Header.ToString();
            string name = mi01.DataContext as string;
            if (name == null)
            {
                return;
            }
            if (header == "删除")
            {
                MessageBoxResult result = MessageBox.Show(string.Format("确定删除 {0} 吗?", name), "番茄播放器", MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                    if (XmlManipulate.RemoveLrcList(name) == false)
                    {
                        JMessBox jb = new JMessBox("删除失败");
                        jb.Show();
                    }
                    this.CustomListLB.ItemsSource = XmlManipulate.ShowLrcList();
                }
            }

        }
Example #5
0
 private void BTList_Click(object sender, RoutedEventArgs e)
 {
     JMessBox jb = new JMessBox("请稍后..");
     jb.Show();
     NavigationService.Navigate(new Uri("/ListPage.xaml", UriKind.Relative));
 }
Example #6
0
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            e.Cancel = true;

            JMessBox jb = new JMessBox("再按一次离开");
            jb.Completed += (b) =>
            {
                if (b)
                {
                    //退出代码
                    IsolatedStorageSettings appSetting = IsolatedStorageSettings.ApplicationSettings;
                    if (appSetting.Contains("IsStopWhenTerminate"))
                    {
                        if ((bool)appSetting["IsStopWhenTerminate"])
                        {
                            MediaPlayer.Stop();
                        }
                    }
                    Application.Current.Terminate();
                }
            };
            jb.Show();
        }
        private void BTNCleanUnavailableLrc_Click(object sender, RoutedEventArgs e)
        {
            int delCount = this.CleanUnavailableLrc();
            this.InitializeLrcList();
            JMessBox jb = new JMessBox(string.Format("完成,已清理{0}个文件", delCount.ToString()));
            jb.Show();

        }
Example #8
0
        /// <summary>
        /// 删除指定名称的列表
        /// </summary>
        /// <param name="PlaylistName">列表的名称</param>
        /// <returns>是否删除成功</returns>
        public static bool RemovePlaylist(string PlaylistName)
        {
            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                if (storage.DirectoryExists("MatoPlayList"))
                {
                    if (storage.FileExists(string.Format("MatoPlayList/{0}", PlaylistName)) && PlaylistName != "我最喜爱")
                    {
                        storage.DeleteFile(string.Format("MatoPlayList/{0}", PlaylistName));
                    }
                    else
                    {
                        JMessBox jb = new JMessBox("不能删除我的喜爱");
                        jb.Show();

                    }
                }
                else
                {
                    return false;
                }
                return true;
            }

        }
        /// <summary>
        /// 处理返回值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ht_FileWatchEvent(object sender, CompleteEventArgs e)
        {
            int lrcCount = 0;
            list = httpSer.Result2Deserializer(e.Node, out lrcCount);

            if (lrcCount == 0 || list.Count == 0)
            {
                Dispatcher.BeginInvoke(() =>
                {
                    JMessBox jb = new JMessBox("没有结果");
                    jb.Show();
                });
            }
            else
            {
                //遍历歌词结果列表
                list.ForEach(c =>
                {
                    //执行对每个artistid的查询
                    DoHttpWebRequestArtist(c.artist_id);

                });
                Dispatcher.BeginInvoke(() =>
                {

                    JMessBox jb = new JMessBox(string.Format("搜索到{0}个歌词", lrcCount));
                    jb.Show();
                });
            }
        }
        private void BTNSearch_Click(object sender, RoutedEventArgs e)
        {
            result.Clear();
            if (DoHttpWebRequest())
            {

            }
            else
            {
                JMessBox jb = new JMessBox("至少填写歌曲名称");
                jb.Show();
            }
        }
 /// <summary>
 /// 替换已存在的歌词文件
 /// </summary>
 /// <param name="content">歌词内容</param>
 private void GetCompleted(string content)
 {
     string lrcFileName = this.songName + "-" + this.artistName + ".lrc";
     XmlManipulate.RemoveLrcList(lrcFileName);
     if (XmlManipulate.EstablishLrc(lrcFileName, content))
     {
         Dispatcher.BeginInvoke(() =>
         {
             JMessBox jb = new JMessBox(string.Format("已更新 {0}", lrcFileName));
             jb.Show();
         });
     }
     else
     {
         Dispatcher.BeginInvoke(() =>
         {
             JMessBox jb = new JMessBox("更新失败");
             jb.Show();
         });
     }
 }
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi01 = sender as MenuItem;
            string header = mi01.Header.ToString();
            string name = (mi01.DataContext as Model.CustomListItem).songName;
            if (name == null)
            {
                return;
            }
            if (header == "从列表中删除")
            {
                if (XmlManipulate.RemoveItem(this.CustomPlaylistName, name) == false)
                {
                    JMessBox jb = new JMessBox("删除失败");
                    jb.Show();
                }
                this.CustomListLlsInitalize();

            }

        }
Example #13
0
        private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
           MenuItem mi01 = sender as MenuItem;
            string header = mi01.Header.ToString();
            string name = (mi01.DataContext as Song).Name;
            if (name == null)
            {
                return;
            }
            if (header == "添加至我最喜爱")
            {
                if (XmlManipulate.AddItem("我最喜爱", (mi01.DataContext as Song)) == false)
                {
                    JMessBox jb = new JMessBox("已经包含" + name);
                    jb.Show();
                }

            }
        }