private void OnQueueAdded(TreeQueue.Queue queue)
        {
            Item item = new Item(queue);

            queue.ItemAdded += OnQueueItemAdded;

            lock (itemsLock)
                items.Add(item);

            TryExecuteNext(item);
        }
        private void OnQueueItemAdded(TreeQueue.Queue queue, Func <Task> execute)
        {
            Item item = null;

            lock (itemsLock)
                item = items.FirstOrDefault(t => t.Queue == queue);

            if (item == null)
            {
                // TODO: This is weird.
                return;
            }

            TryExecuteNext(item);
        }
 public Item(TreeQueue.Queue queue)
 {
     Queue = queue;
 }