DrawingAttributes.Equals(Object) 메서드

정의

지정된 DrawingAttributes 개체가 현재 DrawingAttributes 개체와 같은지 여부를 확인합니다.

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

매개 변수

o
Object

DrawingAttributes 현재 DrawingAttributes 개체와 비교할 개체입니다.

반품

개체가 같으면 이고, 그렇지 않으면 .

예제

다음 예제에서는 두 DrawingAttributes 개체가 같은지 비교합니다. Color, StylusTip, HeightWidth 속성 attributes1attributes2 이 동일한 값으로 설정되므로 "DrawingAttributes가 같음" 메시지가 나타납니다.

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

설명

다음 속성이 같으면 두 DrawingAttributes 개체가 같습니다.

메모

메서드는 Equals 사용자 지정 속성이 같은지 확인하지 않습니다.

적용 대상

추가 정보