Rect.GetHashCode Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Cria um código de hash para o retângulo.
public:
override int GetHashCode();
public override int GetHashCode();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer
Devoluções
Um código de hash para a estrutura atual Rect .
Exemplos
O exemplo seguinte mostra como usar o GetHashCode método para obter o código de hash de um 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;
}
Observações
Este método cria um código de hash usando os Xvalores de , Y, Width, e Height propriedades.