예제 #1
0
        public IEnumerator <BatchPair> GetEnumerator()
        {
            if (_enumeration != null)
            {
                foreach (BatchPair pair in _enumeration)
                {
                    yield return(pair);
                }
            }

            BatchPairNode node = _head;

            while (node != null)
            {
                yield return(node.Pair);

                node = node.Next;
            }
        }
예제 #2
0
        public void Add(BatchPair pairToAdd)
        {
            if (pairToAdd == null)
            {
                throw new ArgumentException("Attempt to add a null pair.");
            }

            BatchPairNode newNode = new BatchPairNode(pairToAdd);

            if (_head == null)
            {
                _head = newNode;
                _tail = _head;
            }
            else
            {
                _tail.Next = newNode;
                _tail      = newNode;
            }
        }
예제 #3
0
 public void Clear()
 {
     _head        = null;
     _tail        = null;
     _enumeration = null;
 }
예제 #4
0
 public BatchPairNode(BatchPair pair)
 {
     Pair = pair;
     Next = null;
 }