예제 #1
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            MultiPolygon Other = (MultiPolygon)obj;

            return(this.Type == Other.Type &&
                   this.Coordinates.SequenceEqual(Other.Coordinates) &&
                   this.BoundingBox == Other.BoundingBox);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            MultiPolygon Other = (MultiPolygon)obj;

            bool BBoxEqual = true;

            if (this.BoundingBox != null && Other.BoundingBox != null)
            {
                BBoxEqual = this.BoundingBox.SequenceEqual(Other.BoundingBox);
            }
            else
            {
                BBoxEqual = (this.BoundingBox == null && Other.BoundingBox == null);
            }

            bool CoordinatesEqual = true;

            if (this.Coordinates != null && Other.Coordinates != null)
            {
                CoordinatesEqual = this.Coordinates.SequenceEqual(Other.Coordinates);
            }
            else
            {
                CoordinatesEqual = (this.Coordinates == null && Other.Coordinates == null);
            }

            return(this.Type == Other.Type &&
                   CoordinatesEqual &&
                   BBoxEqual);
        }