public static int songComparison(Song song1, Song song2) { return String.Compare(song1.Title, song2.Title); }
private void lbSongs_SelectedIndexChanged(object sender, EventArgs e) { if (lbSongs.Items.Count != 0) { if (lbSongs.SelectedItem != null) { song = selectedSongChanged(lbSongs.SelectedItem.ToString()); song.displaySong(tbContent, Color.Black, Color.Violet); tbTitle.Text = lbSongs.SelectedItem.ToString(); } } }
private void bUploadClick() { if (tbTitle.Text.Equals("")) { MessageBox.Show("Please provide song title"); return; } string[] content = tbContent.Text.Split('\n'); song = new Music.Song(tbTitle.Text, content); addSong(song); showSyncRequest(); }
private void bPreviewClick() { song = new Music.Song(tbTitle.Text, tbContent.Text.Split('\n')); song.displaySong(tbContent, Color.Black, Color.Violet); }
private void uploadSongs(string directory) { DirectoryInfo dir = new DirectoryInfo(directory); FileInfo[] files = dir.GetFiles("*.txt"); foreach (FileInfo file in files) { string title = file.Name.ToString(); title = title.Remove(title.Length - 4); string[] contents = File.ReadAllLines(directory + file.Name.ToString()); Music.Song toBeUploaded = new Music.Song(title, contents); addSong(toBeUploaded); } showSyncRequest(); }