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 the attributes in the specified array are the same as the attributes in the collection.

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

Parameters

attributes
An array of MemberAttributes to compare with the attributes in this collection.

Return Value

true if all the attributes in the array are contained in the collection and have the same values as the attributes in the collection; otherwise, false.

Remarks

An attribute can provide support for matching.

Example [Visual Basic]

The following example compares the attributes in two buttons. It assumes that both buttons have been instantiated on a form.

[Visual Basic]

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

   'Create a new collection and assign it the attributes for TextBox1.
   Dim collection2 As MemberAttributeCollection
   collection2 = TypeDescriptor.GetAttributes(TextBox1)

   'Check to see if the attributes in collection1 are contained in collection2.
   If collection1.Matches(collection2.All) Then
      TextBox1.Text = "The attributes in the button and the text box match"
   Else
      TextBox1.Text = "The attributes in the button and the text box do not match"
   End If
End Sub

See Also

MemberAttributeCollection Class | MemberAttributeCollection Members | System.ComponentModel Namespace | MemberAttributeCollection.Matches Overload List | MemberAttribute