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"; }
public void InsertItemInNowPlaylist(Dictionary <string, string> item) { RowTableNowPLaylist r = new RowTableNowPLaylist(); r.SetData(item); r.SetNotPlaying(); FlowPanel_Playlist.Controls.Add(r); NowPlaylist.Add(item); }
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); } }
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"; }