Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        public void QueueUserWorkItem(object item)
        {
            lock (_queue)
            {
                _queue.Enqueue(item);
            }

            EnqueueEvent.Set();
        }
        public void Enqueue <T>(T item)
        {
            var type = typeof(T);

            if (!slots.ContainsKey(type))
            {
                throw new Exception("!slots.ContainsKey( type )");
            }

            slots[type].Enqueue(item);
            EnqueueEvent?.Invoke(type, new QueueEventArgs(item));
        }
Exemplo n.º 3
0
        public void Enqueue(T item)
        {
            if (Count == _array.Length)
            {
                int capacity = (int)((_array.Length * _GrowFactor) / 100L);
                if (capacity < (_array.Length + _MinimumGrow))
                {
                    capacity = _array.Length + _MinimumGrow;
                }
                SetCapacity(capacity);
            }
            _array[_tail] = item;
            _tail         = (_tail + 1) % _array.Length;
            Count++;
            _version++;

            EnqueueEvent?.Invoke(this, new MyQueueEventArgs <T>("Event from Enqueue", item));
        }
Exemplo n.º 4
0
 public void OnEnqueueEvent(Point[] enqueuedPoints, Point[] providedPoints, string[] validationErrors)
 {
     EnqueueEvent?.Invoke(this, new EnqueueEventArgs(enqueuedPoints, providedPoints, validationErrors));
 }