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.Count

Gets the number of attributes.

[Visual Basic]
Public ReadOnly Property Count As Integer
[C#]
public int Count {get;}
[C++]
public: __property int get_Count();
[JScript]
public function get Count() : int;

Property Value

The number of attributes.

Remarks

The Count property can be used to set the limits of a loop that iterates through a collection of objects. If the collection is zero-based, be sure to use "Count- 1" as the upper bound of the loop.

Example [Visual Basic]

The following example uses the Count property to print the number of properties on Button1. It assumes that Button1 has been instantianted on a form.

[Visual Basic]

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

   'Print the number of attributes attached to Button1 in a text box.
   TextBox1.Text = attributes.Count.ToString
End Sub

See Also

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