NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

PropertyDescriptorCollection.GetEnumerator

Gets an enumerator for this PropertyDescriptorCollection.

[Visual Basic]
Overridable Public Function GetEnumerator() As IEnumerator
[C#]
public virtual IEnumerator GetEnumerator();
[C++]
public: virtual IEnumerator* GetEnumerator();
[JScript]
public function GetEnumerator() : IEnumerator;

Return Value

An enumerator of type IEnumerator.

Example [Visual Basic]

The following example gets an enumerator for the events on Button1. It uses the enumerator to print the names of the events in the collection. It assumes that Button1 has been instantiated on a form.

[Visual Basic]

Private Sub MyEnumerator()
   Dim properties As PropertyDescriptorCollection
   properties = TypeDescriptor.GetProperties(Button1)

   ' Create an enumerator
   Dim ie As IEnumerator
   ie = properties.GetEnumerator

   ' Print the name of each property in the collecction.
   Dim myProperty As Object
   Do While ie.MoveNext = True
      myProperty = ie.Current
      TextBox1.Text &= " " & myProperty.ToString
   Loop
End Sub

See Also

PropertyDescriptorCollection Class | PropertyDescriptorCollection Members | System.ComponentModel Namespace | PropertyDescriptor | TypeDescriptor | IEnumerator