public static CelsiusTemperature Parse(string value)
        {
            // generator : BasicUnitValuesGenerator.Add_Parse
            var parseResult = CommonParse.Parse(value, typeof(CelsiusTemperature));

            return(new CelsiusTemperature(parseResult.Value, new CelsiusTemperatureUnit(parseResult.UnitName)));
        }
Exemplo n.º 2
0
        public static Mass Parse(string value)
        {
            // generator : BasicUnitValuesGenerator.Add_Parse
            var parseResult = CommonParse.Parse(value, typeof(Mass));

            return(new Mass(parseResult.Value, new MassUnit(parseResult.UnitName)));
        }
Exemplo n.º 3
0
        public static Volume Parse(string value)
        {
            // generator : BasicUnitValuesGenerator.Add_Parse
            var parseResult = CommonParse.Parse(value, typeof(Volume));

            return(new Volume(parseResult.Value, new VolumeUnit(parseResult.UnitName)));
        }
Exemplo n.º 4
0
        public static Power Parse(string value)
        {
            // generator : BasicUnitValuesGenerator.Add_Parse
            var parseResult = CommonParse.Parse(value, typeof(Power));

            return(new Power(parseResult.Value, new PowerUnit(parseResult.UnitName)));
        }
Exemplo n.º 5
0
        public static Energy Parse(string value)
        {
            // generator : BasicUnitValuesGenerator.Add_Parse
            var parseResult = CommonParse.Parse(value, typeof(Energy));

            return(new Energy(parseResult.Value, new EnergyUnit(parseResult.UnitName)));
        }
Exemplo n.º 6
0
        public static Density Parse(string value)
        {
            // generator : FractionValuesGenerator.Add_Parse
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException(nameof(value));
            }
            var r     = CommonParse.Parse(value, typeof(Density));
            var units = Common.SplitUnitNameBySlash(r.UnitName);

            if (units.Length != 2)
            {
                throw new Exception($"{r.UnitName} is not valid Density unit");
            }
            var counterUnit     = new MassUnit(units[0]);
            var denominatorUnit = new VolumeUnit(units[1]);

            return(new Density(r.Value, counterUnit, denominatorUnit));
        }
        public static LinearPowerLoss Parse(string value)
        {
            // generator : FractionValuesGenerator.Add_Parse
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException(nameof(value));
            }
            var r     = CommonParse.Parse(value, typeof(LinearPowerLoss));
            var units = Common.SplitUnitNameBySlash(r.UnitName);

            if (units.Length != 2)
            {
                throw new Exception($"{r.UnitName} is not valid LinearPowerLoss unit");
            }
            var counterUnit     = new PowerUnit(units[0]);
            var denominatorUnit = new LengthUnit(units[1]);

            return(new LinearPowerLoss(r.Value, counterUnit, denominatorUnit));
        }
Exemplo n.º 8
0
        public static MassDetlaKelvin Parse(string value)
        {
            // generator : ProductValuesGenerator.Add_Parse
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException(nameof(value));
            }
            var r     = CommonParse.Parse(value, typeof(MassDetlaKelvin));
            var units = Common.SplitUnitNameByTimesSign(r.UnitName);

            if (units.Length != 2)
            {
                throw new Exception($"{r.UnitName} is not valid MassDetlaKelvin unit");
            }
            var counterUnit     = new MassUnit(units[0]);
            var denominatorUnit = new KelvinTemperatureUnit(units[1]);

            return(new MassDetlaKelvin(r.Value, counterUnit, denominatorUnit));
        }
Exemplo n.º 9
0
        public static Torque Parse(string value)
        {
            // generator : ProductValuesGenerator.Add_Parse
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException(nameof(value));
            }
            var r     = CommonParse.Parse(value, typeof(Torque));
            var units = Common.SplitUnitNameByTimesSign(r.UnitName);

            if (units.Length != 2)
            {
                throw new Exception($"{r.UnitName} is not valid Torque unit");
            }
            var counterUnit     = new ForceUnit(units[0]);
            var denominatorUnit = new LengthUnit(units[1]);

            return(new Torque(r.Value, counterUnit, denominatorUnit));
        }