StateBag.GetEnumerator Método

Definición

Devuelve un enumerador que recorre en iteración los pares de clave/valor de los objetos StateItem almacenados en el objeto 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

Devoluciones

IDictionaryEnumerator

Enumerador que se va a utilizar para recorrer en iteración la bolsa de estados.

Implementaciones

Ejemplos

En el siguiente ejemplo se muestra cómo se utiliza el método 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()

Se aplica a

Consulte también