Exemplo n.º 1
0
        public bool Equals(TwoDPoint p)
        {
            // If parameter is null return false:
            if ((object)p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return((x == p.x) && (y == p.y));
        }
Exemplo n.º 2
0
        public override bool Equals(Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            TwoDPoint p = obj as TwoDPoint;

            if ((Object)p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return((x == p.x) && (y == p.y));
        }