コード例 #1
0
        private bool ValueEquals(ShapeCollection other)
        {
            var iter = other.GetEnumerator();

            foreach (IShape value in this)
            {
                iter.MoveNext();
                if (!value.Equals(iter.Current))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
        public override bool Equals(object o)
        {
            // Spatial4n NOTE: This was modified from the original implementation
            // to act like the collections of Java, which compare values rather than references.
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }

            ShapeCollection that = (ShapeCollection)o;

            if (!ValueEquals(that))
            {
                return(false);
            }

            return(true);
        }