StateBag.GetEnumerator Metoda

Definicja

Zwraca moduł wyliczający, który iteruje wszystkie pary StateItem klucz/wartość obiektów przechowywanych w StateBag obiekcie.

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

Zwraca

Moduł wyliczający iteruje przez torbę stanu.

Implementuje

Przykłady

W poniższym przykładzie pokazano, jak używać GetEnumerator metody .

// 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()

Dotyczy

Zobacz też