Beispiel #1
0
        public void AddItem(T item)
        {
            _queue.Enqueue(item);

            QueueEventArgs queueEventArgs = new QueueEventArgs {
                Message = $"DateTime: {DateTime.Now.ToString(Constants.DateTimeFormat)}, Id ({item.Id}), Name ({item.Name}), Type ({item.Type}), Quantity ({item.Quantity}), has been added to the queue."
            };

            OnQueueChanged(queueEventArgs);
        }
Beispiel #2
0
        public T GetItem()
        {
            T item = _queue.Dequeue();

            QueueEventArgs queueEventArgs = new QueueEventArgs {
                Message = $"DateTime: {DateTime.Now.ToString(Constants.DateTimeFormat)}, Id ({item.Id}), Name ({item.Name}), Type ({item.Type}), Quantity ({item.Quantity}), has been processed."
            };

            OnQueueChanged(queueEventArgs);

            return(item);
        }
Beispiel #3
0
 protected virtual void OnQueueChanged(QueueEventArgs a)
 {
     CustomQueueEvent(this, a);
 }