public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } if (obj == null || this.GetType() != obj.GetType()) { return(false); } GeometryCollection other = (GeometryCollection)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 geometriesEqual = true; if (this.Geometries != null && other.Geometries != null) { geometriesEqual = this.Geometries.SequenceEqual(other.Geometries); } else { geometriesEqual = (this.Geometries == null && other.Geometries == null); } return(this.Type == other.Type && geometriesEqual && bBoxEqual); }