private void EmitTrackRemoved(TrackEventArgs args)
        {
            TrackEventHandler handler = TrackRemoved;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        protected override void OnTracksAdded()
        {
            ThreadAssist.SpawnFromMain(delegate {
                Reload();

                TrackEventHandler handler = TracksAdded;
                if (handler != null)
                {
                    handler(this, new TrackEventArgs());
                }
            });
        }
Exemple #4
0
        protected override void OnTracksDeleted()
        {
            ThreadAssist.SpawnFromMain(delegate {
                PruneArtistsAlbums();
                Reload();

                TrackEventHandler handler = TracksDeleted;
                if (handler != null)
                {
                    handler(this, new TrackEventArgs());
                }

                SkipTrackIfRemoved();
            });
        }
Exemple #5
0
        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));
                }
            });
        }