示例#1
0
        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));
        }
示例#2
0
 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));
 }
示例#4
0
 public bool Equals(Obj16Tile other)
 {
     return
         (TopLeft.Equals(other.TopLeft) &&
          TopRight.Equals(other.TopRight) &&
          BottomLeft.Equals(other.BottomLeft) &&
          BottomRight.Equals(other.BottomRight));
 }
示例#5
0
 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);
        }
示例#7
0
        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));
        }
示例#8
0
        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));
        }
示例#9
0
 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));
 }
示例#10
0
 public bool Equals(GridSegment other)
 {
     return(TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomLeft.Equals(other.BottomLeft) && BottomRight.Equals(other.BottomRight));
 }
示例#11
0
 public bool Equals(Rect2D other)
 {
     return(TopLeft.Equals(other.TopLeft) && Size.Equals(other.Size));
 }
示例#12
0
 bool Equals(CornerRadius other)
 {
     return(TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && BottomRight.Equals(other.BottomRight) && BottomLeft.Equals(other.BottomLeft));
 }
示例#13
0
 private bool Equals(Rect2D other)
 => TopLeft.Equals(other.TopLeft) && BottomRight.Equals(other.BottomRight);