Example #1
0
        ///<summary>
        /// Check if the current instance equals another instance of this class.
        ///</summary>
        ///<param name="obj">The instance to compare the current instance with.</param>
        ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            ElementSet s = (ElementSet)obj;

            if (Description == null && s.Description != null)
            {
                return(false);
            }
            if (Description != null && !Description.Equals(s.Description))
            {
                return(false);
            }
            if (!Caption.Equals(s.Caption))
            {
                return(false);
            }
            if (SpatialReferenceSystemWkt == null && s.SpatialReferenceSystemWkt != null)
            {
                return(false);
            }
            if (SpatialReferenceSystemWkt != null && !SpatialReferenceSystemWkt.Equals(s.SpatialReferenceSystemWkt))
            {
                return(false);
            }
            if (!ElementType.Equals(s.ElementType))
            {
                return(false);
            }
            if (ElementCount != s.ElementCount)
            {
                return(false);
            }
            for (int i = 0; i < ElementCount; i++)
            {
                if (!GetElement(i).Equals(s.GetElement(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
        ///<summary>
        /// Check if the current instance equals another instance of this class.
        ///</summary>
        ///<param name="obj">The instance to compare the current instance with.</param>
        ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns>
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            ElementSet s = (ElementSet)obj;

            if (!Description.Equals(s.Description))
            {
                return(false);
            }
            if (!ID.Equals(s.ID))
            {
                return(false);
            }
            if (!SpatialReference.Equals(s.SpatialReference))
            {
                return(false);
            }
            if (!ElementType.Equals(s.ElementType))
            {
                return(false);
            }
            if (ElementCount != s.ElementCount)
            {
                return(false);
            }
            for (int i = 0; i < ElementCount; i++)
            {
                if (!GetElement(i).Equals(s.GetElement(i)))
                {
                    return(false);
                }
            }
            return(true);
        }