public void AddTrackToQueue(IPlayable playable, TimeSpan duration) { QueueItems.Add(new QueueItem { Playable = playable, Duration = duration }); playable.IsQueued = true; }
public Task OnQueueData(QueueData data) { QueueItems.Clear(); foreach (var item in data.Items) { QueueItems.Add(new DisplayQueueDirectory(item)); } return(Task.FromResult(0)); }
public Task OnQueueUpdate(QueueUpdate update) { if (update.Item == null) { // ディレクトリに対する操作 if (update.Type == UpdateType.Add) { QueueItems.Add(new DisplayQueueDirectory(update.Directory)); } else { var dir = QueueItems.FirstOrDefault(d => d.Path == update.DirPath); if (dir != null) { if (update.Type == UpdateType.Remove) { QueueItems.Remove(dir); } else { QueueItems[QueueItems.IndexOf(dir)] = new DisplayQueueDirectory(update.Directory); } } } } else { // ファイルに対する操作 var dir = QueueItems.FirstOrDefault(d => d.Path == update.DirPath); if (dir != null) { if (update.Type == UpdateType.Add) { dir.Items.Add(update.Item); } else { var file = dir.Items.FirstOrDefault(f => f.Path == update.Item.Path); if (file != null) { if (update.Type == UpdateType.Remove) { dir.Items.Remove(file); } else // Update { dir.Items[dir.Items.IndexOf(file)] = update.Item; } } } } } return(Task.FromResult(0)); }
public CollectionCrawlingQueueProxy(InitializationLink initializationLink, ICollection <ResourceLink> resourceLinks, params CollectionCrawlingQueueProxy[] dependencies) : base(dependencies) { if (initializationLink != null) { InitializationLink = initializationLink; } foreach (var resourceLink in resourceLinks) { QueueItems.Add(new CrawlingQueueItem(resourceLink)); } }
public void AddTrackToQueue(IPlayable playable) { QueueItems.Add(new QueueItem { Playable = playable }); }