Beispiel #1
0
        /// <summary>
        /// Indicates whether this instance and a specified object are equal.
        /// </summary>
        /// <param name="obj">Another object to compare to.</param>
        /// <returns><c>true</c> if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, <c>false</c>.
        /// </returns>
        public override Boolean Equals(Object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            return((obj is Length) && BaseValue.Equals(((Length)obj).BaseValue));
        }
Beispiel #2
0
        /// <summary>
        /// Indicates whether this instance and a specified <see cref="Length" /> are equal.
        /// </summary>
        /// <param name="another">Another length to compare to.</param>
        /// <returns><c>true</c> if <paramref name="another" /> and this instance represent the same value; otherwise, <c>false</c>.</returns>
        public Boolean Equals(Length another)
        {
            if (ReferenceEquals(null, another))
            {
                return(false);
            }
            if (ReferenceEquals(this, another))
            {
                return(true);
            }

            return(BaseValue.Equals(another.BaseValue));
        }