Esempio n. 1
0
 internal LinkedListEnumerator(Func <int> listVersionFactory, Nodes.LinkedListNode <T>?firstNode)
 {
     _listVersionFactory = listVersionFactory;
     _firstNode          = firstNode;
     _currentNode        = null;
     _initialListVersion = listVersionFactory();
 }
Esempio 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);
        }
Esempio n. 3
0
        void IEnumerator.Reset()
        {
            ThrowIfListIsUpdated();

            _currentNode = null;
        }