/// <summary> /// QueueItem to serialize /// </summary> object QueueItemObject(QueueItem queueItem) { return new { MediumID = queueItem.Container.Medium.Id, ContainerID = queueItem.Container.Id, Item = queueItem.Item }; }
/// <summary> /// Constructs a new queue with one QueueItem in it. /// </summary> /// <param name="item">The item to add to the queue</param> public Queue(QueueItem item) : this() { _itemsOriginal.Add(item); _items.Add(item); }
/// <summary> /// Appends the given item to the end of the queue /// </summary> /// <param name="item">The item to add</param> public void Push(QueueItem item) { _items.Add(item); OnItemsUpdated(); }
/// <summary> /// Appends the given item to the end of the priority queue /// </summary> /// <param name="item">The item to add</param> public void PushToPriority(QueueItem item) { PushToPriority(new List<QueueItem>() { item }); }
/// <summary> /// Prepends the given item to the start of the priority queue /// </summary> /// <param name="item">The item to add</param> public void Prioritize(QueueItem item) { Prioritize(new List<QueueItem>() { item }); }