DrawingAttributes.Equality(DrawingAttributes, DrawingAttributes) Operator
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Avgör om de angivna DrawingAttributes objekten är lika med.
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
Parametrar
- first
- DrawingAttributes
Det första DrawingAttributes objektet som ska jämföras.
- second
- DrawingAttributes
Det andra DrawingAttributes objektet att jämföra.
Returer
trueom objekten är lika; annars . false
Exempel
I följande exempel jämförs två DrawingAttributes objekt för likhet.
ColorEftersom egenskaperna , StylusTip, Heightoch Width på och attributes1 är inställda på attributes2 samma värden visas meddelandet "DrawingAttributes are equal".
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
Kommentarer
Två DrawingAttributes objekt är lika med om följande egenskaper är lika med:
Note
Metoden Equality kontrollerar inte de anpassade egenskaperna för likhet.
Motsvarande metod för den här operatorn är DrawingAttributes.Equals.