示例#1
0
 private async void addSong(Music.Song song) {
   if (songTable != null) {
     if (operationMode == OPERATION_MODE.ONLINE) {
       try {
         IEnumerable<ParseObject> findSong = await ((ParseQuery<ParseObject>)songTable.findSong(song.Title)).FindAsync();
         foreach (ParseObject item in findSong) {
           if (item.Get<string>(Music.SongTableOnline.COLUMN_TITLE).ToLower().Equals(song.Title.ToLower())) {
             song.modifyOnline(item);
             return;
           }
         }
         song.upLoad();
       } catch (Exception e) {
         MessageBox.Show(e.ToString());
       }
     } else if (operationMode == OPERATION_MODE.OFFLINE) {
       song.saveLocal(LOAD_LOCATION);
     }
   }
 }