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

Determines if a specified attribute or array of attributes is the same as an attribute or array of attributes in the collection.

Overload List

Determines if the attributes in the specified array are the same as the attributes in the collection.

[Visual Basic] Overloads Public Function Matches(MemberAttribute()) As Boolean
[C#] public bool Matches(MemberAttribute[]);
[C++] public: bool Matches(MemberAttribute*[]);
[JScript] public function Matches(MemberAttribute[]) : Boolean;

Determines if a specified attribute is the same as an attribute in the collection.

[Visual Basic] Overloads Public Function Matches(MemberAttribute) As Boolean
[C#] public bool Matches(MemberAttribute);
[C++] public: bool Matches(MemberAttribute*);
[JScript] public function Matches(MemberAttribute) : Boolean;

Example [Visual Basic]

The following example verifies that the BrowsableAttribute is a member of the collection and that it has been set to true. It assumes that Button1 has been instantiated on a form.

Note   This example shows how to use one of the overloaded versions of Matches. For other examples that may be available, see the individual overload topics.

[Visual Basic]

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

   'Check to see if the browsable attribute is true.
   If attributes.Matches(BrowsableAttribute.Yes) Then
      TextBox1.Text = "Button1 is browsable"
   Else
      TextBox1.Text = "Button1 is not browsable"
   End If
End Sub

See Also

MemberAttributeCollection Class | MemberAttributeCollection Members | System.ComponentModel Namespace