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!

MemberAttributeCollection.GetEnumerator

Gets an enumerator for this collection.

[Visual Basic]
Public Function GetEnumerator() As IEnumerator
[C#]
public IEnumerator GetEnumerator();
[C++]
public: 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 attributes on Button1. It uses the enumerator to print the names of the attributes in the collection. It assumes that Button1 has been instantiated on a form.

[Visual Basic]

Private Sub MyEnumerator()
   'Create a new collection and assign it the attributes for Button1.
   Dim attributes As MemberAttributeCollection
   attributes = TypeDescriptor.GetAttributes(Button1)

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

   'Print the type of each attribute in the collection.
   Dim myAttribute As Object
   Do While ie.MoveNext = True
      myAttribute = ie.Current
      TextBox1.Text &= myAttribute.ToString & " "
   Loop
End Sub

See Also

MemberAttributeCollection Class | MemberAttributeCollection Members | System.ComponentModel Namespace | MemberAttribute | IEnumerator