示例#1
0
 /// <summary>
 /// Trigger the ModifyTracks event.
 /// </summary>
 /// <param name="collection">The collection that need to be modified</param>
 /// <param name="arguments">The arguments describing the modifications</param>
 public static void DispatchModifyTracks(ObservableCollection<TrackData> collection, ModifiedEventArgs arguments)
 {
     if (ModifyTracks != null)
         ModifyTracks(collection, arguments);
 }
示例#2
0
        /// <summary>
        /// Invoked when a playlist has been modified.
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event data</param>
        private static void PlaylistManager_PlaylistModified(object sender, ModifiedEventArgs e)
        {
            PlaylistData playlist = sender as PlaylistData;

            if (Identity == null)
                return;

            Thread thread = new Thread(delegate()
            {
                switch (e.Type)
                {
                    case ModifyType.Created:
                        UploadPlaylist(playlist);
                        break;

                    case ModifyType.Removed:
                        lock (syncOutLocker)
                            syncOutBuffer.Add(new SyncOperation("delete", "playlists", playlist.ID));
                        InitiateSyncTimer();
                        break;
                }
            });
            thread.Name = "Playlist sync thread";
            thread.Priority = ThreadPriority.Lowest;
            thread.Start();
        }