Exemple #1
0
        public void ClickLocalMusicExecute()
        {
            ListId = string.Empty;
            MusicInfos.Clear();
            var list = new LocalListManager().GetList();

            list.ForEach(item =>
            {
                var mim   = new MusicInfoManager();
                var music = mim.Find(item.Id);
                MusicInfos.Add(music.ToIMusic());
            });
            PlayerList.SetPreList(MusicInfos, "本地音乐");
            DataGridAnimation();
        }
Exemple #2
0
        public void DefaultListExecute()
        {
            ListId = string.Empty;
            var orm  = new DefaultListManager();
            var list = orm.GetList();

            MusicInfos.Clear();
            list.ForEach(item =>
            {
                var mif   = new MusicInfoManager();
                var music = mif.Find(item.Id);
                MusicInfos.Add(music.ToIMusic());
            });
            PlayerList.SetPreList(MusicInfos, "默认列表");
            DataGridAnimation();
        }
Exemple #3
0
        public void ClickCustomList(object parameter)
        {
            ListId = string.Empty;
            string title = parameter.ToString();
            var    ls    = new CustomListManager().GetList();

            MusicInfos.Clear();
            ls.ForEach(item =>
            {
                if (item.Title == title)
                {
                    var mim   = new MusicInfoManager();
                    var music = mim.Find(item.Id);
                    MusicInfos.Add(music.ToIMusic());
                }
            });
            PlayerList.SetPreList(MusicInfos, title);
            DataGridAnimation();
        }
Exemple #4
0
        public void ClickPlatformList(object parameter)
        {
            string id = parameter.ToString();

            ListId = id;
            var ls = new PlatformListManager().GetList();

            MusicInfos.Clear();
            ls.ForEach(item =>
            {
                if (item.PlatformId == id)
                {
                    var mim   = new MusicInfoManager();
                    var music = mim.Find(item.MusicId);
                    MusicInfos.Add(music.ToIMusic());
                }
            });
            PlayerList.SetPreList(MusicInfos, new PlatformInfoManager().Find(id).Title);
            DataGridAnimation();
        }
Exemple #5
0
 public void RefreshShowList(string title)
 {
     //如果当前BasePage的DataGrid展示的是默认列表,进行刷新
     if (PlayerList.PreListTitle != title)
     {
         return;
     }
     if (ListId == string.Empty)
     {
         if (title == "默认列表")
         {
             var orm  = new DefaultListManager();
             var list = orm.GetList();
             MusicInfos.Clear();
             list.ForEach(item =>
             {
                 var mif   = new MusicInfoManager();
                 var music = mif.Find(item.Id);
                 MusicInfos.Add(music.ToIMusic());
             });
         }
         else if (title == "本地音乐")
         {
             MusicInfos.Clear();
             var list = new LocalListManager().GetList();
             list.ForEach(item =>
             {
                 var mim   = new MusicInfoManager();
                 var music = mim.Find(item.Id);
                 MusicInfos.Add(music.ToIMusic());
             });
         }
         else
         {
             var ls = new CustomListManager().GetList();
             MusicInfos.Clear();
             ls.ForEach(item =>
             {
                 if (item.Title == title)
                 {
                     var mim   = new MusicInfoManager();
                     var music = mim.Find(item.Id);
                     MusicInfos.Add(music.ToIMusic());
                 }
             });
         }
     }
     else
     {
         var ls = new PlatformListManager().GetList();
         MusicInfos.Clear();
         ls.ForEach(item =>
         {
             if (item.PlatformId == ListId)
             {
                 var mim   = new MusicInfoManager();
                 var music = mim.Find(item.MusicId);
                 MusicInfos.Add(music.ToIMusic());
             }
         });
     }
 }