public override bool Equals(Object obj) // <-- overrides Object.Equals { /** * You can use the AS operator to perform certain types of conversions * between compatible reference types or nullable types. * * Preferably, use IS for bool expressions: <expr> is <type>. * * IS checks if an object is compatible with a given type, or * (starting with C# 7.0) tests an expression against a pattern. * * Example: * if (obj is Person) { * // Do something if obj is a Person. * } */ var rect = obj as Rectangle; if (rect == null) { return(false); } return(TopLeft.Equals(rect.TopLeft) && // <-- uses Point.Equals and double.Equals Height.Equals(rect.Height) && Width.Equals(rect.Width)); }
public bool Equals(LatLngQuad other) { return(TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight)); }
public bool Equals(GeoBoundingBox other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } return(TopLeft.Equals(other.TopLeft) && BottomRight.Equals(other.BottomRight)); }
public bool Equals(Obj16Tile other) { return (TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight)); }
public bool Equals(Region other) { if (other == null) { return(false); } return(TopLeft.Equals(other.TopLeft) && BottomRight.Equals(other.BottomRight)); }
public override bool Equals(object obj) { var input = obj as Rectangle; if (input == null) { return(false); } return(TopLeft.Equals(input.TopLeft) && Width == input.Width && Height == input.Height); }
public override bool Equals(Object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } Points pointsObj = obj as Points; return(TopLeft.Equals(pointsObj.TopLeft) && BottomRight.Equals(pointsObj.BottomRight)); }
public override bool Equals(object obj) { Rectangle other = obj as Rectangle; if (other == null) { return(false); } return(TopLeft.Equals(other.TopLeft) && BottomRight.Equals(other.BottomRight)); }
public bool Equals(FourCorners <TValue> other) { if (this == other) { return(true); } if (other == null) { return(false); } return(BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight) && TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight)); }
public bool Equals(GridSegment other) { return(TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight)); }
public bool Equals(Rect2D other) { return(TopLeft.Equals(other.TopLeft) && Size.Equals(other.Size)); }
bool Equals(CornerRadius other) { return(TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomRight.Equals(other.BottomRight) && BottomLeft.Equals(other.BottomLeft)); }
private bool Equals(Rect2D other) => TopLeft.Equals(other.TopLeft) && BottomRight.Equals(other.BottomRight);