Example #1
0
 public static int songComparison(Song song1, Song song2) {
   return String.Compare(song1.Title, song2.Title);
 }
Example #2
0
 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();
     }
   }
 }
Example #3
0
    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();
    }
Example #4
0
 private void bPreviewClick() {
   song = new Music.Song(tbTitle.Text, tbContent.Text.Split('\n'));
   song.displaySong(tbContent, Color.Black, Color.Violet);
 }
Example #5
0
    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();
    }