Rectangle GetHashCode Method Delta Engine Documentation

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public override int GetHashCode()

Return Value

Type: Int32
Remarks

Tests: DeltaEngine.Tests.Datatypes.RectangleTests
Examples

1 unit tests call DeltaEngine.Datatypes.Rectangle.GetHashCode
[Test]
public void GetHashCodeViaDictionary()
{
    var rect1 = new Rectangle(3, 4, 1, 2);
    var rect2 = new Rectangle(5, 6, 1, 2);
    var rectValues = new Dictionary<Rectangle, int> { { rect1, 1 }, { rect2, 2 } };
    Assert.IsTrue(rectValues.ContainsKey(rect1));
    Assert.IsTrue(rectValues.ContainsKey(rect2));
    Assert.IsFalse(rectValues.ContainsKey(new Rectangle(3, 9, 1, 2)));
}
See Also