Rect.GetHashCode Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Crea un codice hash per il rettangolo.
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 corrente Rect .
Esempio
Nell'esempio seguente viene illustrato come usare il GetHashCode metodo per ottenere il codice hash di un oggetto 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 i valori della Xproprietà , YWidth, e Height .