private void DoubleClick(object sender, EventArgs e) { if (parentForm.GetType() == typeof(Allsongs)) { Allsongs x = (Allsongs)parentForm; x.Play(sender, e); } else if (parentForm.GetType() == typeof(Playlists_List)) { Playlists_List x = (Playlists_List)parentForm; x.Select(sender, e); } }
public PlayList(Playlists_List x) { InitializeComponent(); playlist = new List <Song>(); songPanels = new List <Panel>(); ap = new AddPanels(); indexList = new List <int>(); BinaryFormatter bf = new BinaryFormatter(); FileStream f = new FileStream("Files/Songs/songs.dat", FileMode.OpenOrCreate); try { songList = (List <Song>)bf.Deserialize(f); } catch { songList = new List <Song>(); } f.Close(); caller = x; }
private void button7_Click(object sender, EventArgs e) //Playlist { Playlists_List playl = new Playlists_List(); playl.StartPosition = FormStartPosition.Manual; playl.Location = new Point(this.Location.X + panel1.Location.X, this.Location.Y + panel1.Location.Y + 32); playl.Size = panel1.Size; playl.ShowDialog(); int ind = playl.Index; if (ind != -1) { FileStream f = new FileStream("Files/Playlists/playlists.dat", FileMode.OpenOrCreate); List <Song> list; try { list = (List <Song>)bf.Deserialize(f); } catch { list = new List <Song>(); } f.Close(); List <Song> listSongs; string path = list[ind].Path; FileStream f1 = new FileStream(path, FileMode.OpenOrCreate); try { listSongs = (List <Song>)bf.Deserialize(f1); } catch { listSongs = new List <Song>(); } f1.Close(); axWindowsMediaPlayer1.Ctlcontrols.stop(); playListIndex = 0; LoadPlayList(listSongs); } }