Rect.GetHashCode Rect.GetHashCode Rect.GetHashCode Rect.GetHashCode Method

Definizione

Crea un codice hash per il rettangolo.Creates a hash code for the rectangle.

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

Restituisce

Codice hash per la struttura Rect corrente.A hash code for the current Rect structure.

Esempi

Nell'esempio seguente viene illustrato come utilizzare il GetHashCode metodo per ottenere il codice hash di un Rect.The following example shows how to use the GetHashCode method to get the hash code of a 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;

}

Commenti

Questo metodo crea un codice hash usando la X, Y, Width, e Height i valori delle proprietà.This method creates a hash code by using the X, Y, Width, and Height property values.

Si applica a