コード例 #1
0
        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();
        }
コード例 #2
0
        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;
            }
        }