BindingContext.IEnumerable.GetEnumerator BindingContext.IEnumerable.GetEnumerator BindingContext.IEnumerable.GetEnumerator Method

정의

컬렉션의 열거자를 가져옵니다.Gets an enumerator for the collection.

 virtual System::Collections::IEnumerator ^ System.Collections.IEnumerable.GetEnumerator() = System::Collections::IEnumerable::GetEnumerator;
System.Collections.IEnumerator IEnumerable.GetEnumerator ();
Function GetEnumerator () As IEnumerator Implements IEnumerable.GetEnumerator

반환

컬렉션에 대한 IEnumerator를 반환합니다.An IEnumerator for the collection.

구현

예제

다음 코드 예제에서는 IEnumerable.GetEnumerator 반환할 메서드를 IEnumerator 에 대 한는 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();
   }

   void ForEachEnumerator()
   {
      for each ( IEnumerator^ myEnumerator in ( (IEnumerable^)(this->BindingContext) ) )
      {
         Console::WriteLine( myEnumerator );
      }
   }
private void GetManagerEnumerator(){
   IEnumerator myEnumerator;
   myEnumerator = ((IEnumerable)this.BindingContext).GetEnumerator();
   ForEachEnumerator();
}

private void ForEachEnumerator(){
   foreach( IEnumerator myEnumerator in this.BindingContext){
      Console.WriteLine(myEnumerator.ToString());
   }
} 
Private Sub GetManagerEnumerator()
   Dim myEnumerator As IEnumerator
   myEnumerator = CType(BindingContext,IEnumerable).GetEnumerator()
   ForEachEnumerator()
End Sub

Private Sub ForEachEnumerator()
   Dim myEnumerator As IEnumerator
   For Each myEnumerator In CType(BindingContext,IEnumerable)
      Console.WriteLine(myEnumerator.Current.ToString())
   Next
End Sub 

설명

IEnumerator 반환한 합니다 IEnumerable.GetEnumerator 메서드를 사용 하면 관리 하는 컬렉션을 반복 하는 BindingContext합니다.The IEnumerator returned by the IEnumerable.GetEnumerator method allows you to iterate over the collection managed by the BindingContext.

적용 대상