示例#1
0
        public void LoadSongAlbum(int ID)
        {
            List <Dictionary <string, string> > list = MyResources.Resources.MsgSongs.FindSongsByAlbumID(ID);

            if (list == null)
            {
                WMP_Media.URL = null;
                FlowPanel_Playlist.Controls.Clear();
                MyResources.Resources.IDNowPlaylist = 0;
                NowPlaylist = null;
                return;
            }
            MyResources.Resources.IDNowPlaylist = ID;
            FlowPanel_Playlist.Controls.Clear();
            // if album null
            if (list.Count == 0)
            {
                WMP_Media.URL = null;
            }
            for (int i = 0; i < list.Count; i++)
            {
                RowTableNowPLaylist r = new RowTableNowPLaylist();
                r.SetData(list[i]);
                if (i == 0)
                {
                    r.SetPLaying();
                }
                else
                {
                    r.SetNotPlaying();
                }
                FlowPanel_Playlist.Controls.Add(r);
            }
            TypePlaying = "album";
        }
示例#2
0
        public void InsertItemInNowPlaylist(Dictionary <string, string> item)
        {
            RowTableNowPLaylist r = new RowTableNowPLaylist();

            r.SetData(item);
            r.SetNotPlaying();
            FlowPanel_Playlist.Controls.Add(r);
            NowPlaylist.Add(item);
        }
示例#3
0
        public void ReloadPlaylistByID()
        {
            List <Dictionary <string, string> > list;

            if (TypePlaying == "playlist")
            {
                Playlist tmp = MyResources.Resources.GetPlaylistByID(MyResources.Resources.IDNowPlaylist);
                list = tmp.GetPlayingListDic();
            }
            else
            {
                list = MyResources.Resources.MsgSongs.FindSongsByAlbumID(MyResources.Resources.IDNowPlaylist);
            }
            bool IsControlNowPlayingDeleted = false;
            RowTableNowPLaylist NowPlaying  = FlowPanel_Playlist.Controls[0] as RowTableNowPLaylist;

            if (!CheckDiffPlaylist(list))
            {
                return;
            }

            FlowPanel_Playlist.Controls.Clear();
            if (list.IndexOf(NowPlaying.GetTag()) < 0)
            {
                IsControlNowPlayingDeleted = true;
            }
            else
            {
                list.Remove(NowPlaying.GetTag());
                FlowPanel_Playlist.Controls.Add(NowPlaying);
            }


            for (int i = 0; i < list.Count; i++)
            {
                RowTableNowPLaylist r = new RowTableNowPLaylist();
                r.SetData(list[i]);
                if (i == 0 && IsControlNowPlayingDeleted)
                {
                    r.SetPLaying();
                }
                else
                {
                    r.SetNotPlaying();
                }
                FlowPanel_Playlist.Controls.Add(r);
            }
        }
示例#4
0
        public void DeleteItemInNowPlaylist()
        {
            bool IsDelNowPlaying = true;

            foreach (Control i in FlowPanel_Playlist.Controls)
            {
                if (i.Name == "Playing")
                {
                    IsDelNowPlaying = false;
                }
                if (i.Name == "Del")
                {
                    FlowPanel_Playlist.Controls.Remove(i);
                    NowPlaylist.Remove((i as RowTableNowPLaylist).GetTag());
                }
            }
            if (IsDelNowPlaying)
            {
                RowTableNowPLaylist r = FlowPanel_Playlist.Controls[0] as RowTableNowPLaylist;
                r.SetPLaying();
            }
        }
示例#5
0
        public void LoadPlaylist(int ID)
        {
            Playlist tmp = MyResources.Resources.GetPlaylistByID(ID);

            if (tmp == null)
            {
                WMP_Media.URL = null;
                FlowPanel_Playlist.Controls.Clear();
                MyResources.Resources.IDNowPlaylist = 0;
                NowPlaylist = null;
                return;
            }
            List <Dictionary <string, string> > list = tmp.GetPlayingListDic();

            NowPlaylist = list;
            if (list.Count == 0)
            {
                WMP_Media.URL = null;
            }
            MyResources.Resources.IDNowPlaylist = ID;
            FlowPanel_Playlist.Controls.Clear();
            for (int i = 0; i < list.Count; i++)
            {
                RowTableNowPLaylist r = new RowTableNowPLaylist();
                r.SetData(list[i]);
                if (i == 0)
                {
                    r.SetPLaying();
                }
                else
                {
                    r.SetNotPlaying();
                }
                FlowPanel_Playlist.Controls.Add(r);
            }
            TypePlaying = "playlist";
        }