public virtual void MediaRemove(IMedia media) { lock (((IDictionary)Files).SyncRoot) Files.Remove(media.MediaGuid); MediaRemoved?.Invoke(this, new MediaEventArgs(media)); media.PropertyChanged -= _media_PropertyChanged; ((MediaBase)media).Dispose(); }
public virtual void MediaRemove(IMedia media) { Media removed; _files.TryRemove(media.MediaGuid, out removed); MediaRemoved?.Invoke(this, new MediaEventArgs(media)); if (removed != null) { removed.PropertyChanged -= _media_PropertyChanged; removed.Dispose(); } }