示例#1
0
        public override void DeleteTracks(DatabaseTrackListModel model, Selection selection)
        {
            if (model == null || model.Count < 1)
            {
                return;
            }

            var list = CachedList <DatabaseTrackInfo> .CreateFromModelAndSelection(model, selection);

            ThreadAssist.SpawnFromMain(delegate {
                DeleteTrackList(list);
            });
        }
示例#2
0
        protected void LoadTrackModel(TrackListModel model, Selection selection)
        {
            DatabaseTrackListModel db_model = model as DatabaseTrackListModel;

            if (db_model != null)
            {
                db_selection = CachedList <DatabaseTrackInfo> .CreateFromModelAndSelection(db_model, selection);
            }
            else
            {
                memory_selection = new List <TrackInfo> ();
                var items = new ModelSelection <TrackInfo> (model, selection);
                foreach (TrackInfo track in items)
                {
                    memory_selection.Add(track);
                }
            }
        }
示例#3
0
        public override bool AddSelectedTracks(Source source, Selection selection)
        {
            if (!AcceptsInputFromSource(source))
            {
                return(false);
            }

            DatabaseTrackListModel model = (source as ITrackModelSource).TrackModel as DatabaseTrackListModel;

            // Store a snapshot of the current selection
            CachedList <DatabaseTrackInfo> cached_list = CachedList <DatabaseTrackInfo> .CreateFromModelAndSelection(model, selection);

            if (ThreadAssist.InMainThread)
            {
                System.Threading.ThreadPool.QueueUserWorkItem(AddTrackList, cached_list);
            }
            else
            {
                AddTrackList(cached_list);
            }
            return(true);
        }