Exemplo n.º 1
0
        /// <summary></summary>
        public int CompareTo(object obj)
        {
            if (!(obj is TDrawingRelativeRect))
            {
                return(-1);
            }
            TDrawingRelativeRect s2 = (TDrawingRelativeRect)obj;
            int r;

            r = FLeft.CompareTo(s2.FLeft); if (r != 0)
            {
                return(r);
            }
            r = FTop.CompareTo(s2.FTop); if (r != 0)
            {
                return(r);
            }
            r = FRight.CompareTo(s2.FRight); if (r != 0)
            {
                return(r);
            }
            r = FBottom.CompareTo(s2.FBottom); if (r != 0)
            {
                return(r);
            }
            return(0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if both classes contain the same rectangle.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (!(obj is TDrawingRelativeRect))
            {
                return(false);
            }
            TDrawingRelativeRect o2 = (TDrawingRelativeRect)obj;

            if (FTop != o2.FTop)
            {
                return(false);
            }
            if (FLeft != o2.FLeft)
            {
                return(false);
            }
            if (FBottom != o2.FBottom)
            {
                return(false);
            }
            if (FRight != o2.FRight)
            {
                return(false);
            }
            return(true);
        }