private void selectButton_Click(object sender, EventArgs e) { if (songLists.SelectedIndex == -1) { MessageBox.Show("Please select a song list", "Incorrect input", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (project) { Songlist currSongList = (Songlist)songLists.SelectedItem; int[] songs = currSongList.songListArray; for (var i = 0; i < songs.Length; i++) { Cursor.Show(); Song song = songBook.allMySongs[songs[i]]; ProjectSong project = new ProjectSong(song, songBook.fontSize); MessageBox.Show(song.songNum + "# " + song.title, "Song list: " + currSongList.listName, MessageBoxButtons.OK); Cursor.Hide(); project.ShowDialog(); } } else { DialogResult = DialogResult.OK; listToEdit = (Songlist)songLists.SelectedItem; Close(); } }
private void createNewListToolStripMenuItem_Click(object sender, EventArgs e) // CREATING NEW SONG LIST { Songlist newSongList = new Songlist(); listToEdit = newSongList; listLayout(); }
private void loadSongListToolStripMenuItem_Click(object sender, EventArgs e) { Songlist[] x = new Songlist[fileFunctions.songListManger.allMySongLists.Count]; for (var i = 0; i < fileFunctions.songListManger.allMySongLists.Count; i++) { x[i] = fileFunctions.songListManger.allMySongLists[i]; } LoadList test = new LoadList(x, songBook, true); test.ShowDialog(); }
public void AddSongList(int[] newSongListArray, string newListName) { Songlist x = new Songlist(); //Convert the string into an array //string[] test = newSongListArray.Split(','); //int[] result = new int[test.Length]; //for (var i = 0; i < test.Length; i++) //{ // result[i] = Int32.Parse(test[i]); //} x.AddSongList(newSongListArray, newListName); allMySongLists.Add(x); }
private void editSongListToolStripMenuItem_Click(object sender, EventArgs e) { editingSongList = true; Songlist[] x = new Songlist[fileFunctions.songListManger.allMySongLists.Count]; for (var i = 0; i < fileFunctions.songListManger.allMySongLists.Count; i++) { x[i] = fileFunctions.songListManger.allMySongLists[i]; } LoadList test = new LoadList(x, songBook, false); DialogResult loadPicker = test.ShowDialog(); if (loadPicker == DialogResult.OK) { listToEdit = test.listToEdit; //Now hide/disable all controls that shouldnt be able to be interacted with listLayout(); // Now display the songList Control[] selected = Controls.Find("songListBox", true); ListBox listbox = (ListBox)selected[0]; Control[] titleSelected = Controls.Find("songTitle", true); TextBox titleTextBox = (TextBox)titleSelected[0]; for (var y = 0; y < listToEdit.songListArray.Length; y++) { int songListNum = listToEdit.songListArray[y]; listbox.Items.Add(songBook.allMySongs[songListNum]); } titleTextBox.Text = listToEdit.listName; } }