I have some question about internals. Does GetElementsByTagName()
read all the elements requested store on an array and return it or return the value on-the-fly (like using yield
)? I hope it's clear
It returns an System.Windows.Forms.HtmlElementCollection
, which implements neither IEnumerable
nor IEnumerator
. That means it doesn't work like yield
.
yield
indicates that a method is an iterator. In addition, for a method to be an iterator, its return type must be IEnumerable
, IEnumerable<T>
, IEnumerator
, or IEnumerator<T>
.
See also: