private void eraseButton_Click(object sender, EventArgs e) { IPlayerComponent componentToRemoveFrom; IPlayerComponent componentToRemove; if (PlayListTreeViewer.SelectedNode != null) { if (PlayListTreeViewer.SelectedNode.Parent != null) { componentToRemoveFrom = (IPlayerComponent)PlayListTreeViewer.SelectedNode.Parent.Tag; componentToRemove = (IPlayerComponent)PlayListTreeViewer.SelectedNode.Tag; if (componentToRemove.IsContains(SongsPlayer.GetCurrentSong())) { SongsPlayer.Stop(); SongsPlayer.Visible = false; } componentToRemoveFrom.RemoveComponent(componentToRemove); } else { ShowMessageBox("לא ניתן למחוק את כל הרשימות"); } } else { ShowMessageBox("עלייך לבחור מה למחוק"); } }
private void eraseButton_Click(object sender, EventArgs e) { SongsPlayer.Stop(); if (playListBox.Items.Count != 0) { playListBox.Items.Remove(playListBox.SelectedItem); if (playListBox.Items.Count == 0) { EraseButton.Visible = false; } } }
public void StopPlaying() { SongsPlayer.Stop(); }