예제 #1
0
 public double GetValue(IBxUnit unit)
 {
     if (unit.BaseUnitCate != Unit.BaseUnitCate)
     {
         throw new Exception("Unit Category is not Matching!");
     }
     return(Unit.EMConverTo(Value, unit));
 }
예제 #2
0
 public void ChangeUnit(IBxUnit unit)
 {
     if (Unit != null)
     {
         if (Unit.Category != unit.Category)
         {
             throw new Exception("can not switch unit between diffrent unit category!");
         }
         _value = Unit.EMConverTo(_value, unit);
         Unit   = unit;
     }
 }