StateBag.GetEnumerator Metoda

Definice

Vrátí enumerátor, který iteruje všechny páry StateItem klíč/hodnota objektů uložených v objektu StateBag .

public:
 virtual System::Collections::IDictionaryEnumerator ^ GetEnumerator();
public System.Collections.IDictionaryEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IDictionaryEnumerator
override this.GetEnumerator : unit -> System.Collections.IDictionaryEnumerator
Public Function GetEnumerator () As IDictionaryEnumerator

Návraty

Enumerátor pro iteraci přes stavový vak.

Implementuje

Příklady

Následující příklad ukazuje, jak použít metodu GetEnumerator .

// Create a StateBag object to contain the view state 
// associated with the custom control named myControl. Use the
// StateBag.GetEnumerator method to create an
// IDictionaryEnumerator named myDictionaryEnumerator.
ctlViewState1 ctlOne = new ctlViewState1();
StateBag myStateBag = new StateBag(); 
myStateBag = ctlOne.GetState();
IDictionaryEnumerator myDictionaryEnumerator = myStateBag.GetEnumerator();
' Create a StateBag object to contain the view state 
' associated with the custom control named myControl. Use the
' StateBag.GetEnumerator method to create an
' IDictionaryEnumerator named myDictionaryEnumerator.
Dim ctlOne As New ctlViewState1()
Dim myStateBag As New StateBag()
myStateBag = ctlOne.GetState()
Dim myDictionaryEnumerator As IDictionaryEnumerator = myStateBag.GetEnumerator()

Platí pro

Viz také