private void EmitTrackRemoved(TrackEventArgs args) { TrackEventHandler handler = TrackRemoved; if (handler != null) { handler(this, args); } }
internal TrackCollection(TrackEventHandler addHandler, TrackEventHandler removeHandler) { if ((addHandler == null || removeHandler == null) && addHandler != removeHandler) { throw new ArgumentException("Both addHandler and removeHandler must be specified."); } _addHandler = addHandler; _removeHandler = removeHandler; }
protected override void OnTracksAdded() { ThreadAssist.SpawnFromMain(delegate { Reload(); TrackEventHandler handler = TracksAdded; if (handler != null) { handler(this, new TrackEventArgs()); } }); }
protected override void OnTracksDeleted() { ThreadAssist.SpawnFromMain(delegate { PruneArtistsAlbums(); Reload(); TrackEventHandler handler = TracksDeleted; if (handler != null) { handler(this, new TrackEventArgs()); } SkipTrackIfRemoved(); }); }
protected override void OnTracksChanged(params QueryField [] fields) { ThreadAssist.SpawnFromMain(delegate { if (NeedsReloadWhenFieldsChanged(fields)) { Reload(); } else { InvalidateCaches(); } System.Threading.Thread.Sleep(150); TrackEventHandler handler = TracksChanged; if (handler != null) { handler(this, new TrackEventArgs(fields)); } }); }