Rect.GetHashCode 메서드

정의

사각형에 대한 해시 코드를 만듭니다.

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

반환

Int32

현재 Rect 구조체의 해시 코드입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 GetHashCode 의 해시 코드를 가져오는 메서드를 Rect입니다.

private int getHashCodeExample()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);
    
    // Get the hashcode of the rectangle.
    int returnHashCode = myRectangle.GetHashCode();

    return returnHashCode;
}

설명

이 메서드를 사용 하 여 해시 코드를 만듭니다는 X, YWidth, 및 Height 속성 값입니다.

적용 대상