Exemplo n.º 1
0
 internal LinkedListEnumerator(Func <int> listVersionFactory, Nodes.LinkedListNode <T>?firstNode)
 {
     _listVersionFactory = listVersionFactory;
     _firstNode          = firstNode;
     _currentNode        = null;
     _initialListVersion = listVersionFactory();
 }
Exemplo n.º 2
0
        public bool MoveNext()
        {
            ThrowIfListIsUpdated();

            if (_currentNode == null)
            {
                _currentNode = _firstNode;
                return(true);
            }

            if (_currentNode.Next == _firstNode)
            {
                return(false);
            }

            _currentNode = _currentNode.Next;
            return(true);
        }
Exemplo n.º 3
0
        void IEnumerator.Reset()
        {
            ThrowIfListIsUpdated();

            _currentNode = null;
        }