Taal

DrawingAttributes.Equals(Object) Methode

Definitie

Bepaalt of het opgegeven DrawingAttributes object gelijk is aan het huidige DrawingAttributes object.

public:
 override bool Equals(System::Object ^ o);
public override bool Equals(object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

Parameters

o
Object

Het DrawingAttributes object dat moet worden vergeleken met het huidige DrawingAttributes object.

Retouren

true indien de objecten gelijk zijn; anders, false.

Voorbeelden

In het volgende voorbeeld worden twee DrawingAttributes objecten vergeleken voor gelijkheid. Omdat de Coloreigenschappen , StylusTipen Heighteigenschappen Width zijn ingeschakeld en attributes1attributes2 zijn ingesteld op dezelfde waarden, wordt het bericht 'The DrawingAttributes are equal' weergegeven.

DrawingAttributes attributes1 = new DrawingAttributes();
attributes1.Color = Colors.Blue;
attributes1.StylusTip = StylusTip.Rectangle;
attributes1.Height = 5;
attributes1.Width = 5;

DrawingAttributes attributes2 = new DrawingAttributes();
attributes2.Color = Colors.Blue;
attributes2.StylusTip = StylusTip.Rectangle;
attributes2.Height = 5;
attributes2.Width = 5;
Dim attributes1 As New DrawingAttributes()
attributes1.Color = Colors.Blue
attributes1.StylusTip = StylusTip.Rectangle
attributes1.Height = 5
attributes1.Width = 5

Dim attributes2 As New DrawingAttributes()
attributes2.Color = Colors.Blue
attributes2.StylusTip = StylusTip.Rectangle
attributes2.Height = 5
attributes2.Width = 5
if (attributes1.Equals(attributes2))
{
    MessageBox.Show("The DrawingAttributes are equal");
}
else
{
    MessageBox.Show("The DrawingAttributes are not equal");
}
If attributes1.Equals(attributes2) Then
    MessageBox.Show("The DrawingAttributes are equal")
Else
    MessageBox.Show("The DrawingAttributes are not equal")
End If

Opmerkingen

Twee DrawingAttributes objecten zijn gelijk als de volgende eigenschappen gelijk zijn:

Note

De Equals methode controleert de aangepaste eigenschappen niet op gelijkheid.

Van toepassing op

Zie ook