Bewerken

Share via


DrawingAttributes.Equality(DrawingAttributes, DrawingAttributes) Operator

Definition

Determines whether the specified DrawingAttributes objects are equal.

public:
 static bool operator ==(System::Windows::Ink::DrawingAttributes ^ first, System::Windows::Ink::DrawingAttributes ^ second);
public static bool operator == (System.Windows.Ink.DrawingAttributes first, System.Windows.Ink.DrawingAttributes second);
static member ( = ) : System.Windows.Ink.DrawingAttributes * System.Windows.Ink.DrawingAttributes -> bool
Public Shared Operator == (first As DrawingAttributes, second As DrawingAttributes) As Boolean

Parameters

first
DrawingAttributes

The first DrawingAttributes object to compare.

second
DrawingAttributes

The second DrawingAttributes object to compare.

Returns

true if the objects are equal; otherwise, false.

Examples

The following example compares two DrawingAttributes objects for equality. Because the Color, StylusTip, Height, and Width properties on attributes1 and attributes2 are set to the same values, the "The DrawingAttributes are equal" message appears.

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 == attributes2)
{
    MessageBox.Show("The DrawingAttributes are equal");
}
else
{
    MessageBox.Show("The DrawingAttributes are not equal");
}
If attributes1 = attributes2 Then
    MessageBox.Show("The DrawingAttributes are equal")
Else
    MessageBox.Show("The DrawingAttributes are not equal")
End If

Remarks

Two DrawingAttributes objects are equal if the following properties are equal:

Note

The Equality method does not check the custom properties for equality.

The equivalent method for this operator is DrawingAttributes.Equals.

Applies to