コード例 #1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            QuantityUnits units = (QuantityUnits)obj;

            if (units.quanity < 0)
            {
                throw new QunaityMeasurementException(QunaityMeasurementException.ExceptionType.INVALID_VALUE, "provided value is invalid");
            }
            return(this.quanity == units.quanity);
        }
コード例 #2
0
 public bool EqualityCheck(QuantityUnits firstQuantity, QuantityUnits secondQuantity)
 {
     return(firstQuantity.Equals(secondQuantity));
 }
コード例 #3
0
 public double AddQuntities(QuantityUnits firstElement, QuantityUnits secondElement)
 {
     return(firstElement.AddQuantity(secondElement));
 }
コード例 #4
0
 public double AddQuantity(QuantityUnits quantityUnits)
 {
     return(quantityUnits.quanity + this.quanity);
 }