private void addToPlaylist_Button_Click(object sender, EventArgs e) { AddtoPlaylistForm add2PL = new AddtoPlaylistForm(albumsFm.mainScr, true, albumInfo); add2PL.ShowDialog(); //add reload form here //-> }
private void addToPlaylist_Button_Click(object sender, EventArgs e) { AddtoPlaylistForm add2PL = new AddtoPlaylistForm(playlistForm.mainScr, true, trackInfo) { currentPlaylistName = playlistTitle_label.Text }; add2PL.ShowDialog(); //add reload form here //-> }
private void track_dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex == -1) { return; } DataGridViewRow selectedRow = track_dataGridView.Rows[e.RowIndex]; TrackInfo selectedTrack = selectedRow.Tag as TrackInfo; //love if (e.ColumnIndex == 4) { if (selectedTrack.IsLoved == false) { Database.addTrackToUserLikeTrack(myMix.mainScr.CurrentUser.UserID, selectedTrack.TrackID); selectedTrack.IsLoved = true; selectedRow.Cells[4].Value = Properties.Resources.liked; selectedRow.Tag = selectedTrack; selectedTrack.DateAdded = DateTime.Now.ToShortDateString(); myMix.mainScr.tracksScr.addRow(selectedTrack); } else { Database.deleteTrackInUserLikeTrack(myMix.mainScr.CurrentUser.UserID, selectedTrack.TrackID); selectedTrack.IsLoved = false; selectedRow.Cells[4].Value = Properties.Resources.like; selectedRow.Tag = selectedTrack; myMix.mainScr.tracksScr.deleteRow(selectedTrack.TrackID); } myMix.mainScr.albumsScr.reloadAlbumContainer(); myMix.mainScr.playlistScr.reloadPlaylistContainer(); myMix.reloadMixContainer(); myMix.mainScr.artistScr.reloadArtistContainer(); myMix.mainScr.checkLoved(); } else if (e.ColumnIndex == 3)// add to playlist { AddtoPlaylistForm addFm = new AddtoPlaylistForm(myMix.mainScr, selectedTrack.TrackID); addFm.ShowDialog(); } }
public CreatePlayList(MainScreen callForm, AddtoPlaylistForm addtoPlaylistForm) { InitializeComponent(); mainScr = callForm; this.addtoPlaylistForm = addtoPlaylistForm; PlaylistMenu_panel = mainScr.getCreatePlayList_FlowPanel(); Description_TextBox.GotFocus += Description_TextBox_GotFocus; Description_TextBox.LostFocus += Description_TextBox_LostFocus; Title_TextBox.GotFocus += Title_TextBox_GotFocus; Title_TextBox.LostFocus += Title_TextBox_LostFocus; this.DoubleBuffered = true; foreach (Control control in this.Controls) { MainScreen.EnableDoubleBuferring(control); } }
private void trackGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } selectedRow = track_gridView.Rows[e.RowIndex]; selectedTrack = selectedRow.Tag as TrackInfo; if (e.ColumnIndex == 6)//unlike { check_worker.RunWorkerAsync(); selectedTrack.IsLoved = false; track_gridView.Rows.Remove(selectedRow); } else if (e.ColumnIndex == 5)//add to playlist { add2PL = new AddtoPlaylistForm(mainScr, selectedTrack.TrackID); add2PL.ShowDialog(); } }
private void track_dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex == -1) { return; } DataGridViewRow selectedRow = track_dataGridView.Rows[e.RowIndex]; TrackInfo selectedTrack = selectedRow.Tag as TrackInfo; #region delete track from playlist if (e.ColumnIndex == 7) { Database.deleteTrackFromPlaylist(playlistContainer.playlistID, selectedTrack.TrackID); trackInfo.Remove(selectedTrack); track_dataGridView.Rows.Remove(selectedRow); TimeSpan duration = TimeSpan.ParseExact(selectedTrack.Time, "mm\\:ss", CultureInfo.InvariantCulture); int seconds = (int)duration.TotalSeconds; playlistContainer.timeInSec -= seconds; TimeSpan time = TimeSpan.FromSeconds(playlistContainer.timeInSec); string str = time.ToString(@"hh\:mm\:ss"); createdBy_label.Text = "Created by " + playlistContainer.owner + " - " + trackInfo.Count + " Tracks - " + str; playlistContainer.numberOfTracks_label.Text = --playlistContainer.trackCount + " Tracks"; playlistContainer.loadCover(true); } #endregion delete track from playlist else if (e.ColumnIndex == 6)//like track { if (selectedTrack.IsLoved == false) { Database.addTrackToUserLikeTrack(playlistForm.mainScr.CurrentUser.UserID, selectedTrack.TrackID); selectedTrack.IsLoved = true; selectedRow.Cells[6].Value = Properties.Resources.liked; selectedRow.Tag = selectedTrack; selectedTrack.DateAdded = DateTime.Now.ToShortDateString(); playlistForm.mainScr.tracksScr.addRow(selectedTrack); } else { Database.deleteTrackInUserLikeTrack(playlistForm.mainScr.CurrentUser.UserID, selectedTrack.TrackID); selectedTrack.IsLoved = false; selectedRow.Cells[6].Value = Properties.Resources.like; selectedRow.Tag = selectedTrack; playlistForm.mainScr.tracksScr.deleteRow(selectedTrack.TrackID); } playlistForm.reloadPlaylistContainer(); playlistForm.mainScr.myMixScr.reloadMixContainer(); playlistForm.mainScr.albumsScr.reloadAlbumContainer(); playlistForm.mainScr.artistScr.reloadArtistContainer(); playlistForm.mainScr.checkLoved(); } else if (e.ColumnIndex == 5)// add to playlist { AddtoPlaylistForm addFm = new AddtoPlaylistForm(playlistForm.mainScr, selectedTrack.TrackID) { currentPlaylistName = playlistTitle_label.Text }; addFm.ShowDialog(); } }