Exemplo n.º 1
0
 void System.Collections.IEnumerator.Reset()
 {
     if (_version != _list.version)
     {
         throw Failure.CollectionModified();
     }
     _node  = _list._head;
     _index = 0;
 }
Exemplo n.º 2
0
        public IEnumerator <KeyValuePair <SymbolType, T> > GetEnumerator()
        {
            int start = _version;

            for (int i = 0; i < _values.Length; i++)
            {
                if (_version != start)
                {
                    throw Failure.CollectionModified();
                }

                yield return(new KeyValuePair <SymbolType, T>((SymbolType)i, _values[i]));
            }
        }
Exemplo n.º 3
0
        public IEnumerator <KeyValuePair <Verbosity, T> > GetEnumerator()
        {
            int startingVersion = this.version;
            int index           = 0;

            foreach (T t in this.values)
            {
                if (startingVersion != this.version)
                {
                    throw Failure.CollectionModified();
                }

                yield return(new KeyValuePair <Verbosity, T>(AllVerbosityValues()[index++], t));
            }
        }
Exemplo n.º 4
0
        public override IEnumerator <PropertyNode> GetEnumerator()
        {
            PropertyNode current      = this.head;
            int          startVersion = this.version;

            while (current != null)
            {
                if (startVersion != this.version)
                {
                    throw Failure.CollectionModified();
                }

                yield return(current);

                current = current.NextSibling;
            }
        }
Exemplo n.º 5
0
            public bool MoveNext()
            {
                if (_version != _list.version)
                {
                    throw Failure.CollectionModified();
                }

                if (_node == null)
                {
                    _index = _list.Count + 1;
                    return(false);
                }

                ++_index;
                _current = _node;
                _node    = _node.next;
                if (_node == _list._head)
                {
                    _node = null;
                }
                return(true);
            }