コード例 #1
0
        private void Dequeue()
        {
            if (_head == null)
            {
                throw new InvalidOperationException("Can not dequeue from empty queue.");
            }

            _head = _head.Next;

            if (_head == null)
            {
                _tail = null;
            }
        }
コード例 #2
0
 public void Enqueue(Action value)
 {
     if (IsEmpty)
     {
         _tail = _head = new CleanupAction {
             Method = value, Next = null
         };
     }
     else
     {
         var item = new CleanupAction {
             Method = value, Next = null
         };
         _tail.Next = item;
         _tail      = item;
     }
 }