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 (MemberAttribute)

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

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

Parameters

attribute
An instance of MemberAttribute to compare with the attributes in this collection.

Return Value

true if the attribute is contained within the collection and has the same value as the attribute in the collection; otherwise, false.

Remarks

An attribute can provide support for matching.

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.

[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 | MemberAttributeCollection.Matches Overload List | MemberAttribute