Rect.Equals 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
두 사각형이 같은지 여부를 나타냅니다.
오버로드
| Name | Description |
|---|---|
| Equals(Rect, Rect) |
지정된 사각형이 같은지 여부를 나타냅니다. |
| Equals(Object) |
지정된 개체가 현재 사각형과 같은지 여부를 나타냅니다. |
| Equals(Rect) |
지정된 사각형이 현재 사각형과 같은지 여부를 나타냅니다. |
Equals(Rect, Rect)
지정된 사각형이 같은지 여부를 나타냅니다.
public:
static bool Equals(System::Windows::Rect rect1, System::Windows::Rect rect2);
public static bool Equals(System.Windows.Rect rect1, System.Windows.Rect rect2);
static member Equals : System.Windows.Rect * System.Windows.Rect -> bool
Public Shared Function Equals (rect1 As Rect, rect2 As Rect) As Boolean
매개 변수
- rect1
- Rect
비교할 첫 번째 사각형입니다.
- rect2
- Rect
비교할 두 번째 사각형입니다.
반품
true 사각형의 값과 값이 같 Location 으면 이고 Size , false그렇지 않으면 .
예제
다음 예제에서는 메서드를 사용하여 Equals(Rect, Rect) 사각형이 다른 사각형과 같은지 확인하는 방법을 보여 있습니다.
private bool rectEqualsExample2()
{
// Create a rectangle.
Rect myRectangle1 = new Rect();
// The Location property specifies the coordinates of the upper left-hand
// corner of the rectangle.
myRectangle1.Location = new Point(10, 5);
// Set the Size property of the rectangle with a width of 200
// and a height of 50.
myRectangle1.Size = new Size(200, 50);
// Create second rectangle to compare to the first.
Rect myRectangle2 = new Rect();
myRectangle2.Location = new Point(10, 5);
myRectangle2.Size = new Size(200, 50);
// Using the Equals method, see if the second rectangle is
// the same as the first rectangle. doesEqual is true because
// both rectangles are exactly the same in that they both have the
// same location and size.
bool doesEqual = Rect.Equals(myRectangle1, myRectangle2);
return doesEqual;
}
설명
이 작업은 개체 같음을 테스트합니다.
이 비교에서 두 인스턴스는 Double.NaN 같은 것으로 간주됩니다.
추가 정보
적용 대상
Equals(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
매개 변수
- o
- Object
현재 사각형과 비교할 개체입니다.
반품
예제
다음 예제에서는 메서드를 사용 하 여 Equals(Object) 사각형이 지정 된 개체와 같은지 확인 하는 방법을 보여 집니다.
private bool rectEqualsExample1()
{
// Create a rectangle.
Rect myRectangle1 = new Rect();
// The Location property specifies the coordinates of the upper left-hand
// corner of the rectangle.
myRectangle1.Location = new Point(10, 5);
// Set the Size property of the rectangle with a width of 200
// and a height of 50.
myRectangle1.Size = new Size(200, 50);
// Create second rectangle to compare to the first.
Rect myRectangle2 = new Rect();
myRectangle2.Location = new Point(10, 5);
myRectangle2.Size = new Size(200, 50);
// Using the Equals method, see if the second rectangle is the
// same as the first rectangle. doesEqual is true because both
// rectangles are exactly the same with respect to location and size.
bool doesEqual = myRectangle1.Equals(myRectangle2);
return doesEqual;
}
설명
이 작업은 개체 같음을 테스트합니다.
이 비교에서 두 인스턴스는 Double.NaN 같은 것으로 간주됩니다.
추가 정보
적용 대상
Equals(Rect)
지정된 사각형이 현재 사각형과 같은지 여부를 나타냅니다.
public:
bool Equals(System::Windows::Rect value);
public bool Equals(System.Windows.Rect value);
override this.Equals : System.Windows.Rect -> bool
Public Function Equals (value As Rect) As Boolean
매개 변수
- value
- Rect
현재 사각형과 비교할 사각형입니다.
반품
true 지정된 사각형의 값이 현재 사각형과 같 Location 으면 이고 Size , false그렇지 않으면 .
예제
다음 예제에서는 메서드를 사용하여 사각형이 Equals(Rect) 지정된 사각형과 같은지 확인하는 방법을 보여줍니다.
private bool rectEqualsExample1()
{
// Create a rectangle.
Rect myRectangle1 = new Rect();
// The Location property specifies the coordinates of the upper left-hand
// corner of the rectangle.
myRectangle1.Location = new Point(10, 5);
// Set the Size property of the rectangle with a width of 200
// and a height of 50.
myRectangle1.Size = new Size(200, 50);
// Create second rectangle to compare to the first.
Rect myRectangle2 = new Rect();
myRectangle2.Location = new Point(10, 5);
myRectangle2.Size = new Size(200, 50);
// Using the Equals method, see if the second rectangle is the
// same as the first rectangle. doesEqual is true because both
// rectangles are exactly the same with respect to location and size.
bool doesEqual = myRectangle1.Equals(myRectangle2);
return doesEqual;
}
설명
이 작업은 개체 같음을 테스트합니다.
이 비교에서 두 인스턴스는 Double.NaN 같은 것으로 간주됩니다.