コード例 #1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null || !this.GetType().Equals(obj.GetType()))
            {
                return(false);
            }
            QuantityOperation length = (QuantityOperation)obj;

            return(Double.Equals(length.unit.ConvertedValue(length.value), this.unit.ConvertedValue(this.value)));
        }
コード例 #2
0
 /// <summary>
 /// Adds the length.
 /// </summary>
 /// <param name="that">The that.</param>
 /// <returns>It Perform Addition Operation and return the converted value</returns>
 public QuantityOperation AddLength(QuantityOperation that)
 {
     return(new QuantityOperation(UnitConvertor.INCH, this.unit.ConvertedValue(this.value) + that.unit.ConvertedValue(that.value)));
 }