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)

virtual IEnumerator^ GetEnumerator() sealed = 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.

   void GetManagerEnumerator()
      IEnumerator^ myEnumerator;
      myEnumerator = ( (IEnumerable^)(this->BindingContext) )->GetEnumerator();

   void ForEachEnumerator()
      for each ( IEnumerator^ myEnumerator in ( (IEnumerable^)(this->BindingContext) ) )
         Console::WriteLine( myEnumerator );

.NET Framework
Available since 1.1
Return to top