From 387565ace3af3ed6a598c745b5d00afa4c05716f Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Fri, 1 Mar 2019 15:32:43 -0500 Subject: [PATCH 01/12] Adding As/ToUnit conversions to UnitSystem --- UnitsNet.Tests/CustomCode/AreaTests.cs | 14 ++++++++ UnitsNet.Tests/CustomCode/EnergyTests.cs | 14 ++++++++ UnitsNet.Tests/CustomCode/LengthTests.cs | 14 ++++++++ UnitsNet.Tests/IQuantityTests.cs | 28 +++++++++++++++ .../Quantities/Acceleration.NetFramework.g.cs | 34 +++++++++++++++++++ .../AmountOfSubstance.NetFramework.g.cs | 34 +++++++++++++++++++ .../AmplitudeRatio.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Angle.NetFramework.g.cs | 34 +++++++++++++++++++ .../ApparentEnergy.NetFramework.g.cs | 34 +++++++++++++++++++ .../ApparentPower.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Area.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/AreaDensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../AreaMomentOfInertia.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/BitRate.NetFramework.g.cs | 34 +++++++++++++++++++ ...eSpecificFuelConsumption.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Capacitance.NetFramework.g.cs | 34 +++++++++++++++++++ ...icientOfThermalExpansion.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Density.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Duration.NetFramework.g.cs | 34 +++++++++++++++++++ .../DynamicViscosity.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricAdmittance.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricCharge.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricChargeDensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricConductance.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricConductivity.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricCurrent.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricCurrentDensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricCurrentGradient.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricField.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricInductance.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricPotential.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricPotentialAc.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricPotentialDc.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricResistance.NetFramework.g.cs | 34 +++++++++++++++++++ .../ElectricResistivity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Energy.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Entropy.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Force.NetFramework.g.cs | 34 +++++++++++++++++++ .../ForceChangeRate.NetFramework.g.cs | 34 +++++++++++++++++++ .../ForcePerLength.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Frequency.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/HeatFlux.NetFramework.g.cs | 34 +++++++++++++++++++ .../HeatTransferCoefficient.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Illuminance.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Information.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Irradiance.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Irradiation.NetFramework.g.cs | 34 +++++++++++++++++++ .../KinematicViscosity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/LapseRate.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Length.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Level.NetFramework.g.cs | 34 +++++++++++++++++++ .../LinearDensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/LuminousFlux.NetFramework.g.cs | 34 +++++++++++++++++++ .../LuminousIntensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../MagneticField.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MagneticFlux.NetFramework.g.cs | 34 +++++++++++++++++++ .../Magnetization.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Mass.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MassFlow.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MassFlux.NetFramework.g.cs | 34 +++++++++++++++++++ .../MassMomentOfInertia.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MolarEnergy.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MolarEntropy.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/MolarMass.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Molarity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Permeability.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Permittivity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Power.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/PowerDensity.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/PowerRatio.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Pressure.NetFramework.g.cs | 34 +++++++++++++++++++ .../PressureChangeRate.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Ratio.NetFramework.g.cs | 34 +++++++++++++++++++ .../ReactiveEnergy.NetFramework.g.cs | 34 +++++++++++++++++++ .../ReactivePower.NetFramework.g.cs | 34 +++++++++++++++++++ .../RotationalAcceleration.NetFramework.g.cs | 34 +++++++++++++++++++ .../RotationalSpeed.NetFramework.g.cs | 34 +++++++++++++++++++ .../RotationalStiffness.NetFramework.g.cs | 34 +++++++++++++++++++ ...tionalStiffnessPerLength.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/SolidAngle.NetFramework.g.cs | 34 +++++++++++++++++++ .../SpecificEnergy.NetFramework.g.cs | 34 +++++++++++++++++++ .../SpecificEntropy.NetFramework.g.cs | 34 +++++++++++++++++++ .../SpecificVolume.NetFramework.g.cs | 34 +++++++++++++++++++ .../SpecificWeight.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Speed.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Temperature.NetFramework.g.cs | 34 +++++++++++++++++++ .../TemperatureChangeRate.NetFramework.g.cs | 34 +++++++++++++++++++ .../TemperatureDelta.NetFramework.g.cs | 34 +++++++++++++++++++ .../ThermalConductivity.NetFramework.g.cs | 34 +++++++++++++++++++ .../ThermalResistance.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Torque.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/VitaminA.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/Volume.NetFramework.g.cs | 34 +++++++++++++++++++ .../Quantities/VolumeFlow.NetFramework.g.cs | 34 +++++++++++++++++++ UnitsNet/IQuantity.cs | 21 ++++++++++++ .../Include-GenerateQuantitySourceCode.ps1 | 34 +++++++++++++++++++ 96 files changed, 3185 insertions(+) diff --git a/UnitsNet.Tests/CustomCode/AreaTests.cs b/UnitsNet.Tests/CustomCode/AreaTests.cs index b3db19ebca..f25432fb4b 100644 --- a/UnitsNet.Tests/CustomCode/AreaTests.cs +++ b/UnitsNet.Tests/CustomCode/AreaTests.cs @@ -90,5 +90,19 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() var area = new Area(1.0, UnitSystem.SI); Assert.Equal(AreaUnit.SquareMeter, area.Unit); } + + [Fact] + public void As_ImperialGivenSIUnitSysten_ReturnsSIValue() + { + var imperialArea = new Area(2.0, AreaUnit.SquareInch); + Assert.Equal(0.00129032, imperialArea.As(UnitSystem.SI)); + } + + [Fact] + public void ToUnit_ImperialGivenSIUnitSysten_ReturnsSIValue() + { + var imperialArea = new Area(2.0, AreaUnit.SquareInch); + Assert.Equal(Area.FromSquareMeters(0.00129032), imperialArea.ToUnit(UnitSystem.SI)); + } } } diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs index 8a8a420437..9d01b60df5 100644 --- a/UnitsNet.Tests/CustomCode/EnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs @@ -60,5 +60,19 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() var energy = new Energy(1.0, UnitSystem.SI); Assert.Equal(EnergyUnit.Joule, energy.Unit); } + + [Fact] + public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); + Assert.Equal(2110.11170524, imperialEnergy.As(UnitSystem.SI)); + } + + [Fact] + public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); + Assert.Equal(Energy.FromJoules(2110.11170524), imperialEnergy.ToUnit(UnitSystem.SI)); + } } } diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index 0634c931f4..6a348eb41e 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -165,5 +165,19 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() var length = new Length(1.0, UnitSystem.SI); Assert.Equal(LengthUnit.Meter, length.Unit); } + + [Fact] + public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + var imperialLength = new Length(2.0, LengthUnit.Inch); + Assert.Equal(0.0508, imperialLength.As(UnitSystem.SI)); + } + + [Fact] + public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + var imperialLength = new Length(2.0, LengthUnit.Inch); + Assert.Equal(Length.FromMeters(0.0508), imperialLength.ToUnit(UnitSystem.SI)); + } } } diff --git a/UnitsNet.Tests/IQuantityTests.cs b/UnitsNet.Tests/IQuantityTests.cs index 1e2a91d1d6..56dcefd8f2 100644 --- a/UnitsNet.Tests/IQuantityTests.cs +++ b/UnitsNet.Tests/IQuantityTests.cs @@ -16,11 +16,39 @@ public void As_GivenWrongUnitType_ThrowsArgumentException() Assert.Throws(() => length.As(MassUnit.Kilogram)); } + [Fact] + public void As_GivenNullUnitSystem_ThrowsArgumentNullException() + { + IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); + Assert.Throws(() => imperialLengthQuantity.As((UnitSystem)null)); + } + + [Fact] + public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); + Assert.Equal(0.0508, imperialLengthQuantity.As(UnitSystem.SI)); + } + [Fact] public void ToUnit_GivenWrongUnitType_ThrowsArgumentException() { IQuantity length = Length.FromMeters(1.2345); Assert.Throws(() => length.ToUnit(MassUnit.Kilogram)); } + + [Fact] + public void ToUnit_GivenNullUnitSystem_ThrowsArgumentNullException() + { + IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); + Assert.Throws(() => imperialLengthQuantity.ToUnit((UnitSystem)null)); + } + + [Fact] + public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + { + IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); + Assert.Equal(Length.FromMeters(0.0508), imperialLengthQuantity.ToUnit(UnitSystem.SI)); + } } } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 8b2f9bfaae..58b218383e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -736,6 +736,20 @@ public double As(AccelerationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -764,9 +778,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAccelerationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Acceleration ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AccelerationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 66aa015af7..c816a78e6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -766,6 +766,20 @@ public double As(AmountOfSubstanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -794,9 +808,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAmountOfSubstanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public AmountOfSubstance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AmountOfSubstanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 7059ba51b2..d2aaffb6fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -609,6 +609,20 @@ public double As(AmplitudeRatioUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -637,9 +651,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAmplitudeRatioUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public AmplitudeRatio ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AmplitudeRatioUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 398e3d23c2..2ed4d8cef0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -751,6 +751,20 @@ public double As(AngleUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -779,9 +793,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAngleUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Angle ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AngleUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index adb531a510..702de02ea3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(ApparentEnergyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsApparentEnergyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ApparentEnergy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ApparentEnergyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 7a2e29efa3..50cc2fee4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -601,6 +601,20 @@ public double As(ApparentPowerUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -629,9 +643,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsApparentPowerUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ApparentPower ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ApparentPowerUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 1454a3bb36..c10d70ffea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -736,6 +736,20 @@ public double As(AreaUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -764,9 +778,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Area ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AreaUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 5bb00408a8..130c6d2727 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -556,6 +556,20 @@ public double As(AreaDensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -584,9 +598,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public AreaDensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AreaDensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 45299eddf3..cb01954b4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -631,6 +631,20 @@ public double As(AreaMomentOfInertiaUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -659,9 +673,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaMomentOfInertiaUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public AreaMomentOfInertia ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(AreaMomentOfInertiaUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 4d99ce759e..1e963366ca 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -936,6 +936,20 @@ public double As(BitRateUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -964,9 +978,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsBitRateUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public BitRate ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(BitRateUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 2015220a4f..e91ef5c89f 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(BrakeSpecificFuelConsumptionUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsBrakeSpecificFuelConsumptionUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public BrakeSpecificFuelConsumption ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(BrakeSpecificFuelConsumptionUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index f6011d3287..debc4862bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -649,6 +649,20 @@ public double As(CapacitanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -677,9 +691,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsCapacitanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Capacitance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(CapacitanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 6fe65d47f4..16006ecfbc 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(CoefficientOfThermalExpansionUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsCoefficientOfThermalExpansionUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public CoefficientOfThermalExpansion ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(CoefficientOfThermalExpansionUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 0a1280a34a..7453312c9d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1129,6 +1129,20 @@ public double As(DensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1157,9 +1171,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Density ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(DensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index b506281ae5..14b38d8d82 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -691,6 +691,20 @@ public double As(DurationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -719,9 +733,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDurationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Duration ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(DurationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 8a56deb711..cec9412234 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -634,6 +634,20 @@ public double As(DynamicViscosityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -662,9 +676,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDynamicViscosityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public DynamicViscosity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(DynamicViscosityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 74808cb923..050a35fd8d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -601,6 +601,20 @@ public double As(ElectricAdmittanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -629,9 +643,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricAdmittanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricAdmittance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricAdmittanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index f5ab761e53..f6b9be4eff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(ElectricChargeUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricChargeUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricCharge ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricChargeUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 914c6e26f9..a2b152b45b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(ElectricChargeDensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricChargeDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricChargeDensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricChargeDensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index a6012068ec..132bd0fe7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -589,6 +589,20 @@ public double As(ElectricConductanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -617,9 +631,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricConductanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricConductance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricConductanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 97cd39356e..d7ff414251 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(ElectricConductivityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricConductivityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricConductivity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricConductivityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index ed9e0197f4..f30347eabd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -661,6 +661,20 @@ public double As(ElectricCurrentUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -689,9 +703,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricCurrent ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricCurrentUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 5472043c7e..0af158cfaf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(ElectricCurrentDensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricCurrentDensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricCurrentDensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 661610d895..acd50395f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -556,6 +556,20 @@ public double As(ElectricCurrentGradientUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -584,9 +598,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentGradientUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricCurrentGradient ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricCurrentGradientUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 2e2105a832..9dd45a10e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(ElectricFieldUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricFieldUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricField ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricFieldUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 5648d72c8e..becd2bc26e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -604,6 +604,20 @@ public double As(ElectricInductanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -632,9 +646,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricInductanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricInductance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricInductanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 3b9ca20b53..280ef3ce96 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -616,6 +616,20 @@ public double As(ElectricPotentialUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -644,9 +658,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricPotential ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricPotentialUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index c8642e5aa7..598c91a161 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -616,6 +616,20 @@ public double As(ElectricPotentialAcUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -644,9 +658,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialAcUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricPotentialAc ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricPotentialAcUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 539e0294f4..82e326742a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -616,6 +616,20 @@ public double As(ElectricPotentialDcUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -644,9 +658,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialDcUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricPotentialDc ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricPotentialDcUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index fa2f71b8d9..60b75e35f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -616,6 +616,20 @@ public double As(ElectricResistanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -644,9 +658,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricResistanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricResistance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricResistanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 819a37ed64..57767a31bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -754,6 +754,20 @@ public double As(ElectricResistivityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -782,9 +796,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricResistivityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ElectricResistivity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ElectricResistivityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index cc9ff73c65..7fa3270f4b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -886,6 +886,20 @@ public double As(EnergyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -914,9 +928,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsEnergyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Energy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(EnergyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index b0feaa1471..69e3e795a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -646,6 +646,20 @@ public double As(EntropyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -674,9 +688,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsEntropyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Entropy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(EntropyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 0e156e1e6f..b22354188c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -736,6 +736,20 @@ public double As(ForceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -764,9 +778,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Force ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ForceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 5f94b3b775..bf88850e84 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -706,6 +706,20 @@ public double As(ForceChangeRateUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -734,9 +748,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForceChangeRateUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ForceChangeRate ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ForceChangeRateUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 5ce7908585..a41d0452f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -676,6 +676,20 @@ public double As(ForcePerLengthUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -704,9 +718,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForcePerLengthUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ForcePerLength ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ForcePerLengthUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 4c3af49c64..dc8e8824b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -676,6 +676,20 @@ public double As(FrequencyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -704,9 +718,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsFrequencyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Frequency ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(FrequencyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 4ea7b3d4ec..7e042f5b0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -811,6 +811,20 @@ public double As(HeatFluxUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -839,9 +853,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsHeatFluxUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public HeatFlux ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(HeatFluxUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 455e206e6a..470afa0e21 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -571,6 +571,20 @@ public double As(HeatTransferCoefficientUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -599,9 +613,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsHeatTransferCoefficientUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public HeatTransferCoefficient ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(HeatTransferCoefficientUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 03068209cf..3ae886b897 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -604,6 +604,20 @@ public double As(IlluminanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -632,9 +646,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIlluminanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Illuminance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(IlluminanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 6f24d02884..b5675c8f0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -933,6 +933,20 @@ public double As(InformationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -961,9 +975,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsInformationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Information ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(InformationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index fbbb279d7b..77b95d4a7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -751,6 +751,20 @@ public double As(IrradianceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -779,9 +793,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIrradianceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Irradiance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(IrradianceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 11bc89d2f6..599f974592 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -634,6 +634,20 @@ public double As(IrradiationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -662,9 +676,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIrradiationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Irradiation ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(IrradiationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index eb76c91baa..57309282a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -664,6 +664,20 @@ public double As(KinematicViscosityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -692,9 +706,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsKinematicViscosityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public KinematicViscosity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(KinematicViscosityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index a9abed3de6..66a6a22350 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -556,6 +556,20 @@ public double As(LapseRateUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -584,9 +598,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLapseRateUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public LapseRate ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LapseRateUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 9f91a50bf1..ebc29fb4ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -871,6 +871,20 @@ public double As(LengthUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -899,9 +913,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLengthUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Length ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LengthUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 085611f919..b468073bb0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -579,6 +579,20 @@ public double As(LevelUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -607,9 +621,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLevelUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Level ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LevelUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 1861f18f2f..d35acb6245 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -589,6 +589,20 @@ public double As(LinearDensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -617,9 +631,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLinearDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public LinearDensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LinearDensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index d4b59caeb6..fb7086a3c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(LuminousFluxUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLuminousFluxUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public LuminousFlux ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LuminousFluxUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 6f3c5656f4..5a77b114c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(LuminousIntensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLuminousIntensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public LuminousIntensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(LuminousIntensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index a32bd2cc37..a84950292a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -604,6 +604,20 @@ public double As(MagneticFieldUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -632,9 +646,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagneticFieldUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MagneticField ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MagneticFieldUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index d84fbcecfa..3b277304e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(MagneticFluxUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagneticFluxUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MagneticFlux ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MagneticFluxUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 835e6daf37..4e85ed8b0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(MagnetizationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagnetizationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Magnetization ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MagnetizationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 2e2d84bd18..e15356d676 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -886,6 +886,20 @@ public double As(MassUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -914,9 +928,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Mass ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MassUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 1f853fd20c..dca6036624 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1006,6 +1006,20 @@ public double As(MassFlowUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1034,9 +1048,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassFlowUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MassFlow ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MassFlowUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 9a080c17b2..a78b91ab25 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -571,6 +571,20 @@ public double As(MassFluxUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -599,9 +613,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassFluxUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MassFlux ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MassFluxUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 3ebb5db9e3..8bfa001953 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -961,6 +961,20 @@ public double As(MassMomentOfInertiaUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -989,9 +1003,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassMomentOfInertiaUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MassMomentOfInertia ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MassMomentOfInertiaUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index f2b70bc69b..45dfa1ce3a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(MolarEnergyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarEnergyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MolarEnergy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MolarEnergyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 5c083dcf44..768e16c9af 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(MolarEntropyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarEntropyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MolarEntropy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MolarEntropyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index c3c50457ec..fe583a8d69 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -721,6 +721,20 @@ public double As(MolarMassUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -749,9 +763,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarMassUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public MolarMass ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MolarMassUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 2e25137e8f..3e2b2ab1f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -664,6 +664,20 @@ public double As(MolarityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -692,9 +706,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Molarity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(MolarityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 495727d600..8436368420 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(PermeabilityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPermeabilityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Permeability ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PermeabilityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 5ae9a8fff6..3caa9f4a3e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(PermittivityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPermittivityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Permittivity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PermittivityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 26133d8e78..4a8071231f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -843,6 +843,20 @@ public double As(PowerUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -871,9 +885,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Power ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PowerUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index e0d16ba632..45743d7235 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1201,6 +1201,20 @@ public double As(PowerDensityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1229,9 +1243,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerDensityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public PowerDensity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PowerDensityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index bc83cdb03f..8a825cf1d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -579,6 +579,20 @@ public double As(PowerRatioUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -607,9 +621,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerRatioUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public PowerRatio ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PowerRatioUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 27465118ad..a899099a5a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1171,6 +1171,20 @@ public double As(PressureUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1199,9 +1213,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPressureUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Pressure ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PressureUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 1e8d62a7e7..2d013bb33e 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -646,6 +646,20 @@ public double As(PressureChangeRateUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -674,9 +688,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPressureChangeRateUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public PressureChangeRate ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(PressureChangeRateUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index a894e1f018..00f020bd58 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -631,6 +631,20 @@ public double As(RatioUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -659,9 +673,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRatioUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Ratio ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(RatioUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 84a0047631..79ccd3697f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(ReactiveEnergyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsReactiveEnergyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ReactiveEnergy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ReactiveEnergyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index fab20deff1..5d236ff886 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -601,6 +601,20 @@ public double As(ReactivePowerUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -629,9 +643,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsReactivePowerUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ReactivePower ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ReactivePowerUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 2566dc57be..83ebf9aef6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(RotationalAccelerationUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalAccelerationUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public RotationalAcceleration ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(RotationalAccelerationUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 2d4c20e3ab..f8041f1531 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -736,6 +736,20 @@ public double As(RotationalSpeedUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -764,9 +778,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalSpeedUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public RotationalSpeed ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(RotationalSpeedUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index bebf7c5c35..230eda2a4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(RotationalStiffnessUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalStiffnessUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public RotationalStiffness ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(RotationalStiffnessUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index e6229d7d1b..f1002934f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(RotationalStiffnessPerLengthUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalStiffnessPerLengthUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public RotationalStiffnessPerLength ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(RotationalStiffnessPerLengthUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 7045df5cef..e4f15fcc2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -559,6 +559,20 @@ public double As(SolidAngleUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -587,9 +601,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSolidAngleUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public SolidAngle ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SolidAngleUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 4e1361117d..328ad281fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -679,6 +679,20 @@ public double As(SpecificEnergyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -707,9 +721,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificEnergyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public SpecificEnergy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SpecificEnergyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 82c36fb2e4..319d828fe7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -661,6 +661,20 @@ public double As(SpecificEntropyUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -689,9 +703,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificEntropyUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public SpecificEntropy ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SpecificEntropyUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index eea5cdb3a1..8ed94ee111 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -586,6 +586,20 @@ public double As(SpecificVolumeUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -614,9 +628,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificVolumeUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public SpecificVolume ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SpecificVolumeUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 33f0d35baf..1a2cf948fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -799,6 +799,20 @@ public double As(SpecificWeightUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -827,9 +841,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificWeightUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public SpecificWeight ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SpecificWeightUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 40bc721df2..362d30b7db 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1021,6 +1021,20 @@ public double As(SpeedUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1049,9 +1063,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpeedUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Speed ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(SpeedUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index db04d15d6b..d5075906d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -615,6 +615,20 @@ public double As(TemperatureUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -643,9 +657,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Temperature ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(TemperatureUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 6341ab88b0..2cfb2b7eb2 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -691,6 +691,20 @@ public double As(TemperatureChangeRateUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -719,9 +733,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureChangeRateUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public TemperatureChangeRate ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(TemperatureChangeRateUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index abb6759f07..1628460580 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -661,6 +661,20 @@ public double As(TemperatureDeltaUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -689,9 +703,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureDeltaUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public TemperatureDelta ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(TemperatureDeltaUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 61be4f2706..1a73f38658 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -574,6 +574,20 @@ public double As(ThermalConductivityUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -602,9 +616,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsThermalConductivityUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ThermalConductivity ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ThermalConductivityUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 4d96f4cb3d..264bba9753 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -616,6 +616,20 @@ public double As(ThermalResistanceUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -644,9 +658,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsThermalResistanceUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public ThermalResistance ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(ThermalResistanceUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 17442ff684..1c67b5eb44 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -856,6 +856,20 @@ public double As(TorqueUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -884,9 +898,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTorqueUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Torque ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(TorqueUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index fd613666b8..74cd00f448 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -556,6 +556,20 @@ public double As(VitaminAUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -584,9 +598,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVitaminAUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public VitaminA ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(VitaminAUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 87c99bf496..2a7d84452a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1216,6 +1216,20 @@ public double As(VolumeUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1244,9 +1258,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVolumeUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public Volume ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(VolumeUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 0c050a3258..ae4799fd75 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1261,6 +1261,20 @@ public double As(VolumeFlowUnit unit) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1289,9 +1303,29 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVolumeFlowUnit); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public VolumeFlow ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity IQuantity.ToUnit(VolumeFlowUnit unit) => ToUnit(unit); + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 8d133b9223..3a7f6b7db0 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -36,6 +36,13 @@ public interface IQuantity : IFormattable /// Wrong unit enum type was given. double As(Enum unit); + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + double As(UnitSystem unitSystem); + /// /// The unit this quantity was constructed with -or- BaseUnit if default ctor was used. /// @@ -53,6 +60,13 @@ public interface IQuantity : IFormattable /// A new quantity with the given unit as default unit representation. IQuantity ToUnit(Enum unit); + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + IQuantity ToUnit(UnitSystem unitSystem); + /// /// Get string representation of value and unit. Using two significant digits after radix. /// @@ -108,5 +122,12 @@ public interface IQuantity : IQuantity where TUnitType : Enum /// /// IQuantity ToUnit(TUnitType unit); + + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + new IQuantity ToUnit(UnitSystem unitSystem); } } diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index b56e28a3bf..fa1b6a673c 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -982,6 +982,20 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return Convert.ToDouble(converted); } + /// + /// Converts the quantity value into units compatible with the given . + /// + /// The to convert the quantity value to. + /// The converted value with units compatible with the given . + public double As(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return As(unitForUnitSystem); + } + /// double IQuantity.As(Enum unit) { @@ -1010,9 +1024,29 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return ToUnit(unitAs$unitEnumName); } + /// + /// Converts the quantity into a quantity which has units compatible with the given . + /// + /// The to convert the quantity to. + /// A new quantity with units compatible with the given . + public $quantityName ToUnit(UnitSystem unitSystem) + { + if(unitSystem == null) + throw new ArgumentNullException(nameof(unitSystem)); + + var unitForUnitSystem = Info.GetUnitInfoFor(unitSystem.BaseUnits).Value; + return ToUnit(unitForUnitSystem); + } + + /// + IQuantity IQuantity.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// IQuantity<$unitEnumName> IQuantity<$unitEnumName>.ToUnit($unitEnumName unit) => ToUnit(unit); + /// + IQuantity<$unitEnumName> IQuantity<$unitEnumName>.ToUnit(UnitSystem unitSystem) => ToUnit(unitSystem); + /// /// Converts the current value + unit to the base unit. /// This is typically the first step in converting from one unit to another. From d9068e56d0830400a69516b362903e768a313760 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:21:54 +0100 Subject: [PATCH 02/12] Fix typo --- UnitsNet.Tests/CustomCode/AreaTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/AreaTests.cs b/UnitsNet.Tests/CustomCode/AreaTests.cs index f25432fb4b..85fe8fee1a 100644 --- a/UnitsNet.Tests/CustomCode/AreaTests.cs +++ b/UnitsNet.Tests/CustomCode/AreaTests.cs @@ -92,14 +92,14 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialGivenSIUnitSysten_ReturnsSIValue() + public void As_ImperialGivenSIUnitSystem_ReturnsSIValue() { var imperialArea = new Area(2.0, AreaUnit.SquareInch); Assert.Equal(0.00129032, imperialArea.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialGivenSIUnitSysten_ReturnsSIValue() + public void ToUnit_ImperialGivenSIUnitSystem_ReturnsSIValue() { var imperialArea = new Area(2.0, AreaUnit.SquareInch); Assert.Equal(Area.FromSquareMeters(0.00129032), imperialArea.ToUnit(UnitSystem.SI)); From ed35fc0cd823f1d9b442c9de4665ae50864ae548 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:23:20 +0100 Subject: [PATCH 03/12] Fix typo --- UnitsNet.Tests/CustomCode/EnergyTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs index 9d01b60df5..3f99aec9df 100644 --- a/UnitsNet.Tests/CustomCode/EnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs @@ -62,14 +62,14 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); Assert.Equal(2110.11170524, imperialEnergy.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { var imperialEnergy = new Energy(2.0, EnergyUnit.BritishThermalUnit); Assert.Equal(Energy.FromJoules(2110.11170524), imperialEnergy.ToUnit(UnitSystem.SI)); From 036aae533677f279793206323fbf494f01183740 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:23:43 +0100 Subject: [PATCH 04/12] Fix typo --- UnitsNet.Tests/CustomCode/LengthTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index 6a348eb41e..ec54147c2f 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -167,14 +167,14 @@ public void Constructor_UnitSystemSI_AssignsSIUnit() } [Fact] - public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { var imperialLength = new Length(2.0, LengthUnit.Inch); Assert.Equal(0.0508, imperialLength.As(UnitSystem.SI)); } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { var imperialLength = new Length(2.0, LengthUnit.Inch); Assert.Equal(Length.FromMeters(0.0508), imperialLength.ToUnit(UnitSystem.SI)); From 3454219e9e72f87c8de8e2871553894f7795bda0 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:24:15 +0100 Subject: [PATCH 05/12] Fix typo --- UnitsNet.Tests/IQuantityTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/IQuantityTests.cs b/UnitsNet.Tests/IQuantityTests.cs index 56dcefd8f2..382cd25bb2 100644 --- a/UnitsNet.Tests/IQuantityTests.cs +++ b/UnitsNet.Tests/IQuantityTests.cs @@ -24,7 +24,7 @@ public void As_GivenNullUnitSystem_ThrowsArgumentNullException() } [Fact] - public void As_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void As_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); Assert.Equal(0.0508, imperialLengthQuantity.As(UnitSystem.SI)); @@ -45,7 +45,7 @@ public void ToUnit_GivenNullUnitSystem_ThrowsArgumentNullException() } [Fact] - public void ToUnit_ImperialQuantityGivenSIUnitSysten_ReturnsSIValue() + public void ToUnit_ImperialQuantityGivenSIUnitSystem_ReturnsSIValue() { IQuantity imperialLengthQuantity = new Length(2.0, LengthUnit.Inch); Assert.Equal(Length.FromMeters(0.0508), imperialLengthQuantity.ToUnit(UnitSystem.SI)); From 66c7dbe7962b7c16e447ebc777a85f22095546df Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:48:27 +0100 Subject: [PATCH 06/12] IQuantity: Update xmldoc Match the old descriptions and use singular unit instead of plural units. --- UnitsNet/IQuantity.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 3a7f6b7db0..7aa854af45 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -57,18 +57,19 @@ public interface IQuantity : IFormattable /// Change the default unit representation of the quantity, which affects things like . /// /// The unit enum value. The unit must be compatible, so for you should provide a value. - /// A new quantity with the given unit as default unit representation. + /// A new quantity with the given unit. IQuantity ToUnit(Enum unit); /// - /// Converts the quantity into a quantity which has units compatible with the given . + /// Change the default unit representation of the quantity, which affects things like . + /// The unit is determined as the single unit matching the given . /// /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// A new quantity with a unit determined by the . IQuantity ToUnit(UnitSystem unitSystem); /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the string representation of value and unit. Uses two significant digits after radix. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. @@ -120,14 +121,15 @@ public interface IQuantity : IQuantity where TUnitType : Enum /// Change the default unit representation of the quantity, which affects things like . /// /// - /// + /// A new quantity with the given unit. IQuantity ToUnit(TUnitType unit); /// - /// Converts the quantity into a quantity which has units compatible with the given . + /// Change the default unit representation of the quantity, which affects things like . + /// The unit is determined as the single unit matching the given . /// /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// A new quantity with a unit determined by the . new IQuantity ToUnit(UnitSystem unitSystem); } } From 1ca42829c54803522e2c3b4dc3afb6ab14f6d1e2 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Fri, 1 Mar 2019 22:59:26 +0100 Subject: [PATCH 07/12] Another go at xmldoc --- UnitsNet/IQuantity.cs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 7aa854af45..7a8368fa56 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -29,7 +29,7 @@ public interface IQuantity : IFormattable QuantityInfo QuantityInfo { get; } /// - /// Dynamically convert to another unit representation. + /// Gets the value in the given unit. /// /// The unit enum value. The unit must be compatible, so for you should provide a value. /// Value converted to the specified unit. @@ -37,10 +37,10 @@ public interface IQuantity : IFormattable double As(Enum unit); /// - /// Converts the quantity value into units compatible with the given . + /// Gets the value in the unit determined by the given . /// /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// The converted value. double As(UnitSystem unitSystem); /// @@ -49,23 +49,22 @@ public interface IQuantity : IFormattable Enum Unit { get; } /// - /// The value this quantity was constructed with. Should be seen in combination with . + /// The value this quantity was constructed with. See also . /// double Value { get; } /// - /// Change the default unit representation of the quantity, which affects things like . + /// Converts to a quantity with the given unit representation, which affects things like . /// /// The unit enum value. The unit must be compatible, so for you should provide a value. /// A new quantity with the given unit. IQuantity ToUnit(Enum unit); /// - /// Change the default unit representation of the quantity, which affects things like . - /// The unit is determined as the single unit matching the given . + /// Converts to a quantity with a unit determined by the given , which affects things like . /// /// The to convert the quantity to. - /// A new quantity with a unit determined by the . + /// A new quantity with the determined unit. IQuantity ToUnit(UnitSystem unitSystem); /// @@ -118,18 +117,17 @@ public interface IQuantity : IQuantity where TUnitType : Enum new QuantityInfo QuantityInfo { get; } /// - /// Change the default unit representation of the quantity, which affects things like . + /// Converts to a quantity with the given unit representation, which affects things like . /// - /// + /// The unit enum value. /// A new quantity with the given unit. IQuantity ToUnit(TUnitType unit); /// - /// Change the default unit representation of the quantity, which affects things like . - /// The unit is determined as the single unit matching the given . + /// Converts to a quantity with a unit determined by the given , which affects things like . /// /// The to convert the quantity to. - /// A new quantity with a unit determined by the . + /// A new quantity with the determined unit. new IQuantity ToUnit(UnitSystem unitSystem); } } From 420d118aad5e314711743e0b3c3e8d377d60c17e Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Sat, 2 Mar 2019 20:57:06 -0500 Subject: [PATCH 08/12] Adding AreAllBaseUnitsDefined method --- UnitsNet.Tests/BaseUnitsTests.cs | 40 ++++++++++++++++++++++++++++++++ UnitsNet/BaseUnits.cs | 15 ++++++++++++ UnitsNet/UnitSystem.cs | 14 +---------- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/UnitsNet.Tests/BaseUnitsTests.cs b/UnitsNet.Tests/BaseUnitsTests.cs index 698418b95c..0aef46a636 100644 --- a/UnitsNet.Tests/BaseUnitsTests.cs +++ b/UnitsNet.Tests/BaseUnitsTests.cs @@ -136,5 +136,45 @@ public void ToStringGivesExpectedResult() Assert.Equal("[Length]: m, [Mass]: kg, [Time]: s, [Current]: A, [Temperature]: K, [Amount]: mol, [LuminousIntensity]: cd", siBaseUnits.ToString()); } + + [Fact] + public void AreAllBaseUnitsDefined_TrueIfAllBaseUnitDefined() + { + Assert.True(new BaseUnits(LengthUnit.Meter, MassUnit.Kilogram, DurationUnit.Second, + ElectricCurrentUnit.Ampere, TemperatureUnit.Kelvin, AmountOfSubstanceUnit.Mole, + LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + } + + [Fact] + public void AreAllBaseUnitsDefined_FalseIfAnyBaseUnitIsUndefined() + { + Assert.False(new BaseUnits(mass: MassUnit.Kilogram, time: DurationUnit.Second, + current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, time: DurationUnit.Second, + current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, + current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, + temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, + current: ElectricCurrentUnit.Ampere, amount: AmountOfSubstanceUnit.Mole, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, + current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, + luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + + Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, + current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole + ).AreAllBaseUnitsDefined()); + } } } diff --git a/UnitsNet/BaseUnits.cs b/UnitsNet/BaseUnits.cs index 0148b48b30..3a7d288442 100644 --- a/UnitsNet/BaseUnits.cs +++ b/UnitsNet/BaseUnits.cs @@ -101,6 +101,21 @@ public bool IsSubsetOf(BaseUnits other) (LuminousIntensity == LuminousIntensityUnit.Undefined || LuminousIntensity == other.LuminousIntensity); } + /// + /// Checks if all of the base units are defined. + /// + /// True if all of the base units are defined, otherwise false. + public bool AreAllBaseUnitsDefined() + { + return Length != LengthUnit.Undefined && + Mass != MassUnit.Undefined && + Time != DurationUnit.Undefined && + Current != ElectricCurrentUnit.Undefined && + Temperature != TemperatureUnit.Undefined && + Amount != AmountOfSubstanceUnit.Undefined && + LuminousIntensity != LuminousIntensityUnit.Undefined; + } + /// public override int GetHashCode() { diff --git a/UnitsNet/UnitSystem.cs b/UnitsNet/UnitSystem.cs index 666d7ab387..5c01dba87f 100644 --- a/UnitsNet/UnitSystem.cs +++ b/UnitsNet/UnitSystem.cs @@ -22,19 +22,7 @@ public UnitSystem(BaseUnits baseUnits) if(baseUnits is null) throw new ArgumentNullException(nameof(baseUnits)); - if(baseUnits.Length == LengthUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.Mass == MassUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.Time == DurationUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.Current == ElectricCurrentUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.Temperature == TemperatureUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.Amount == AmountOfSubstanceUnit.Undefined) - throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); - if(baseUnits.LuminousIntensity == LuminousIntensityUnit.Undefined) + if(!baseUnits.AreAllBaseUnitsDefined()) throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); BaseUnits = baseUnits; From 01f590084a9dfec6470d723f30262641a72d1c63 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Sat, 2 Mar 2019 21:27:18 -0500 Subject: [PATCH 09/12] Doc update --- UnitsNet/QuantityInfo.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UnitsNet/QuantityInfo.cs b/UnitsNet/QuantityInfo.cs index ef6c008e56..3bba309cf7 100644 --- a/UnitsNet/QuantityInfo.cs +++ b/UnitsNet/QuantityInfo.cs @@ -125,13 +125,13 @@ public QuantityInfo(QuantityType quantityType, [NotNull] UnitInfo[] unitInfos, [ public BaseDimensions BaseDimensions { get; } /// - /// Gets the which has that are a subset of the given . + /// Gets the that has that is a subset of . /// /// The to check against. - /// The UnitInfo that has BaseUnits that are a subset. - /// The baseUnits parameter is null. - /// No unit was found that is a subset of the given BaseUnits. - /// More than one unit was found that is a subset of the given BaseUnits. + /// The that has that is a subset of . + /// is null. + /// No unit was found that is a subset of . + /// More than one unit was found that is a subset of . public UnitInfo GetUnitInfoFor(BaseUnits baseUnits) { if(baseUnits == null) @@ -144,10 +144,10 @@ public UnitInfo GetUnitInfoFor(BaseUnits baseUnits) var firstUnitInfo = matchingUnitInfos.FirstOrDefault(); if (firstUnitInfo == null) - throw new InvalidOperationException("No unit was found that is a subset of the given BaseUnits."); + throw new InvalidOperationException($"No unit was found that is a subset of {nameof(baseUnits)}"); if (matchingUnitInfos.Length > 1) - throw new InvalidOperationException("More than one unit was found that is a subset of the given BaseUnits."); + throw new InvalidOperationException($"More than one unit was found that is a subset of {nameof(baseUnits)}"); return firstUnitInfo; } From cfee3d63f470c6a90a7655f6fb1eea675bc25ecb Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Sun, 3 Mar 2019 10:35:51 +0100 Subject: [PATCH 10/12] Update xmldoc for GetUnitInfoFor --- UnitsNet/QuantityInfo.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnitsNet/QuantityInfo.cs b/UnitsNet/QuantityInfo.cs index 3bba309cf7..ac42edc470 100644 --- a/UnitsNet/QuantityInfo.cs +++ b/UnitsNet/QuantityInfo.cs @@ -125,8 +125,9 @@ public QuantityInfo(QuantityType quantityType, [NotNull] UnitInfo[] unitInfos, [ public BaseDimensions BaseDimensions { get; } /// - /// Gets the that has that is a subset of . + /// Gets the whose is a subset of . /// + /// Length.Info.GetUnitInfoFor(unitSystemWithFootAsLengthUnit) returns for . /// The to check against. /// The that has that is a subset of . /// is null. From 406d590dfa0ccbe23b433e6ccbec63db0958859a Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Sun, 3 Mar 2019 16:37:32 -0500 Subject: [PATCH 11/12] Making method a IsFullyDefined property --- UnitsNet.Tests/BaseUnitsTests.cs | 22 +++++++++++----------- UnitsNet/BaseUnits.cs | 28 +++++++++++++--------------- UnitsNet/UnitSystem.cs | 2 +- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/UnitsNet.Tests/BaseUnitsTests.cs b/UnitsNet.Tests/BaseUnitsTests.cs index 0aef46a636..3954e61b93 100644 --- a/UnitsNet.Tests/BaseUnitsTests.cs +++ b/UnitsNet.Tests/BaseUnitsTests.cs @@ -138,43 +138,43 @@ public void ToStringGivesExpectedResult() } [Fact] - public void AreAllBaseUnitsDefined_TrueIfAllBaseUnitDefined() + public void IsFullyDefined_TrueIfAllBaseUnitDefined() { Assert.True(new BaseUnits(LengthUnit.Meter, MassUnit.Kilogram, DurationUnit.Second, ElectricCurrentUnit.Ampere, TemperatureUnit.Kelvin, AmountOfSubstanceUnit.Mole, - LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + LuminousIntensityUnit.Candela).IsFullyDefined); } - + [Fact] - public void AreAllBaseUnitsDefined_FalseIfAnyBaseUnitIsUndefined() + public void IsFullyDefined_FalseIfAnyBaseUnitIsUndefined() { Assert.False(new BaseUnits(mass: MassUnit.Kilogram, time: DurationUnit.Second, current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, time: DurationUnit.Second, current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, current: ElectricCurrentUnit.Ampere, amount: AmountOfSubstanceUnit.Mole, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, - luminousIntensity: LuminousIntensityUnit.Candela).AreAllBaseUnitsDefined()); + luminousIntensity: LuminousIntensityUnit.Candela).IsFullyDefined); Assert.False(new BaseUnits(length: LengthUnit.Meter, mass: MassUnit.Kilogram, time: DurationUnit.Second, current: ElectricCurrentUnit.Ampere, temperature: TemperatureUnit.Kelvin, amount: AmountOfSubstanceUnit.Mole - ).AreAllBaseUnitsDefined()); + ).IsFullyDefined); } } } diff --git a/UnitsNet/BaseUnits.cs b/UnitsNet/BaseUnits.cs index 3a7d288442..cfcf559eb1 100644 --- a/UnitsNet/BaseUnits.cs +++ b/UnitsNet/BaseUnits.cs @@ -46,6 +46,14 @@ public BaseUnits( Temperature = temperature; Amount = amount; LuminousIntensity = luminousIntensity; + + IsFullyDefined = Length != LengthUnit.Undefined && + Mass != MassUnit.Undefined && + Time != DurationUnit.Undefined && + Current != ElectricCurrentUnit.Undefined && + Temperature != TemperatureUnit.Undefined && + Amount != AmountOfSubstanceUnit.Undefined && + LuminousIntensity != LuminousIntensityUnit.Undefined; } /// @@ -101,21 +109,6 @@ public bool IsSubsetOf(BaseUnits other) (LuminousIntensity == LuminousIntensityUnit.Undefined || LuminousIntensity == other.LuminousIntensity); } - /// - /// Checks if all of the base units are defined. - /// - /// True if all of the base units are defined, otherwise false. - public bool AreAllBaseUnitsDefined() - { - return Length != LengthUnit.Undefined && - Mass != MassUnit.Undefined && - Time != DurationUnit.Undefined && - Current != ElectricCurrentUnit.Undefined && - Temperature != TemperatureUnit.Undefined && - Amount != AmountOfSubstanceUnit.Undefined && - LuminousIntensity != LuminousIntensityUnit.Undefined; - } - /// public override int GetHashCode() { @@ -196,5 +189,10 @@ public override string ToString() /// Gets the luminous intensity unit (J). /// public LuminousIntensityUnit LuminousIntensity{ get; } + + /// + /// Gets whether or not all of the base units are defined. + /// + public bool IsFullyDefined { get; } } } diff --git a/UnitsNet/UnitSystem.cs b/UnitsNet/UnitSystem.cs index 5c01dba87f..f55821b7ff 100644 --- a/UnitsNet/UnitSystem.cs +++ b/UnitsNet/UnitSystem.cs @@ -22,7 +22,7 @@ public UnitSystem(BaseUnits baseUnits) if(baseUnits is null) throw new ArgumentNullException(nameof(baseUnits)); - if(!baseUnits.AreAllBaseUnitsDefined()) + if(!baseUnits.IsFullyDefined) throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); BaseUnits = baseUnits; From e30a841868637aedce96455cd811164f7a98e156 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Sun, 3 Mar 2019 19:49:03 -0500 Subject: [PATCH 12/12] Inherit doc --- .../Quantities/Acceleration.NetFramework.g.cs | 12 ++---------- .../Quantities/AmountOfSubstance.NetFramework.g.cs | 12 ++---------- .../Quantities/AmplitudeRatio.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Angle.NetFramework.g.cs | 12 ++---------- .../Quantities/ApparentEnergy.NetFramework.g.cs | 12 ++---------- .../Quantities/ApparentPower.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Area.NetFramework.g.cs | 12 ++---------- .../Quantities/AreaDensity.NetFramework.g.cs | 12 ++---------- .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 12 ++---------- .../Quantities/BitRate.NetFramework.g.cs | 12 ++---------- .../BrakeSpecificFuelConsumption.NetFramework.g.cs | 12 ++---------- .../Quantities/Capacitance.NetFramework.g.cs | 12 ++---------- .../CoefficientOfThermalExpansion.NetFramework.g.cs | 12 ++---------- .../Quantities/Density.NetFramework.g.cs | 12 ++---------- .../Quantities/Duration.NetFramework.g.cs | 12 ++---------- .../Quantities/DynamicViscosity.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricAdmittance.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricCharge.NetFramework.g.cs | 12 ++---------- .../ElectricChargeDensity.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricConductance.NetFramework.g.cs | 12 ++---------- .../ElectricConductivity.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricCurrent.NetFramework.g.cs | 12 ++---------- .../ElectricCurrentDensity.NetFramework.g.cs | 12 ++---------- .../ElectricCurrentGradient.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricField.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricInductance.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricPotential.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricResistance.NetFramework.g.cs | 12 ++---------- .../Quantities/ElectricResistivity.NetFramework.g.cs | 12 ++---------- .../Quantities/Energy.NetFramework.g.cs | 12 ++---------- .../Quantities/Entropy.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Force.NetFramework.g.cs | 12 ++---------- .../Quantities/ForceChangeRate.NetFramework.g.cs | 12 ++---------- .../Quantities/ForcePerLength.NetFramework.g.cs | 12 ++---------- .../Quantities/Frequency.NetFramework.g.cs | 12 ++---------- .../Quantities/HeatFlux.NetFramework.g.cs | 12 ++---------- .../HeatTransferCoefficient.NetFramework.g.cs | 12 ++---------- .../Quantities/Illuminance.NetFramework.g.cs | 12 ++---------- .../Quantities/Information.NetFramework.g.cs | 12 ++---------- .../Quantities/Irradiance.NetFramework.g.cs | 12 ++---------- .../Quantities/Irradiation.NetFramework.g.cs | 12 ++---------- .../Quantities/KinematicViscosity.NetFramework.g.cs | 12 ++---------- .../Quantities/LapseRate.NetFramework.g.cs | 12 ++---------- .../Quantities/Length.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Level.NetFramework.g.cs | 12 ++---------- .../Quantities/LinearDensity.NetFramework.g.cs | 12 ++---------- .../Quantities/LuminousFlux.NetFramework.g.cs | 12 ++---------- .../Quantities/LuminousIntensity.NetFramework.g.cs | 12 ++---------- .../Quantities/MagneticField.NetFramework.g.cs | 12 ++---------- .../Quantities/MagneticFlux.NetFramework.g.cs | 12 ++---------- .../Quantities/Magnetization.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Mass.NetFramework.g.cs | 12 ++---------- .../Quantities/MassFlow.NetFramework.g.cs | 12 ++---------- .../Quantities/MassFlux.NetFramework.g.cs | 12 ++---------- .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 12 ++---------- .../Quantities/MolarEnergy.NetFramework.g.cs | 12 ++---------- .../Quantities/MolarEntropy.NetFramework.g.cs | 12 ++---------- .../Quantities/MolarMass.NetFramework.g.cs | 12 ++---------- .../Quantities/Molarity.NetFramework.g.cs | 12 ++---------- .../Quantities/Permeability.NetFramework.g.cs | 12 ++---------- .../Quantities/Permittivity.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Power.NetFramework.g.cs | 12 ++---------- .../Quantities/PowerDensity.NetFramework.g.cs | 12 ++---------- .../Quantities/PowerRatio.NetFramework.g.cs | 12 ++---------- .../Quantities/Pressure.NetFramework.g.cs | 12 ++---------- .../Quantities/PressureChangeRate.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 12 ++---------- .../Quantities/ReactiveEnergy.NetFramework.g.cs | 12 ++---------- .../Quantities/ReactivePower.NetFramework.g.cs | 12 ++---------- .../RotationalAcceleration.NetFramework.g.cs | 12 ++---------- .../Quantities/RotationalSpeed.NetFramework.g.cs | 12 ++---------- .../Quantities/RotationalStiffness.NetFramework.g.cs | 12 ++---------- .../RotationalStiffnessPerLength.NetFramework.g.cs | 12 ++---------- .../Quantities/SolidAngle.NetFramework.g.cs | 12 ++---------- .../Quantities/SpecificEnergy.NetFramework.g.cs | 12 ++---------- .../Quantities/SpecificEntropy.NetFramework.g.cs | 12 ++---------- .../Quantities/SpecificVolume.NetFramework.g.cs | 12 ++---------- .../Quantities/SpecificWeight.NetFramework.g.cs | 12 ++---------- .../GeneratedCode/Quantities/Speed.NetFramework.g.cs | 12 ++---------- .../Quantities/Temperature.NetFramework.g.cs | 12 ++---------- .../TemperatureChangeRate.NetFramework.g.cs | 12 ++---------- .../Quantities/TemperatureDelta.NetFramework.g.cs | 12 ++---------- .../Quantities/ThermalConductivity.NetFramework.g.cs | 12 ++---------- .../Quantities/ThermalResistance.NetFramework.g.cs | 12 ++---------- .../Quantities/Torque.NetFramework.g.cs | 12 ++---------- .../Quantities/VitaminA.NetFramework.g.cs | 12 ++---------- .../Quantities/Volume.NetFramework.g.cs | 12 ++---------- .../Quantities/VolumeFlow.NetFramework.g.cs | 12 ++---------- .../Scripts/Include-GenerateQuantitySourceCode.ps1 | 12 ++---------- 91 files changed, 182 insertions(+), 910 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 58b218383e..f2a6af8222 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -736,11 +736,7 @@ public double As(AccelerationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -778,11 +774,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAccelerationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Acceleration ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index c816a78e6b..54bca9e3d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -766,11 +766,7 @@ public double As(AmountOfSubstanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -808,11 +804,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAmountOfSubstanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public AmountOfSubstance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index d2aaffb6fa..c5bcdeb8ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -609,11 +609,7 @@ public double As(AmplitudeRatioUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -651,11 +647,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAmplitudeRatioUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public AmplitudeRatio ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 2ed4d8cef0..b7ae67c111 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -751,11 +751,7 @@ public double As(AngleUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -793,11 +789,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAngleUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Angle ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 702de02ea3..be5084ee71 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(ApparentEnergyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsApparentEnergyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ApparentEnergy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 50cc2fee4d..87c9f2d59f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -601,11 +601,7 @@ public double As(ApparentPowerUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -643,11 +639,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsApparentPowerUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ApparentPower ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index c10d70ffea..e5bd3d7931 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -736,11 +736,7 @@ public double As(AreaUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -778,11 +774,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Area ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 130c6d2727..9c809fa1ad 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -556,11 +556,7 @@ public double As(AreaDensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -598,11 +594,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public AreaDensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index cb01954b4d..efea7f32f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -631,11 +631,7 @@ public double As(AreaMomentOfInertiaUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -673,11 +669,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsAreaMomentOfInertiaUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public AreaMomentOfInertia ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 1e963366ca..a2c71641d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -936,11 +936,7 @@ public double As(BitRateUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -978,11 +974,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsBitRateUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public BitRate ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index e91ef5c89f..54956e85c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(BrakeSpecificFuelConsumptionUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsBrakeSpecificFuelConsumptionUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public BrakeSpecificFuelConsumption ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index debc4862bc..1695a559fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -649,11 +649,7 @@ public double As(CapacitanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -691,11 +687,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsCapacitanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Capacitance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 16006ecfbc..863527ea61 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(CoefficientOfThermalExpansionUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsCoefficientOfThermalExpansionUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public CoefficientOfThermalExpansion ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 7453312c9d..2bc80035f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1129,11 +1129,7 @@ public double As(DensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1171,11 +1167,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Density ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 14b38d8d82..29a2b9ef39 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -691,11 +691,7 @@ public double As(DurationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -733,11 +729,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDurationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Duration ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index cec9412234..4355267865 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -634,11 +634,7 @@ public double As(DynamicViscosityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -676,11 +672,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsDynamicViscosityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public DynamicViscosity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 050a35fd8d..900ac80304 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -601,11 +601,7 @@ public double As(ElectricAdmittanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -643,11 +639,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricAdmittanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricAdmittance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index f6b9be4eff..4ea2a2abba 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(ElectricChargeUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricChargeUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricCharge ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index a2b152b45b..3c59c4b774 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(ElectricChargeDensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricChargeDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricChargeDensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 132bd0fe7a..6e52d145a9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -589,11 +589,7 @@ public double As(ElectricConductanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -631,11 +627,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricConductanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricConductance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d7ff414251..91fa0ad29d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(ElectricConductivityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricConductivityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricConductivity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index f30347eabd..9a759dbf08 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -661,11 +661,7 @@ public double As(ElectricCurrentUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -703,11 +699,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricCurrent ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 0af158cfaf..dae7db4ea2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(ElectricCurrentDensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricCurrentDensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index acd50395f4..dd191f3363 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -556,11 +556,7 @@ public double As(ElectricCurrentGradientUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -598,11 +594,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricCurrentGradientUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricCurrentGradient ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 9dd45a10e5..e2a3723bd4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(ElectricFieldUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricFieldUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricField ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index becd2bc26e..e5c4bc83e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -604,11 +604,7 @@ public double As(ElectricInductanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -646,11 +642,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricInductanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricInductance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 280ef3ce96..d58ad28cfd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -616,11 +616,7 @@ public double As(ElectricPotentialUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -658,11 +654,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricPotential ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 598c91a161..a8f3c9c4c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -616,11 +616,7 @@ public double As(ElectricPotentialAcUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -658,11 +654,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialAcUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricPotentialAc ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 82e326742a..b5a9562658 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -616,11 +616,7 @@ public double As(ElectricPotentialDcUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -658,11 +654,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricPotentialDcUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricPotentialDc ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 60b75e35f7..23e93a10a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -616,11 +616,7 @@ public double As(ElectricResistanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -658,11 +654,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricResistanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricResistance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 57767a31bc..8a3eec54bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -754,11 +754,7 @@ public double As(ElectricResistivityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -796,11 +792,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsElectricResistivityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ElectricResistivity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 7fa3270f4b..41cf80d0d2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -886,11 +886,7 @@ public double As(EnergyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -928,11 +924,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsEnergyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Energy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 69e3e795a6..a30ee26ef4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -646,11 +646,7 @@ public double As(EntropyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -688,11 +684,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsEntropyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Entropy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index b22354188c..06f7b46b2a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -736,11 +736,7 @@ public double As(ForceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -778,11 +774,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Force ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index bf88850e84..749b9d85e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -706,11 +706,7 @@ public double As(ForceChangeRateUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -748,11 +744,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForceChangeRateUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ForceChangeRate ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index a41d0452f1..f6f9b959f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -676,11 +676,7 @@ public double As(ForcePerLengthUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -718,11 +714,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsForcePerLengthUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ForcePerLength ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index dc8e8824b5..520a093d47 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -676,11 +676,7 @@ public double As(FrequencyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -718,11 +714,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsFrequencyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Frequency ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 7e042f5b0f..11cc30407b 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -811,11 +811,7 @@ public double As(HeatFluxUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -853,11 +849,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsHeatFluxUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public HeatFlux ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 470afa0e21..4a9ececd46 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -571,11 +571,7 @@ public double As(HeatTransferCoefficientUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -613,11 +609,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsHeatTransferCoefficientUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public HeatTransferCoefficient ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 3ae886b897..cd6e2bac47 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -604,11 +604,7 @@ public double As(IlluminanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -646,11 +642,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIlluminanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Illuminance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index b5675c8f0a..7fc48b55e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -933,11 +933,7 @@ public double As(InformationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -975,11 +971,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsInformationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Information ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 77b95d4a7f..16922f5b5f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -751,11 +751,7 @@ public double As(IrradianceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -793,11 +789,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIrradianceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Irradiance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 599f974592..67b4a8b0d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -634,11 +634,7 @@ public double As(IrradiationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -676,11 +672,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsIrradiationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Irradiation ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 57309282a4..05df70d5c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -664,11 +664,7 @@ public double As(KinematicViscosityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -706,11 +702,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsKinematicViscosityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public KinematicViscosity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 66a6a22350..723c45a665 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -556,11 +556,7 @@ public double As(LapseRateUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -598,11 +594,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLapseRateUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public LapseRate ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index ebc29fb4ee..d18ff4d489 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -871,11 +871,7 @@ public double As(LengthUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -913,11 +909,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLengthUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Length ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index b468073bb0..89dbae5294 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -579,11 +579,7 @@ public double As(LevelUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -621,11 +617,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLevelUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Level ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index d35acb6245..6d79da7083 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -589,11 +589,7 @@ public double As(LinearDensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -631,11 +627,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLinearDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public LinearDensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index fb7086a3c6..5d63e04fc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(LuminousFluxUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLuminousFluxUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public LuminousFlux ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 5a77b114c2..0cba858036 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(LuminousIntensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsLuminousIntensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public LuminousIntensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index a84950292a..2afc8fcc1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -604,11 +604,7 @@ public double As(MagneticFieldUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -646,11 +642,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagneticFieldUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MagneticField ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 3b277304e4..34bb6039f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(MagneticFluxUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagneticFluxUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MagneticFlux ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 4e85ed8b0f..18c9e89f69 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(MagnetizationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMagnetizationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Magnetization ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index e15356d676..d9fe22d3b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -886,11 +886,7 @@ public double As(MassUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -928,11 +924,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Mass ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index dca6036624..5040d715a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1006,11 +1006,7 @@ public double As(MassFlowUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1048,11 +1044,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassFlowUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MassFlow ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index a78b91ab25..4747b10823 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -571,11 +571,7 @@ public double As(MassFluxUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -613,11 +609,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassFluxUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MassFlux ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 8bfa001953..a27c4bc844 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -961,11 +961,7 @@ public double As(MassMomentOfInertiaUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1003,11 +999,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMassMomentOfInertiaUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MassMomentOfInertia ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 45dfa1ce3a..d819d5d80e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(MolarEnergyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarEnergyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MolarEnergy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 768e16c9af..e59e8dca16 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(MolarEntropyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarEntropyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MolarEntropy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index fe583a8d69..bd50f4c167 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -721,11 +721,7 @@ public double As(MolarMassUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -763,11 +759,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarMassUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public MolarMass ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 3e2b2ab1f8..d10a7ad1ef 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -664,11 +664,7 @@ public double As(MolarityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -706,11 +702,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsMolarityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Molarity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 8436368420..c52a1096f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(PermeabilityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPermeabilityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Permeability ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 3caa9f4a3e..d51038f7e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(PermittivityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPermittivityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Permittivity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 4a8071231f..3a002dfa52 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -843,11 +843,7 @@ public double As(PowerUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -885,11 +881,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Power ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 45743d7235..2ac83f68e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1201,11 +1201,7 @@ public double As(PowerDensityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1243,11 +1239,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerDensityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public PowerDensity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index 8a825cf1d3..562592b0fb 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -579,11 +579,7 @@ public double As(PowerRatioUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -621,11 +617,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPowerRatioUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public PowerRatio ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index a899099a5a..0de7074a04 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1171,11 +1171,7 @@ public double As(PressureUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1213,11 +1209,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPressureUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Pressure ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 2d013bb33e..ec49601322 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -646,11 +646,7 @@ public double As(PressureChangeRateUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -688,11 +684,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsPressureChangeRateUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public PressureChangeRate ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 00f020bd58..d12482709f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -631,11 +631,7 @@ public double As(RatioUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -673,11 +669,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRatioUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Ratio ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 79ccd3697f..c29961197e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(ReactiveEnergyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsReactiveEnergyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ReactiveEnergy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 5d236ff886..26d2466eb0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -601,11 +601,7 @@ public double As(ReactivePowerUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -643,11 +639,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsReactivePowerUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ReactivePower ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 83ebf9aef6..202a6a4380 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(RotationalAccelerationUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalAccelerationUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public RotationalAcceleration ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index f8041f1531..8ef6744919 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -736,11 +736,7 @@ public double As(RotationalSpeedUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -778,11 +774,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalSpeedUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public RotationalSpeed ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 230eda2a4c..dff1e57325 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(RotationalStiffnessUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalStiffnessUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public RotationalStiffness ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index f1002934f6..9d383a99fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(RotationalStiffnessPerLengthUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsRotationalStiffnessPerLengthUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public RotationalStiffnessPerLength ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index e4f15fcc2f..6ae3c2670e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -559,11 +559,7 @@ public double As(SolidAngleUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -601,11 +597,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSolidAngleUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public SolidAngle ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 328ad281fa..a5951df916 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -679,11 +679,7 @@ public double As(SpecificEnergyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -721,11 +717,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificEnergyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public SpecificEnergy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 319d828fe7..0e299a4e98 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -661,11 +661,7 @@ public double As(SpecificEntropyUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -703,11 +699,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificEntropyUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public SpecificEntropy ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 8ed94ee111..36c84334b6 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -586,11 +586,7 @@ public double As(SpecificVolumeUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -628,11 +624,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificVolumeUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public SpecificVolume ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 1a2cf948fe..05fd09411b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -799,11 +799,7 @@ public double As(SpecificWeightUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -841,11 +837,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpecificWeightUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public SpecificWeight ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 362d30b7db..4256b48629 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1021,11 +1021,7 @@ public double As(SpeedUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1063,11 +1059,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsSpeedUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Speed ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index d5075906d3..03a77c1b13 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -615,11 +615,7 @@ public double As(TemperatureUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -657,11 +653,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Temperature ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 2cfb2b7eb2..fa688de4a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -691,11 +691,7 @@ public double As(TemperatureChangeRateUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -733,11 +729,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureChangeRateUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public TemperatureChangeRate ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1628460580..1d7a31ee83 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -661,11 +661,7 @@ public double As(TemperatureDeltaUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -703,11 +699,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTemperatureDeltaUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public TemperatureDelta ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 1a73f38658..ae7a939318 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -574,11 +574,7 @@ public double As(ThermalConductivityUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -616,11 +612,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsThermalConductivityUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ThermalConductivity ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 264bba9753..50b9bb7246 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -616,11 +616,7 @@ public double As(ThermalResistanceUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -658,11 +654,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsThermalResistanceUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public ThermalResistance ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 1c67b5eb44..ef0d12198e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -856,11 +856,7 @@ public double As(TorqueUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -898,11 +894,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsTorqueUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Torque ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 74cd00f448..1ca0fb4766 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -556,11 +556,7 @@ public double As(VitaminAUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -598,11 +594,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVitaminAUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public VitaminA ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 2a7d84452a..d824a5a61c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1216,11 +1216,7 @@ public double As(VolumeUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1258,11 +1254,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVolumeUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public Volume ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index ae4799fd75..8acf0a6ce8 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1261,11 +1261,7 @@ public double As(VolumeFlowUnit unit) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1303,11 +1299,7 @@ IQuantity IQuantity.ToUnit(Enum unit) return ToUnit(unitAsVolumeFlowUnit); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public VolumeFlow ToUnit(UnitSystem unitSystem) { if(unitSystem == null) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index fa1b6a673c..0bd4feccc7 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -982,11 +982,7 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return Convert.ToDouble(converted); } - /// - /// Converts the quantity value into units compatible with the given . - /// - /// The to convert the quantity value to. - /// The converted value with units compatible with the given . + /// public double As(UnitSystem unitSystem) { if(unitSystem == null) @@ -1024,11 +1020,7 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return ToUnit(unitAs$unitEnumName); } - /// - /// Converts the quantity into a quantity which has units compatible with the given . - /// - /// The to convert the quantity to. - /// A new quantity with units compatible with the given . + /// public $quantityName ToUnit(UnitSystem unitSystem) { if(unitSystem == null)