Exemplo n.º 1
0
        private BasicUnit(BasicUnit baseUnit, double toBaseUnitRatio)
        {
            if (baseUnit == null)
                throw new ArgumentNullException("baseUnit");

            baseUnit = this;
            toBaseUnit = (d) => d * toBaseUnitRatio;
            fromBaseUnit = (d) => d / toBaseUnitRatio;
        }
Exemplo n.º 2
0
        private BasicUnit(BasicUnit baseUnit, Func<double, double> toBaseUnit, Func<double, double> fromBaseUnit)
        {
            if (baseUnit == null)
                throw new ArgumentNullException("baseUnit");

            if (toBaseUnit == null)
                throw new ArgumentNullException("toBaseUnit");

            if (fromBaseUnit == null)
                throw new ArgumentNullException("fromBaseUnit");

            this.baseUnit = baseUnit;
            this.toBaseUnit = toBaseUnit;
            this.fromBaseUnit = fromBaseUnit;
        }
Exemplo n.º 3
0
 private BasicUnit()
 {
     toBaseUnit = (d) => d;
     fromBaseUnit = (d) => d;
     baseUnit = this;
 }