Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            //return base.GetHashCode();
            if (AllowableDeviation.Value == 0)
            {
                return(this.Value.GetHashCode());
            }

            long longValue = (long)(this.ToMM().Value / AllowableDeviation.ToMM().Value);

            return(longValue.GetHashCode());
        }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (!(obj is Length))
            {
                return(false);
            }

            Length dest      = (Length)obj;
            double diffOfmm  = this.ToMM().Value - dest.ToMM().Value;
            double allowOfmm = AllowableDeviation.ToMM().Value;

            return(Math.Abs(diffOfmm) < allowOfmm);
        }