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 개체입니다.

반환

개체가 동일하면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 두 개의 비교 DrawingAttributes 같음에 대 한 개체입니다. 때문에 합니다 Color, StylusTipHeight, 및 Width 속성을 attributes1attributes2 "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.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 메서드 같음에 대 한 사용자 지정 속성을 확인 하지 않습니다.

적용 대상

추가 정보