IEnumerator IEnumerable.GetEnumerator()
    {
        if (Node == null)
        {
            return(SpecializedCollections.EmptyEnumerator <SyntaxTrivia>());
        }

        return(new EnumeratorImpl(this));
    }
        IEnumerator <SyntaxToken> IEnumerable <SyntaxToken> .GetEnumerator()
        {
            if (Node == null)
            {
                return(SpecializedCollections.EmptyEnumerator <SyntaxToken>());
            }

            return(new EnumeratorImpl(ref this));
        }
        IEnumerator IEnumerable.GetEnumerator()
        {
            if (this.Any())
            {
                return(new EnumeratorImpl(this));
            }

            return(SpecializedCollections.EmptyEnumerator <TNode>());
        }
Exemple #4
0
            IEnumerator IEnumerable.GetEnumerator()
            {
                if (_list.Count == 0)
                {
                    return(SpecializedCollections.EmptyEnumerator <SyntaxToken>());
                }

                return(new EnumeratorImpl(in _list));
            }
Exemple #5
0
        IEnumerator IEnumerable.GetEnumerator()
        {
            if (_node == null)
            {
                return(SpecializedCollections.EmptyEnumerator <SyntaxNodeOrToken>());
            }

            return(new EnumeratorImpl(_node, _count));
        }
Exemple #6
0
 IEnumerator IEnumerable.GetEnumerator()
 {
     if (this.list.Node == null)
     {
         return((IEnumerator)SpecializedCollections.EmptyEnumerator <TNode>());
     }
     else
     {
         return((IEnumerator)this.GetEnumerator());
     }
 }
Exemple #7
0
 /// <summary>
 /// Returns an enumerator that iterates through a collection.
 /// </summary>
 /// <returns>
 /// An <see cref="IEnumerator"/> object that can be used to iterate through the collection.
 /// </returns>
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(_node == null
         ? SpecializedCollections.EmptyEnumerator <SyntaxNodeOrToken>()
         : this.GetEnumerator());
 }