BindingContext.IEnumerable.GetEnumerator Method ()

 

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets an enumerator for the collection.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

IEnumerator IEnumerable.GetEnumerator()

Return Value

Type: System.Collections.IEnumerator

An IEnumerator for the collection.

The IEnumerator returned by the IEnumerable.GetEnumerator method allows you to iterate over the collection managed by the BindingContext.

The following code example uses the IEnumerable.GetEnumerator method to return an IEnumerator for the BindingContext.

private void GetManagerEnumerator(){
   IEnumerator myEnumerator;
   myEnumerator = ((IEnumerable)this.BindingContext).GetEnumerator();
   ForEachEnumerator();
}

private void ForEachEnumerator(){
   foreach( IEnumerator myEnumerator in this.BindingContext){
      Console.WriteLine(myEnumerator.ToString());
   }
} 

.NET Framework
Available since 1.1
Return to top
Show: