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;
An enumerator of type IEnumerator.
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
MemberAttributeCollection Class | MemberAttributeCollection Members | System.ComponentModel Namespace | MemberAttribute | IEnumerator