recls C# mapping (release 12th October 2003)

FileSearch.GetEnumerator Method 

Returns the enumerator with which the given search can be enumerated

[Visual Basic]
Public Function GetEnumerator() As IEnumerator
[C#]
public IEnumerator GetEnumerator();

Return Value

An IEnumerator for the entire FileSearch.

Remarks

This method enables a FileSearch instance to be used in a foreach expression, as in:

            
            FileSearch search = . . .;
            foreach(FileEntry entry in search)
            {
              Console.WriteLine(entry.Path);
            }
            
            
As with the FileSearch constructor, no enumeration is carried out at this time, only when the returned enumerator is used. When the enumerator's MoveNext method is called, it may throw a ReclsException if the search fails, except for the case where the search runs out of data. In this case, the enumerator's MoveNext method returns false.

See Also

FileSearch Class | recls Namespace