From a67529e9e25a5bc55431ab223e4828bf2f442e97 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Tue, 12 Feb 2019 21:43:37 +0100 Subject: [PATCH 01/10] Duplicate source code into WRC - compiles OK --- .../AmbiguousUnitParseException.cs | 52 + .../AssemblyInfo.cs | 23 + .../BaseDimensions.cs | 264 ++++ UnitsNet.WindowsRuntimeComponent/BaseUnits.cs | 177 +++ .../Comparison.cs | 143 ++ .../ComparisonType.cs | 39 + .../CustomCode/GlobalConfiguration.cs | 42 + .../Quantities/Acceleration.extra.cs | 49 + .../Quantities/AmplitudeRatio.extra.cs | 104 ++ .../CustomCode/Quantities/Angle.extra.cs | 49 + .../CustomCode/Quantities/Area.extra.cs | 69 + .../BrakeSpecificFuelConsumption.extra.cs | 52 + .../CustomCode/Quantities/Density.extra.cs | 87 ++ .../CustomCode/Quantities/Duration.extra.cs | 117 ++ .../Quantities/DynamicViscosity.extra.cs | 43 + .../Quantities/ElectricPotential.extra.cs | 51 + .../CustomCode/Quantities/Force.extra.cs | 80 ++ .../Quantities/ForcePerLength.extra.cs | 52 + .../CustomCode/Quantities/HeatFlux.extra.cs | 42 + .../Quantities/KinematicViscosity.extra.cs | 69 + .../CustomCode/Quantities/LapseRate.extra.cs | 49 + .../CustomCode/Quantities/Length.extra.cs | 221 ++++ .../CustomCode/Quantities/Level.extra.cs | 59 + .../CustomCode/Quantities/Mass.extra.cs | 141 ++ .../CustomCode/Quantities/MassFlow.extra.cs | 93 ++ .../CustomCode/Quantities/MassFlux.extra.cs | 49 + .../CustomCode/Quantities/Molarity.extra.cs | 51 + .../CustomCode/Quantities/Power.extra.cs | 113 ++ .../CustomCode/Quantities/PowerRatio.extra.cs | 98 ++ .../CustomCode/Quantities/Pressure.extra.cs | 57 + .../Quantities/RotationalSpeed.extra.cs | 59 + .../Quantities/RotationalStiffness.extra.cs | 52 + .../RotationalStiffnessPerLength.extra.cs | 42 + .../Quantities/SpecificEnergy.extra.cs | 62 + .../Quantities/SpecificVolume.extra.cs | 48 + .../Quantities/SpecificWeight.extra.cs | 52 + .../CustomCode/Quantities/Speed.extra.cs | 89 ++ .../Quantities/Temperature.extra.cs | 114 ++ .../Quantities/TemperatureDelta.extra.cs | 52 + .../CustomCode/Quantities/Torque.extra.cs | 57 + .../CustomCode/Quantities/Volume.extra.cs | 64 + .../CustomCode/Quantities/VolumeFlow.extra.cs | 69 + .../CustomCode/Quantity.cs | 88 ++ .../CustomCode/QuantityParser.cs | 241 ++++ .../CustomCode/UnitAbbreviationsCache.cs | 390 ++++++ .../CustomCode/UnitParser.cs | 215 +++ .../CustomCode/UnitValueAbbreviationLookup.cs | 98 ++ .../GeneratedCode/Quantity.g.cs | 720 ++++++++++ .../GeneratedCode/QuantityType.g.cs | 142 ++ .../GeneratedCode/UnitAbbreviationsCache.g.cs | 1154 +++++++++++++++++ .../GeneratedCode/Units/AccelerationUnit.g.cs | 63 + .../Units/AmountOfSubstanceUnit.g.cs | 65 + .../Units/AmplitudeRatioUnit.g.cs | 54 + .../GeneratedCode/Units/AngleUnit.g.cs | 64 + .../Units/ApparentEnergyUnit.g.cs | 53 + .../Units/ApparentPowerUnit.g.cs | 54 + .../GeneratedCode/Units/AreaDensityUnit.g.cs | 51 + .../Units/AreaMomentOfInertiaUnit.g.cs | 56 + .../GeneratedCode/Units/AreaUnit.g.cs | 63 + .../GeneratedCode/Units/BitRateUnit.g.cs | 76 ++ .../BrakeSpecificFuelConsumptionUnit.g.cs | 57 + .../GeneratedCode/Units/CapacitanceUnit.g.cs | 57 + .../CoefficientOfThermalExpansionUnit.g.cs | 53 + .../GeneratedCode/Units/DensityUnit.g.cs | 89 ++ .../GeneratedCode/Units/DurationUnit.g.cs | 60 + .../Units/DynamicViscosityUnit.g.cs | 56 + .../Units/ElectricAdmittanceUnit.g.cs | 54 + .../Units/ElectricChargeDensityUnit.g.cs | 51 + .../Units/ElectricChargeUnit.g.cs | 51 + .../Units/ElectricConductanceUnit.g.cs | 53 + .../Units/ElectricConductivityUnit.g.cs | 51 + .../Units/ElectricCurrentDensityUnit.g.cs | 51 + .../Units/ElectricCurrentGradientUnit.g.cs | 51 + .../Units/ElectricCurrentUnit.g.cs | 58 + .../Units/ElectricFieldUnit.g.cs | 51 + .../Units/ElectricInductanceUnit.g.cs | 54 + .../Units/ElectricPotentialAcUnit.g.cs | 55 + .../Units/ElectricPotentialDcUnit.g.cs | 55 + .../Units/ElectricPotentialUnit.g.cs | 55 + .../Units/ElectricResistanceUnit.g.cs | 55 + .../Units/ElectricResistivityUnit.g.cs | 64 + .../GeneratedCode/Units/EnergyUnit.g.cs | 72 + .../GeneratedCode/Units/EntropyUnit.g.cs | 57 + .../Units/ForceChangeRateUnit.g.cs | 61 + .../Units/ForcePerLengthUnit.g.cs | 59 + .../GeneratedCode/Units/ForceUnit.g.cs | 63 + .../GeneratedCode/Units/FrequencyUnit.g.cs | 58 + .../GeneratedCode/Units/HeatFluxUnit.g.cs | 68 + .../Units/HeatTransferCoefficientUnit.g.cs | 52 + .../GeneratedCode/Units/IlluminanceUnit.g.cs | 54 + .../GeneratedCode/Units/InformationUnit.g.cs | 76 ++ .../GeneratedCode/Units/IrradianceUnit.g.cs | 64 + .../GeneratedCode/Units/IrradiationUnit.g.cs | 54 + .../Units/KinematicViscosityUnit.g.cs | 58 + .../GeneratedCode/Units/LapseRateUnit.g.cs | 51 + .../GeneratedCode/Units/LengthUnit.g.cs | 72 + .../GeneratedCode/Units/LevelUnit.g.cs | 52 + .../Units/LinearDensityUnit.g.cs | 53 + .../GeneratedCode/Units/LuminousFluxUnit.g.cs | 51 + .../Units/LuminousIntensityUnit.g.cs | 51 + .../Units/MagneticFieldUnit.g.cs | 54 + .../GeneratedCode/Units/MagneticFluxUnit.g.cs | 51 + .../Units/MagnetizationUnit.g.cs | 51 + .../GeneratedCode/Units/MassFlowUnit.g.cs | 81 ++ .../GeneratedCode/Units/MassFluxUnit.g.cs | 52 + .../Units/MassMomentOfInertiaUnit.g.cs | 78 ++ .../GeneratedCode/Units/MassUnit.g.cs | 117 ++ .../GeneratedCode/Units/MolarEnergyUnit.g.cs | 53 + .../GeneratedCode/Units/MolarEntropyUnit.g.cs | 53 + .../GeneratedCode/Units/MolarMassUnit.g.cs | 62 + .../GeneratedCode/Units/MolarityUnit.g.cs | 58 + .../GeneratedCode/Units/PermeabilityUnit.g.cs | 51 + .../GeneratedCode/Units/PermittivityUnit.g.cs | 51 + .../GeneratedCode/Units/PowerDensityUnit.g.cs | 94 ++ .../GeneratedCode/Units/PowerRatioUnit.g.cs | 52 + .../GeneratedCode/Units/PowerUnit.g.cs | 70 + .../Units/PressureChangeRateUnit.g.cs | 57 + .../GeneratedCode/Units/PressureUnit.g.cs | 92 ++ .../GeneratedCode/Units/RatioUnit.g.cs | 56 + .../Units/ReactiveEnergyUnit.g.cs | 53 + .../Units/ReactivePowerUnit.g.cs | 54 + .../Units/RotationalAccelerationUnit.g.cs | 53 + .../Units/RotationalSpeedUnit.g.cs | 63 + .../RotationalStiffnessPerLengthUnit.g.cs | 53 + .../Units/RotationalStiffnessUnit.g.cs | 53 + .../GeneratedCode/Units/SolidAngleUnit.g.cs | 51 + .../Units/SpecificEnergyUnit.g.cs | 59 + .../Units/SpecificEntropyUnit.g.cs | 58 + .../Units/SpecificVolumeUnit.g.cs | 53 + .../Units/SpecificWeightUnit.g.cs | 67 + .../GeneratedCode/Units/SpeedUnit.g.cs | 82 ++ .../Units/TemperatureChangeRateUnit.g.cs | 60 + .../Units/TemperatureDeltaUnit.g.cs | 58 + .../GeneratedCode/Units/TemperatureUnit.g.cs | 58 + .../Units/ThermalConductivityUnit.g.cs | 52 + .../Units/ThermalResistanceUnit.g.cs | 55 + .../GeneratedCode/Units/TorqueUnit.g.cs | 71 + .../GeneratedCode/Units/VitaminAUnit.g.cs | 51 + .../GeneratedCode/Units/VolumeFlowUnit.g.cs | 98 ++ .../GeneratedCode/Units/VolumeUnit.g.cs | 95 ++ UnitsNet.WindowsRuntimeComponent/IQuantity.cs | 165 +++ .../InternalHelpers/Guard.cs | 47 + .../ReflectionBridgeExtensions.cs | 107 ++ .../AssemblyInfo.WindowsRuntimeComponent.cs | 0 .../QuantityInfo.cs | 173 +++ .../QuantityNotFoundException.cs | 49 + .../QuantityValue.cs | 113 ++ .../Scripts/GenerateUnits.ps1 | 335 +++++ .../Include-GenerateQuantitySourceCode.ps1 | 1127 ++++++++++++++++ ...Include-GenerateQuantityTypeSourceCode.ps1 | 61 + ...clude-GenerateStaticQuantitySourceCode.ps1 | 205 +++ .../Scripts/Include-GenerateTemplates.ps1 | 13 + ...de-GenerateUnitSystemDefaultSourceCode.ps1 | 79 ++ ...de-GenerateUnitTestBaseClassSourceCode.ps1 | 318 +++++ ...-GenerateUnitTestPlaceholderSourceCode.ps1 | 56 + .../Include-GenerateUnitTypeSourceCode.ps1 | 74 ++ .../Scripts/Types.psm1 | 43 + .../UnitConverter.cs | 456 +++++++ .../UnitFormatter.cs | 99 ++ UnitsNet.WindowsRuntimeComponent/UnitInfo.cs | 80 ++ .../UnitNotFoundException.cs | 49 + .../UnitSystem.cs | 125 ++ .../UnitsNet.WindowsRuntimeComponent.csproj | 16 +- .../UnitsNet.csproj | 61 + .../UnitsNetException.cs | 48 + 165 files changed, 15665 insertions(+), 13 deletions(-) create mode 100644 UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/AssemblyInfo.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/BaseUnits.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/Comparison.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/ComparisonType.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/UnitValueAbbreviationLookup.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/QuantityType.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AccelerationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmountOfSubstanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmplitudeRatioUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AngleUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentEnergyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentPowerUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaDensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaMomentOfInertiaUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BitRateUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BrakeSpecificFuelConsumptionUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CapacitanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DurationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DynamicViscosityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricAdmittanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeDensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductivityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentDensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentGradientUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricFieldUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricInductanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialAcUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialDcUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistivityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EnergyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EntropyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceChangeRateUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForcePerLengthUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/FrequencyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatFluxUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IlluminanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/InformationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradianceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradiationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/KinematicViscosityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LapseRateUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LengthUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LevelUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LinearDensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousFluxUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousIntensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFieldUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFluxUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagnetizationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFlowUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFluxUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassMomentOfInertiaUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEnergyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEntropyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarMassUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermeabilityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermittivityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerDensityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerRatioUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureChangeRateUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RatioUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactiveEnergyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactivePowerUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalAccelerationUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalSpeedUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessPerLengthUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SolidAngleUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEnergyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEntropyUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificVolumeUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificWeightUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpeedUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureChangeRateUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureDeltaUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalConductivityUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalResistanceUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TorqueUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VitaminAUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeFlowUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeUnit.g.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/IQuantity.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/InternalHelpers/Guard.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/InternalHelpers/ReflectionBridgeExtensions.cs rename {UnitsNet => UnitsNet.WindowsRuntimeComponent}/Properties/AssemblyInfo.WindowsRuntimeComponent.cs (100%) create mode 100644 UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/QuantityValue.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantityTypeSourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateTemplates.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitSystemDefaultSourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestPlaceholderSourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTypeSourceCode.ps1 create mode 100644 UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitConverter.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitFormatter.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitInfo.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitSystem.cs create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitsNet.csproj create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs diff --git a/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs b/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs new file mode 100644 index 0000000000..c59a5a5e12 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +namespace UnitsNet +{ + /// + /// Unable to parse because more than one unit of the given quantity type had this exact unit abbreviation. + /// Example: Length.Parse("1 pt") will throw , because both + /// and + /// have "pt" as their abbreviation. + /// +#if WINDOWS_UWP + internal +#else + public +#endif + class AmbiguousUnitParseException : UnitsNetException + { + /// + public AmbiguousUnitParseException(string message) : base(message) + { + HResult = 2; + } + + /// + public AmbiguousUnitParseException(string message, Exception innerException) : base(message, innerException) + { + HResult = 2; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/AssemblyInfo.cs b/UnitsNet.WindowsRuntimeComponent/AssemblyInfo.cs new file mode 100644 index 0000000000..5dbb027a27 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/AssemblyInfo.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +[assembly: CLSCompliant(true)] diff --git a/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs b/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs new file mode 100644 index 0000000000..6ce00d968b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs @@ -0,0 +1,264 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Text; +using System.Linq; + +namespace UnitsNet +{ + /// + /// Represents the base dimensions of a quantity. + /// + public sealed class BaseDimensions + { + /// + public BaseDimensions(int length, int mass, int time, int current, int temperature, int amount, int luminousIntensity) + { + Length = length; + Mass = mass; + Time = time; + Current = current; + Temperature = temperature; + Amount = amount; + LuminousIntensity = luminousIntensity; + } + + /// + /// Checks if the dimensions represent a base quantity. + /// + /// True if the dimensions represent a base quantity, otherwise false. + public bool IsBaseQuantity() + { + var dimensionsArray = new int[]{Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}; + bool onlyOneEqualsOne = dimensionsArray.Where(dimension => dimension == 1).Take(2).Count() == 1; + return onlyOneEqualsOne; + } + + /// + /// Checks if the dimensions represent a derived quantity. + /// + /// True if the dimensions represent a derived quantity, otherwise false. + public bool IsDerivedQuantity() + { + return !IsBaseQuantity() && !IsDimensionless(); + } + + /// + /// Checks if this base dimensions object represents a dimensionless quantity. + /// + /// True if this object represents a dimensionless quantity, otherwise false. + public bool IsDimensionless() + { + return this == Dimensionless; + } + + /// + public override bool Equals(object obj) + { + if(obj is null || !(obj is BaseDimensions)) + return false; + + var other = (BaseDimensions)obj; + + return Length == other.Length && + Mass == other.Mass && + Time == other.Time && + Current == other.Current && + Temperature == other.Temperature && + Amount == other.Amount && + LuminousIntensity == other.LuminousIntensity; + } + + /// + public override int GetHashCode() + { + return new {Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}.GetHashCode(); + } + + /// + /// Get resulting dimensions after multiplying two dimensions, by performing addition of each dimension. + /// + /// Other dimensions. + /// Resulting dimensions. + public BaseDimensions Multiply(BaseDimensions right) + { + if(right is null) + throw new ArgumentNullException(nameof(right)); + + return new BaseDimensions( + Length + right.Length, + Mass + right.Mass, + Time + right.Time, + Current + right.Current, + Temperature + right.Temperature, + Amount + right.Amount, + LuminousIntensity + right.LuminousIntensity); + } + + /// + /// Get resulting dimensions after dividing two dimensions, by performing subtraction of each dimension. + /// + /// Other dimensions. + /// Resulting dimensions. + public BaseDimensions Divide(BaseDimensions right) + { + if(right is null) + throw new ArgumentNullException(nameof(right)); + + return new BaseDimensions( + Length - right.Length, + Mass - right.Mass, + Time - right.Time, + Current - right.Current, + Temperature - right.Temperature, + Amount - right.Amount, + LuminousIntensity - right.LuminousIntensity); + } + +#if !WINDOWS_UWP + + /// + /// Check if two dimensions are equal. + /// + /// Left. + /// Right. + /// True if equal. + public static bool operator ==(BaseDimensions left, BaseDimensions right) + { + return left is null ? right is null : left.Equals(right); + } + + /// + /// Check if two dimensions are unequal. + /// + /// Left. + /// Right. + /// True if not equal. + public static bool operator !=(BaseDimensions left, BaseDimensions right) + { + return !(left == right); + } + + /// + /// Multiply two dimensions. + /// + /// Left. + /// Right. + /// Resulting dimensions. + public static BaseDimensions operator *(BaseDimensions left, BaseDimensions right) + { + if(left is null) + throw new ArgumentNullException(nameof(left)); + else if(right is null) + throw new ArgumentNullException(nameof(right)); + + return left.Multiply(right); + } + + /// + /// Divide two dimensions. + /// + /// Left. + /// Right. + /// Resulting dimensions. + public static BaseDimensions operator /(BaseDimensions left, BaseDimensions right) + { + if(left is null) + throw new ArgumentNullException(nameof(left)); + else if(right is null) + throw new ArgumentNullException(nameof(right)); + + return left.Divide(right); + } + +#endif + + /// + public override string ToString() + { + var sb = new StringBuilder(); + + AppendDimensionString(sb, "Length", Length); + AppendDimensionString(sb, "Mass", Mass); + AppendDimensionString(sb, "Time", Time); + AppendDimensionString(sb, "Current", Current); + AppendDimensionString(sb, "Temperature", Temperature); + AppendDimensionString(sb, "Amount", Amount); + AppendDimensionString(sb, "LuminousIntensity", LuminousIntensity); + + return sb.ToString(); + } + + private static void AppendDimensionString(StringBuilder sb, string name, int value) + { + var absoluteValue = Math.Abs(value); + + if(absoluteValue > 0) + { + sb.AppendFormat("[{0}]", name); + + if(absoluteValue > 1) + sb.AppendFormat("^{0}", value); + } + } + + /// + /// Gets the length dimensions (L). + /// + public int Length { get; } + + /// + /// Gets the mass dimensions (M). + /// + public int Mass{ get; } + + /// + /// Gets the time dimensions (T). + /// + public int Time{ get; } + + /// + /// Gets the electric current dimensions (I). + /// + public int Current{ get; } + + /// + /// Gets the temperature dimensions (Θ). + /// + public int Temperature{ get; } + + /// + /// Gets the amount of substance dimensions (N). + /// + public int Amount{ get; } + + /// + /// Gets the luminous intensity dimensions (J). + /// + public int LuminousIntensity{ get; } + + /// + /// Represents a dimensionless (unitless) quantity. + /// + public static BaseDimensions Dimensionless { get; } = new BaseDimensions(0, 0, 0, 0, 0, 0, 0); + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs b/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs new file mode 100644 index 0000000000..16949c0ff6 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs @@ -0,0 +1,177 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Text; +using UnitsNet.Units; + +namespace UnitsNet +{ +#if !WINDOWS_UWP + public sealed partial class BaseUnits : IEquatable { } +#endif + + /// + /// Represents the base units for a quantity. All quantities, both base and derived, can be + /// represented by a combination of these seven base units. + /// + public sealed partial class BaseUnits + { + /// + /// Creates an instance of if the base units class that represents the base units for a quantity. + /// All quantities, both base and derived, can be represented by a combination of these seven base units. + /// + /// The length unit (L). + /// The mass unit (M). + /// The time unit (T). + /// The electric current unit (I). + /// The temperature unit (Θ). + /// The amount of substance unit (N). + /// The luminous intensity unit (J). + public BaseUnits(LengthUnit length, MassUnit mass, DurationUnit time, ElectricCurrentUnit current, + TemperatureUnit temperature, AmountOfSubstanceUnit amount, LuminousIntensityUnit luminousIntensity) + { + Length = length; + Mass = mass; + Time = time; + Current = current; + Temperature = temperature; + Amount = amount; + LuminousIntensity = luminousIntensity; + } + + /// + public override bool Equals(object obj) + { + if(obj is null || !(obj is BaseUnits)) + return false; + + return Equals((BaseUnits)obj); + } + + /// + /// Checks if all of the base units are equal to another instance's. + /// + /// The other instance to check if equal to. + /// True if equal, otherwise false. +#if WINDOWS_UWP + [Windows.Foundation.Metadata.DefaultOverload] +#endif + public bool Equals(BaseUnits other) + { + if(other is null) + return false; + + return Length == other.Length && + Mass == other.Mass && + Time == other.Time && + Current == other.Current && + Temperature == other.Temperature && + Amount == other.Amount && + LuminousIntensity == other.LuminousIntensity; + } + + /// + public override int GetHashCode() + { + return new {Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}.GetHashCode(); + } + +#if !WINDOWS_UWP + + /// + /// Checks if this instance is equal to another. + /// + /// The left instance. + /// The right instance. + /// True if equal, otherwise false. + /// + public static bool operator ==(BaseUnits left, BaseUnits right) + { + return left is null ? right is null : left.Equals(right); + } + + /// + /// Checks if this instance is not equal to another. + /// + /// The left instance. + /// The right instance. + /// True if not equal, otherwise false. + /// + public static bool operator !=(BaseUnits left, BaseUnits right) + { + return !(left == right); + } + +#endif + + /// + public override string ToString() + { + var sb = new StringBuilder(); + + sb.AppendFormat("[Length]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Length)); + sb.AppendFormat("[Mass]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Mass)); + sb.AppendFormat("[Time]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Time)); + sb.AppendFormat("[Current]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Current)); + sb.AppendFormat("[Temperature]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Temperature)); + sb.AppendFormat("[Amount]: {0}, ", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(Amount)); + sb.AppendFormat("[LuminousIntensity]: {0}", UnitAbbreviationsCache.Default.GetDefaultAbbreviation(LuminousIntensity)); + + return sb.ToString(); + } + + /// + /// Gets the length unit (L). + /// + public LengthUnit Length { get; } + + /// + /// Gets the mass unit (M). + /// + public MassUnit Mass{ get; } + + /// + /// Gets the time unit (T). + /// + public DurationUnit Time{ get; } + + /// + /// Gets the electric current unit (I). + /// + public ElectricCurrentUnit Current{ get; } + + /// + /// Gets the temperature unit (Θ). + /// + public TemperatureUnit Temperature{ get; } + + /// + /// Gets the amount of substance unit (N). + /// + public AmountOfSubstanceUnit Amount{ get; } + + /// + /// Gets the luminous intensity unit (J). + /// + public LuminousIntensityUnit LuminousIntensity{ get; } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/Comparison.cs b/UnitsNet.WindowsRuntimeComponent/Comparison.cs new file mode 100644 index 0000000000..acf4add944 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Comparison.cs @@ -0,0 +1,143 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ + /// + /// Helper methods to perform relative and absolute comparison. + /// + public static class Comparison + { + /// + /// + /// Checks if two values are equal with a given relative or absolute tolerance. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between + /// and + /// as a percentage of . A relative tolerance of + /// 0.01 means the + /// absolute difference of and must be within +/- + /// 1%. + /// + /// In this example, the two values will be equal if the value of b is within +/- 1% of a. + /// + /// Equals(a, b, 0.01, ComparisonType.Relative); + /// + /// + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between + /// and + /// as a fixed number. + /// + /// In this example, the two values will be equal if abs( - + /// ) <= 0.01 + /// + /// Equals(a, b, 0.01, ComparisonType.Absolute); + /// + /// + /// + /// + /// + /// The reference value. If using relative tolerance, it is the value which the relative + /// tolerance will be calculated against. + /// + /// The value to compare to. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. + /// Whether the tolerance is absolute or relative. + /// + public static bool Equals(double referenceValue, double otherValue, double tolerance, ComparisonType comparisonType) + { + if (tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + + switch (comparisonType) + { + case ComparisonType.Relative: + return EqualsRelative(referenceValue, otherValue, tolerance); + case ComparisonType.Absolute: + return EqualsAbsolute(referenceValue, otherValue, tolerance); + default: + throw new InvalidOperationException("The given ComparisonType is not supported."); + } + } + + /// + /// Checks if two values are equal with a given relative tolerance. + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between + /// and + /// as a percentage of . A relative tolerance of + /// 0.01 means the + /// absolute difference of and must be within +/- + /// 1%. + /// + /// In this example, the two values will be equal if the value of b is within +/- 1% of a. + /// + /// EqualsRelative(a, b, 0.01); + /// + /// + /// + /// + /// The reference value which the tolerance will be calculated against. + /// The value to compare to. + /// The relative tolerance. Must be greater than or equal to 0. + /// True if the two values are equal within the given relative tolerance, otherwise false. + public static bool EqualsRelative(double referenceValue, double otherValue, double tolerance) + { + if (tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + + var maxVariation = Math.Abs(referenceValue * tolerance); + return Math.Abs(referenceValue - otherValue) <= maxVariation; + } + + /// + /// Checks if two values are equal with a given absolute tolerance. + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between + /// and + /// as a fixed number. + /// + /// In this example, the two values will be equal if abs( - + /// ) <= 0.01 + /// + /// Equals(a, b, 0.01, ComparisonType.Absolute); + /// + /// + /// + /// + /// The first value. + /// The second value. + /// The absolute tolerance. Must be greater than or equal to 0. + /// True if the two values are equal within the given absolute tolerance, otherwise false. + public static bool EqualsAbsolute(double value1, double value2, double tolerance) + { + if (tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + + return Math.Abs(value1 - value2) <= tolerance; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/ComparisonType.cs b/UnitsNet.WindowsRuntimeComponent/ComparisonType.cs new file mode 100644 index 0000000000..978de56398 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/ComparisonType.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace UnitsNet +{ + /// + /// Specifies if the comparison between numbers is absolute or relative. + /// + public enum ComparisonType + { + /// + /// Error margin in relative size to a reference value. + /// + Relative, + + /// + /// Error margin as absolute size. + /// + Absolute + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs new file mode 100644 index 0000000000..396eb0ca07 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Globalization; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + public sealed class GlobalConfiguration + { + /// + /// Defaults to when creating an instance with no culture provided. + /// Can be overridden, but note that this is static and will affect all subsequent usages. + /// +#if WINDOWS_UWP + // Windows Runtime Component does not support exposing the IFormatProvider type in public API + internal +#else + public +#endif + static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs new file mode 100644 index 0000000000..d4f20f0030 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace + +using System; +using UnitsNet.Units; + +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Acceleration +#else + public partial struct Acceleration +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + /// + /// Multiply and to get . + /// + public static SpecificWeight operator *(Acceleration acceleration, Density density) + { + return new SpecificWeight(acceleration.MetersPerSecondSquared * density.KilogramsPerCubicMeter, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs new file mode 100644 index 0000000000..0e68fb595b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs @@ -0,0 +1,104 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class AmplitudeRatio +#else + public partial struct AmplitudeRatio +#endif + { + /// + /// Initializes a new instance of the struct from the specified electric potential + /// referenced to one volt RMS. This assumes both the specified electric potential and the one volt reference have the + /// same + /// resistance. + /// + /// The electric potential referenced to one volt. + + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + AmplitudeRatio(ElectricPotential voltage) + : this() + { + if (voltage.Volts <= 0) + throw new ArgumentOutOfRangeException( + nameof(voltage), + "The base-10 logarithm of a number ≤ 0 is undefined. Voltage must be greater than 0 V."); + + // E(dBV) = 20*log10(value(V)/reference(V)) + _value = 20 * Math.Log10(voltage.Volts / 1); + _unit = AmplitudeRatioUnit.DecibelVolt; + } + + /// + /// Gets an from this . + /// + /// + /// Provides a nicer syntax for converting an amplitude ratio back to a voltage. + /// + /// var voltage = voltageRatio.ToElectricPotential(); + /// + /// + public ElectricPotential ToElectricPotential() + { + // E(V) = 1V * 10^(E(dBV)/20) + return ElectricPotential.FromVolts( Math.Pow( 10, DecibelVolts / 20 ) ); + } + + /// + /// Converts this to a . + /// + /// The input impedance of the load. This is usually 50, 75 or 600 ohms. + /// http://www.maximintegrated.com/en/app-notes/index.mvp/id/808 + public PowerRatio ToPowerRatio( ElectricResistance impedance ) + { + // P(dBW) = E(dBV) - 10*log10(Z(Ω)/1) + return PowerRatio.FromDecibelWatts( DecibelVolts - 10 * Math.Log10( impedance.Ohms / 1 ) ); + } + + #region Static Methods + + /// + /// Gets an in decibels (dB) relative to 1 volt RMS from an + /// . + /// + /// The voltage (electric potential) relative to one volt RMS. + public static AmplitudeRatio FromElectricPotential(ElectricPotential voltage) + { + return new AmplitudeRatio(voltage); + } + + #endregion + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs new file mode 100644 index 0000000000..68676d7e50 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Angle +#else + public partial struct Angle +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static RotationalSpeed operator /(Angle angle, TimeSpan timeSpan) + { + return RotationalSpeed.FromRadiansPerSecond(angle.Radians / timeSpan.TotalSeconds); + } + + public static RotationalSpeed operator /(Angle angle, Duration duration) + { + return RotationalSpeed.FromRadiansPerSecond(angle.Radians / duration.Seconds); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs new file mode 100644 index 0000000000..f6fc2770c4 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs @@ -0,0 +1,69 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Area +#else + public partial struct Area +#endif + { + #region Static Methods + + public static Area FromCircleDiameter(Length diameter) + { + var radius = Length.FromMeters(diameter.Meters / 2d); + return FromCircleRadius(radius); + } + + public static Area FromCircleRadius(Length radius) + { + return FromSquareMeters(Math.PI * radius.Meters * radius.Meters); + } + + #endregion + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Length operator /(Area area, Length length) + { + return Length.FromMeters(area.SquareMeters / length.Meters); + } + + public static MassFlow operator *(Area area, MassFlux massFlux) + { + return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); + } + + public static VolumeFlow operator *(Area area, Speed speed) + { + return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs new file mode 100644 index 0000000000..2a9e9a437e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class BrakeSpecificFuelConsumption +#else + public partial struct BrakeSpecificFuelConsumption +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static MassFlow operator *(BrakeSpecificFuelConsumption bsfc, Power power) + { + return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule*power.Watts); + } + + public static SpecificEnergy operator /(double value, BrakeSpecificFuelConsumption bsfc) + { + return SpecificEnergy.FromJoulesPerKilogram(value/bsfc.KilogramsPerJoule); + } + + public static double operator *(BrakeSpecificFuelConsumption bsfc, SpecificEnergy specificEnergy) + { + return specificEnergy.JoulesPerKilogram*bsfc.KilogramsPerJoule; + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs new file mode 100644 index 0000000000..6fd11240ff --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs @@ -0,0 +1,87 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Density +#else + public partial struct Density +#endif + { + /// + /// Gets from this . + /// + /// + public Molarity ToMolarity(Mass molecularWeight) + { + return Molarity.FromMolesPerCubicMeter(KilogramsPerCubicMeter / molecularWeight.Kilograms); + } + + #region Static Methods + + /// + /// Get from . + /// + /// + /// + public static Density FromMolarity(Molarity molarity, Mass molecularWeight) + { + return new Density(molarity.MolesPerCubicMeter * molecularWeight.Kilograms, DensityUnit.KilogramPerCubicMeter); + } + + #endregion + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Mass operator *(Density density, Volume volume) + { + return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); + } + + public static Mass operator *(Volume volume, Density density) + { + return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); + } + + public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) + { + return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); + } + + public static MassFlux operator *(Density density, Speed speed) + { + return MassFlux.FromKilogramsPerSecondPerSquareMeter(density.KilogramsPerCubicMeter * speed.MetersPerSecond); + } + + public static SpecificWeight operator *(Density density, Acceleration acceleration) + { + return new SpecificWeight(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared, SpecificWeightUnit.NewtonPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs new file mode 100644 index 0000000000..5748f67250 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs @@ -0,0 +1,117 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Duration +#else + public partial struct Duration +#endif + { + /// + /// Convert a Duration to a TimeSpan. + /// + /// Throws if the TimeSpan can't represent the Duration exactly + /// The TimeSpan with the same time as the duration + public TimeSpan ToTimeSpan() + { + if( Seconds > TimeSpan.MaxValue.TotalSeconds || + Seconds < TimeSpan.MinValue.TotalSeconds ) + throw new ArgumentOutOfRangeException( nameof( Duration ), "The duration is too large or small to fit in a TimeSpan" ); + return TimeSpan.FromSeconds( Seconds ); + } + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static DateTime operator +(DateTime time, Duration duration) + { + return time.AddSeconds(duration.Seconds); + } + + public static DateTime operator -(DateTime time, Duration duration) + { + return time.AddSeconds(-duration.Seconds); + } + + public static explicit operator TimeSpan(Duration duration) + { + return duration.ToTimeSpan(); + } + + public static explicit operator Duration(TimeSpan duration) + { + return FromSeconds(duration.TotalSeconds); + } + + public static bool operator <(Duration duration, TimeSpan timeSpan) + { + return duration.Seconds < timeSpan.TotalSeconds; + } + + public static bool operator >(Duration duration, TimeSpan timeSpan) + { + return duration.Seconds > timeSpan.TotalSeconds; + } + + public static bool operator <=(Duration duration, TimeSpan timeSpan) + { + return duration.Seconds <= timeSpan.TotalSeconds; + } + + public static bool operator >=(Duration duration, TimeSpan timeSpan) + { + return duration.Seconds >= timeSpan.TotalSeconds; + } + + public static bool operator <(TimeSpan timeSpan, Duration duration) + { + return timeSpan.TotalSeconds < duration.Seconds; + } + + public static bool operator >(TimeSpan timeSpan, Duration duration) + { + return timeSpan.TotalSeconds > duration.Seconds; + } + + public static bool operator <=(TimeSpan timeSpan, Duration duration) + { + return timeSpan.TotalSeconds <= duration.Seconds; + } + + public static bool operator >=(TimeSpan timeSpan, Duration duration) + { + return timeSpan.TotalSeconds >= duration.Seconds; + } + + public static Volume operator *(Duration duration, VolumeFlow volumeFlow) + { + return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs new file mode 100644 index 0000000000..33286fd870 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class DynamicViscosity +#else + public partial struct DynamicViscosity +#endif + { +// Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + + public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) + { + return KinematicViscosity.FromSquareMetersPerSecond(dynamicViscosity.NewtonSecondsPerMeterSquared / density.KilogramsPerCubicMeter); + } +#endif + } +} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs new file mode 100644 index 0000000000..6f1fc43ea7 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs @@ -0,0 +1,51 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class ElectricPotential +#else + public partial struct ElectricPotential +#endif + { + /// + /// Gets an in decibels (dB) relative to 1 volt RMS from this . + /// + /// + /// Provides a nicer syntax for converting a voltage to an amplitude ratio (relative to 1 volt RMS). + /// + /// var voltageRatio = voltage.ToAmplitudeRatio(); + /// + /// + public AmplitudeRatio ToAmplitudeRatio() + { + return AmplitudeRatio.FromElectricPotential(this); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs new file mode 100644 index 0000000000..f13fd8cbcd --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs @@ -0,0 +1,80 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Force +#else + public partial struct Force +#endif + { + public static Force FromPressureByArea(Pressure p, Area area) + { + double newtons = p.Pascals * area.SquareMeters; + return new Force(newtons, ForceUnit.Newton); + } + + public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) + { + return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared, ForceUnit.Newton); + } + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Power operator *(Force force, Speed speed) + { + return Power.FromWatts(force.Newtons * speed.MetersPerSecond); + } + + public static Power operator *(Speed speed, Force force) + { + return Power.FromWatts(force.Newtons * speed.MetersPerSecond); + } + + public static Acceleration operator /(Force force, Mass mass) + { + return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); + } + + public static Mass operator /(Force force, Acceleration mass) + { + return Mass.FromKilograms(force.Newtons / mass.MetersPerSecondSquared); + } + + public static Pressure operator /(Force force, Area area) + { + return Pressure.FromPascals(force.Newtons / area.SquareMeters); + } + + public static ForcePerLength operator /(Force force, Length length) + { + return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs new file mode 100644 index 0000000000..86d9642e54 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class ForcePerLength +#else + public partial struct ForcePerLength +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Force operator *(ForcePerLength forcePerLength, Length length) + { + return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); + } + + public static Length operator /(Force force, ForcePerLength forcePerLength) + { + return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); + } + + public static Pressure operator /(ForcePerLength forcePerLength, Length length) + { + return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); + } +#endif + } +} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs new file mode 100644 index 0000000000..2e8910ba43 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class HeatFlux +#else + public partial struct HeatFlux +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Power operator *(HeatFlux heatFlux, Area area) + { + return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs new file mode 100644 index 0000000000..72dbd14940 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs @@ -0,0 +1,69 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class KinematicViscosity +#else + public partial struct KinematicViscosity +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) + { + return Speed.FromMetersPerSecond(kinematicViscosity.SquareMetersPerSecond / length.Meters); + } + + public static Area operator *(KinematicViscosity kinematicViscosity, TimeSpan timeSpan) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); + } + + public static Area operator *(TimeSpan timeSpan, KinematicViscosity kinematicViscosity) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); + } + + public static Area operator *(KinematicViscosity kinematicViscosity, Duration duration) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); + } + + public static Area operator *(Duration duration, KinematicViscosity kinematicViscosity) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); + } + + public static DynamicViscosity operator *(KinematicViscosity kinematicViscosity, Density density) + { + return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs new file mode 100644 index 0000000000..ba34a2e828 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class LapseRate +#else + public partial struct LapseRate +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Length operator /(TemperatureDelta left, LapseRate right) + { + return Length.FromKilometers(left.Kelvins / right.DegreesCelciusPerKilometer); + } + + public static TemperatureDelta operator *(Length left, LapseRate right) => right * left; + + public static TemperatureDelta operator *(LapseRate left, Length right) + { + return TemperatureDelta.FromDegreesCelsius(left.DegreesCelciusPerKilometer * right.Kilometers); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs new file mode 100644 index 0000000000..7d9ba655d8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs @@ -0,0 +1,221 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Text.RegularExpressions; +using JetBrains.Annotations; +using UnitsNet.Units; + +#if WINDOWS_UWP +using Culture=System.String; +#else +using Culture=System.IFormatProvider; +#endif + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Length +#else + public partial struct Length +#endif + { + private const double InchesInOneFoot = 12; + + /// + /// Converts the length to a customary feet/inches combination. + /// + public FeetInches FeetInches + { + get + { + var inInches = Inches; + var feet = Math.Truncate(inInches / InchesInOneFoot); + var inches = inInches % InchesInOneFoot; + + return new FeetInches(feet, inches); + } + } + + /// + /// Get length from combination of feet and inches. + /// + public static Length FromFeetInches(double feet, double inches) + { + return FromInches(InchesInOneFoot*feet + inches); + } + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + + /// + /// Special parsing of feet/inches strings, commonly used. + /// 2 feet 4 inches is sometimes denoted as 2′−4″, 2′ 4″, 2′4″, 2 ft 4 in. + /// The apostrophe can be ′ and '. + /// The double prime can be ″ and ". + /// https://en.wikipedia.org/wiki/Foot_(unit) + /// + /// + /// Optionally specify the culture format numbers and localize unit abbreviations. Defaults to thread's culture. + /// Parsed length. + public static Length ParseFeetInches([NotNull] string str, IFormatProvider formatProvider = null) + { + if (str == null) throw new ArgumentNullException(nameof(str)); + if (!TryParseFeetInches(str, out Length result, formatProvider)) + { + // A bit lazy, but I didn't want to duplicate this edge case implementation just to get more narrow exception descriptions. + throw new FormatException("Unable to parse feet and inches. Expected format \"2' 4\"\" or \"2 ft 4 in\". Whitespace is optional."); + } + + return result; + } + + /// + /// Special parsing of feet/inches strings, commonly used. + /// 2 feet 4 inches is sometimes denoted as 2′−4″, 2′ 4″, 2′4″, 2 ft 4 in. + /// The apostrophe can be ′ and '. + /// The double prime can be ″ and ". + /// https://en.wikipedia.org/wiki/Foot_(unit) + /// + /// + /// Parsed length. + /// Optionally specify the culture format numbers and localize unit abbreviations. Defaults to thread's culture. + public static bool TryParseFeetInches([CanBeNull] string str, out Length result, IFormatProvider formatProvider = null) + { + if (str == null) + { + result = default; + return false; + } + + str = str.Trim(); + + // This succeeds if only feet or inches are given, not both + if (TryParse(str, formatProvider, out result)) + return true; + + var quantityParser = QuantityParser.Default; + string footRegex = quantityParser.CreateRegexPatternForUnit(LengthUnit.Foot, formatProvider, matchEntireString: false); + string inchRegex = quantityParser.CreateRegexPatternForUnit(LengthUnit.Inch, formatProvider, matchEntireString: false); + + // Match entire string exactly + string pattern = $@"^(?{footRegex})\s?(?{inchRegex})$"; + + var match = new Regex(pattern, RegexOptions.Singleline).Match(str); + if (!match.Success) return false; + + var feetGroup = match.Groups["feet"]; + var inchesGroup = match.Groups["inches"]; + if (TryParse(feetGroup.Value, formatProvider, out Length feet) && + TryParse(inchesGroup.Value, formatProvider, out Length inches)) + { + result = feet + inches; + return true; + } + + result = default; + return false; + } + + public static Speed operator /(Length length, TimeSpan timeSpan) + { + return Speed.FromMetersPerSecond(length.Meters/timeSpan.TotalSeconds); + } + + public static Speed operator /(Length length, Duration duration) + { + return Speed.FromMetersPerSecond(length.Meters/duration.Seconds); + } + + public static Duration operator /(Length length, Speed speed) + { + return Duration.FromSeconds(length.Meters/speed.MetersPerSecond); + } + + public static Area operator *(Length length1, Length length2) + { + return Area.FromSquareMeters(length1.Meters*length2.Meters); + } + + public static Volume operator *(Area area, Length length) + { + return Volume.FromCubicMeters(area.SquareMeters*length.Meters); + } + + public static Volume operator *(Length length, Area area) + { + return Volume.FromCubicMeters(area.SquareMeters*length.Meters); + } + + public static Torque operator *(Force force, Length length) + { + return Torque.FromNewtonMeters(force.Newtons*length.Meters); + } + + public static Torque operator *(Length length, Force force) + { + return Torque.FromNewtonMeters(force.Newtons*length.Meters); + } + + public static KinematicViscosity operator *(Length length, Speed speed) + { + return KinematicViscosity.FromSquareMetersPerSecond(length.Meters*speed.MetersPerSecond); + } + + public static Pressure operator *(Length length, SpecificWeight specificWeight) + { + return new Pressure(length.Meters * specificWeight.NewtonsPerCubicMeter, PressureUnit.Pascal); + } +#endif + } + + public sealed class FeetInches + { + public FeetInches(double feet, double inches) + { + Feet = feet; + Inches = inches; + } + + public double Feet { get; } + public double Inches { get; } + + public override string ToString() + { + return ToString(null); + } + + public string ToString([CanBeNull] Culture cultureInfo) + { + // Note that it isn't customary to use fractions - one wouldn't say "I am 5 feet and 4.5 inches". + // So inches are rounded when converting from base units to feet/inches. + var footUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(LengthUnit.Foot); + var inchUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(LengthUnit.Inch); + + return string.Format(GlobalConfiguration.DefaultCulture, "{0:n0} {1} {2:n0} {3}", Feet, footUnit, Math.Round(Inches), + inchUnit); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs new file mode 100644 index 0000000000..b222bbcaf6 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. + // Cannot have methods with same name and same number of parameters. +#if !WINDOWS_UWP + public partial struct Level + { + /// + /// Initializes a new instance of the logarithmic struct which is the ratio of a quantity Q to a + /// reference value of that quantity Q0. + /// + /// The quantity. + /// The reference value that is compared to. + public Level(double quantity, double reference) + : this() + { + string errorMessage = + $"The base-10 logarithm of a number ≤ 0 is undefined ({quantity}/{reference})."; + + // ReSharper disable CompareOfFloatsByEqualityOperator + if (quantity == 0 || quantity < 0 && reference > 0) + throw new ArgumentOutOfRangeException(nameof(quantity), errorMessage); + if (reference == 0 || quantity > 0 && reference < 0) + throw new ArgumentOutOfRangeException(nameof(reference), errorMessage); + // ReSharper restore CompareOfFloatsByEqualityOperator + + _value = 10*Math.Log10(quantity/reference); + _unit = LevelUnit.Decibel; + } + } +#endif +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs new file mode 100644 index 0000000000..11fb195c63 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs @@ -0,0 +1,141 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using JetBrains.Annotations; +using UnitsNet.Units; + +#if WINDOWS_UWP +using Culture = System.String; +#else +using Culture = System.IFormatProvider; +#endif + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Mass +#else + public partial struct Mass +#endif + { + public static Mass FromGravitationalForce(Force f) + { + return new Mass(f.KilogramsForce, MassUnit.Kilogram); + } + + /// + /// StonePounds related code makes it easier to work with Stone/Pound combination, which are customarily used in the UK + /// to express body weight. For example, someone weighs 11 stone 4 pounds (about 72 kilograms). + /// + private const double StonesInOnePound = 14.0; + + /// + /// Converts the mass to a customary stone/pounds combination. + /// + public StonePounds StonePounds + { + get + { + var inPounds = Pounds; + + var stones = Math.Truncate(inPounds / StonesInOnePound); + var pounds = inPounds % StonesInOnePound; + + return new StonePounds(stones, pounds); + } + } + + /// + /// Get Mass from combination of stone and pounds. + /// + public static Mass FromStonePounds(double stone, double pounds) + { + return FromPounds(StonesInOnePound*stone + pounds); + } + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static MassFlow operator /(Mass mass, TimeSpan timeSpan) + { + return MassFlow.FromKilogramsPerSecond(mass.Kilograms/timeSpan.TotalSeconds); + } + + public static MassFlow operator /(Mass mass, Duration duration) + { + return MassFlow.FromKilogramsPerSecond(mass.Kilograms/duration.Seconds); + } + + public static Density operator /(Mass mass, Volume volume) + { + return Density.FromKilogramsPerCubicMeter(mass.Kilograms/volume.CubicMeters); + } + + public static Volume operator /(Mass mass, Density density) + { + return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter); + } + + public static Force operator *(Mass mass, Acceleration acceleration) + { + return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); + } + + public static Force operator *(Acceleration acceleration, Mass mass) + { + return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); + } +#endif + } + + public sealed class StonePounds + { + public StonePounds(double stone, double pounds) + { + Stone = stone; + Pounds = pounds; + } + + public double Stone { get; } + public double Pounds { get; } + + public override string ToString() + { + return ToString(null); + } + + public string ToString([CanBeNull] Culture cultureInfo) + { + // Note that it isn't customary to use fractions - one wouldn't say "I am 11 stone and 4.5 pounds". + // So pounds are rounded here. + + var stoneUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Stone); + var poundUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Pound); + + return string.Format(GlobalConfiguration.DefaultCulture, "{0:n0} {1} {2:n0} {3}", + Stone, stoneUnit, Math.Round(Pounds), poundUnit); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs new file mode 100644 index 0000000000..49288cfe60 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs @@ -0,0 +1,93 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class MassFlow +#else + public partial struct MassFlow +#endif + { +#if !WINDOWS_UWP + public static Mass operator *(MassFlow massFlow, TimeSpan time) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); + } + + public static Mass operator *(TimeSpan time, MassFlow massFlow) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); + } + + public static Mass operator *(MassFlow massFlow, Duration duration) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); + } + + public static Mass operator *(Duration duration, MassFlow massFlow) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); + } + + public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption bsfc) + { + return Power.FromWatts(massFlow.KilogramsPerSecond / bsfc.KilogramsPerJoule); + } + + public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) + { + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / power.Watts); + } + + public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) + { + return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); + } + + public static MassFlux operator /(MassFlow massFlow, Area area) + { + return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); + } + + public static Area operator /(MassFlow massFlow, MassFlux massFlux) + { + return Area.FromSquareMeters(massFlow.KilogramsPerSecond / massFlux.KilogramsPerSecondPerSquareMeter); + } + + public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) + { + return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); + } + + public static VolumeFlow operator /(MassFlow massFlow, Density density) + { + return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs new file mode 100644 index 0000000000..31062c283c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class MassFlux +#else + public partial struct MassFlux +#endif + { +#if !WINDOWS_UWP + public static Density operator /(MassFlux massFlux, Speed speed) + { + return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); + } + public static Speed operator /(MassFlux massFlux, Density density) + { + return Speed.FromMetersPerSecond(massFlux.KilogramsPerSecondPerSquareMeter / density.KilogramsPerCubicMeter); + } + public static MassFlow operator *(MassFlux massFlux, Area area) + { + return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs new file mode 100644 index 0000000000..9226caed22 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs @@ -0,0 +1,51 @@ +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Molarity +#else + public partial struct Molarity +#endif + { + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + Molarity(Density density, Mass molecularWeight) + : this() + { + _value = density.KilogramsPerCubicMeter / molecularWeight.Kilograms; + _unit = MolarityUnit.MolesPerCubicMeter; + } + + /// + /// Get a from this . + /// + /// + public Density ToDensity(Mass molecularWeight) + { + return Density.FromKilogramsPerCubicMeter(MolesPerCubicMeter * molecularWeight.Kilograms); + } + + #region Static Methods + + /// + /// Get from . + /// + /// + /// + public static Molarity FromDensity(Density density, Mass molecularWeight) + { + return new Molarity(density, molecularWeight); + } + + #endregion + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs new file mode 100644 index 0000000000..77b1616860 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs @@ -0,0 +1,113 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Power +#else + public partial struct Power +#endif + { + /// + /// Gets a from this relative to one watt. + /// + /// + /// Provides a nicer syntax for converting a power to a power ratio (relative to 1 watt). + /// + /// var powerRatio = power.ToPowerRatio(); + /// + /// + public PowerRatio ToPowerRatio() + { + return PowerRatio.FromPower(this); + } + + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Energy operator *(Power power, TimeSpan time) + { + return Energy.FromJoules(power.Watts * time.TotalSeconds); + } + + public static Energy operator *(TimeSpan time, Power power) + { + return Energy.FromJoules(power.Watts * time.TotalSeconds); + } + + public static Energy operator *(Power power, Duration duration) + { + return Energy.FromJoules(power.Watts * duration.Seconds); + } + + public static Energy operator *(Duration duration, Power power) + { + return Energy.FromJoules(power.Watts * duration.Seconds); + } + + public static Force operator /(Power power, Speed speed) + { + return Force.FromNewtons(power.Watts / speed.MetersPerSecond); + } + + public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) + { + return Torque.FromNewtonMeters(power.Watts / rotationalSpeed.RadiansPerSecond); + } + + public static RotationalSpeed operator /(Power power, Torque torque) + { + return RotationalSpeed.FromRadiansPerSecond(power.Watts / torque.NewtonMeters); + } + + public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption bsfc) + { + return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule * power.Watts); + } + + public static SpecificEnergy operator /(Power power, MassFlow massFlow) + { + return SpecificEnergy.FromJoulesPerKilogram(power.Watts / massFlow.KilogramsPerSecond); + } + + public static MassFlow operator /(Power power, SpecificEnergy specificEnergy) + { + return MassFlow.FromKilogramsPerSecond(power.Watts / specificEnergy.JoulesPerKilogram); + } + + public static HeatFlux operator /(Power power, Area area) + { + return HeatFlux.FromWattsPerSquareMeter(power.Watts / area.SquareMeters); + } + + public static Area operator /(Power power, HeatFlux heatFlux) + { + return Area.FromSquareMeters( power.Watts / heatFlux.WattsPerSquareMeter ); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs new file mode 100644 index 0000000000..4180da4d89 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class PowerRatio +#else + public partial struct PowerRatio +#endif + { + /// + /// Initializes a new instance of the struct from the specified power referenced to one watt. + /// + /// The power relative to one watt. + + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + PowerRatio(Power power) + : this() + { + if (power.Watts <= 0) + throw new ArgumentOutOfRangeException( + nameof(power), "The base-10 logarithm of a number ≤ 0 is undefined. Power must be greater than 0 W."); + + // P(dBW) = 10*log10(value(W)/reference(W)) + _value = 10 * Math.Log10(power.Watts / 1); + _unit = PowerRatioUnit.DecibelWatt; + } + + /// + /// Gets a from this (which is a power level relative to one watt). + /// + /// + /// Provides a nicer syntax for converting a power ratio back to a power. + /// + /// var power = powerRatio.ToPower(); + /// + /// + public Power ToPower() + { + // P(W) = 1W * 10^(P(dBW)/10) + return Power.FromWatts(Math.Pow(10, DecibelWatts / 10)); + } + + /// + /// Gets a from this . + /// + /// The input impedance of the load. This is usually 50, 75 or 600 ohms. + public AmplitudeRatio ToAmplitudeRatio(ElectricResistance impedance) + { + // E(dBV) = 10*log10(Z(Ω)/1) + P(dBW) + return AmplitudeRatio.FromDecibelVolts(10 * Math.Log10(impedance.Ohms / 1) + DecibelWatts); + } + + #region Static Methods + + /// + /// Gets a from a relative to one watt. + /// + /// The power relative to one watt. + public static PowerRatio FromPower(Power power) + { + return new PowerRatio(power); + } + + #endregion + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs new file mode 100644 index 0000000000..e85acc8212 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Pressure +#else + public partial struct Pressure +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Force operator *(Pressure pressure, Area area) + { + return Force.FromNewtons(pressure.Pascals * area.SquareMeters); + } + + public static Force operator *(Area area, Pressure pressure) + { + return Force.FromNewtons(pressure.Pascals * area.SquareMeters); + } + + public static Length operator /(Pressure pressure, SpecificWeight specificWeight) + { + return new Length(pressure.Pascals / specificWeight.NewtonsPerCubicMeter, UnitsNet.Units.LengthUnit.Meter); + } + + public static SpecificWeight operator /(Pressure pressure, Length length) + { + return new SpecificWeight(pressure.Pascals / length.Meters, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs new file mode 100644 index 0000000000..0afa95479d --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class RotationalSpeed +#else + public partial struct RotationalSpeed +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); + } + + public static Angle operator *(TimeSpan timeSpan, RotationalSpeed rotationalSpeed) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); + } + + public static Angle operator *(RotationalSpeed rotationalSpeed, Duration duration) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); + } + + public static Angle operator *(Duration duration, RotationalSpeed rotationalSpeed) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs new file mode 100644 index 0000000000..300276c10e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class RotationalStiffness +#else + public partial struct RotationalStiffness +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) + { + return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); + } + + public static RotationalStiffnessPerLength operator /(RotationalStiffness rotationalStiffness, Length length) + { + return RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(rotationalStiffness.NewtonMetersPerRadian / length.Meters); + } + + public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) + { + return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs new file mode 100644 index 0000000000..b4028483ed --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class RotationalStiffnessPerLength +#else + public partial struct RotationalStiffnessPerLength +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static RotationalStiffness operator *(RotationalStiffnessPerLength rotationalStiffness, Length length) + { + return RotationalStiffness.FromNewtonMetersPerRadian(rotationalStiffness.NewtonMetersPerRadianPerMeter * length.Meters); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs new file mode 100644 index 0000000000..a17a8a4fd4 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class SpecificEnergy +#else + public partial struct SpecificEnergy +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Energy operator *(SpecificEnergy specificEnergy, Mass mass) + { + return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); + } + + public static Energy operator *(Mass mass, SpecificEnergy specificEnergy) + { + return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); + } + + public static BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) + { + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); + } + + public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption bsfc) + { + return specificEnergy.JoulesPerKilogram * bsfc.KilogramsPerJoule; + } + + public static Power operator *(SpecificEnergy specificEnergy, MassFlow massFlow) + { + return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); + } +#endif + } +} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs new file mode 100644 index 0000000000..3df2036e99 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class SpecificVolume +#else + public partial struct SpecificVolume +#endif + { + +#if !WINDOWS_UWP + public static Density operator /(double constant, SpecificVolume volume) + { + return Density.FromKilogramsPerCubicMeter(constant / volume.CubicMetersPerKilogram); + } + + public static Volume operator *(SpecificVolume volume, Mass mass) + { + return Volume.FromCubicMeters(volume.CubicMetersPerKilogram * mass.Kilograms); + } + +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs new file mode 100644 index 0000000000..b9403d2107 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class SpecificWeight +#else + public partial struct SpecificWeight +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Pressure operator *(SpecificWeight specificWeight, Length length) + { + return new Pressure(specificWeight.NewtonsPerCubicMeter * length.Meters, UnitsNet.Units.PressureUnit.Pascal); + } + + public static Acceleration operator /(SpecificWeight specificWeight, Density density) + { + return new Acceleration(specificWeight.NewtonsPerCubicMeter / density.KilogramsPerCubicMeter, UnitsNet.Units.AccelerationUnit.MeterPerSecondSquared); + } + + public static Density operator /(SpecificWeight specific, Acceleration acceleration) + { + return new Density(specific.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared, UnitsNet.Units.DensityUnit.KilogramPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs new file mode 100644 index 0000000000..8e5eaab04d --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs @@ -0,0 +1,89 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Speed +#else + public partial struct Speed +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Acceleration operator /(Speed speed, TimeSpan timeSpan) + { + return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); + } + + public static Length operator *(Speed speed, TimeSpan timeSpan) + { + return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); + } + + public static Length operator *(TimeSpan timeSpan, Speed speed) + { + return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); + } + + public static Acceleration operator /(Speed speed, Duration duration) + { + return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / duration.Seconds); + } + + public static Length operator *(Speed speed, Duration duration) + { + return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); + } + + public static Length operator *(Duration duration, Speed speed) + { + return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); + } + + public static KinematicViscosity operator *(Speed speed, Length length) + { + return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); + } + + public static SpecificEnergy operator *(Speed left, Speed right) + { + return SpecificEnergy.FromJoulesPerKilogram(left.MetersPerSecond * right.MetersPerSecond); + } + + public static MassFlux operator *(Speed speed, Density density) + { + return MassFlux.FromKilogramsPerSecondPerSquareMeter(speed.MetersPerSecond * density.KilogramsPerCubicMeter); + } + + public static VolumeFlow operator *(Speed speed, Area area) + { + return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs new file mode 100644 index 0000000000..fed00fd718 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs @@ -0,0 +1,114 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Temperature +#else + public partial struct Temperature +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + /// + /// Add a and a . + /// + /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. + /// The new temperature. + public static Temperature operator +(Temperature left, TemperatureDelta right) + { + return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); + } + + /// + /// Add a and a . + /// + /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. + /// The new temperature. + public static Temperature operator +(TemperatureDelta left, Temperature right) + { + return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); + } + + /// + /// Subtract a by a . + /// + /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. + /// The new temperature. + public static Temperature operator -(Temperature left, TemperatureDelta right) + { + return new Temperature(left.Kelvins - right.Kelvins, TemperatureUnit.Kelvin); + } + + /// + /// Subtract a by a . + /// + /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. + /// The delta temperature (difference). + public static TemperatureDelta operator -(Temperature left, Temperature right) + { + return new TemperatureDelta(left.Kelvins - right.Kelvins, TemperatureDeltaUnit.Kelvin); + } +#endif + + /// + /// Multiply temperature with a in a given . + /// + /// + /// Due to different temperature units having different zero points, we cannot simply + /// multiply or divide a temperature by a factor. We must first convert to the desired unit, then perform the + /// calculation. + /// + /// Factor to multiply by. + /// Unit to perform multiplication in. + /// The resulting . + public Temperature Multiply(double factor, TemperatureUnit unit) + { + double resultInUnit = As(unit) * factor; + return From(resultInUnit, unit); + } + + + /// + /// Divide temperature by a in a given . + /// + /// + /// Due to different temperature units having different zero points, we cannot simply + /// multiply or divide a temperature by a factor. We must first convert to the desired unit, then perform the + /// calculation. + /// + /// Factor to multiply by. + /// Unit to perform multiplication in. + /// The resulting . + public Temperature Divide(double divisor, TemperatureUnit unit) + { + double resultInUnit = As(unit) / divisor; + return From(resultInUnit, unit); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs new file mode 100644 index 0000000000..4ec7201483 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class TemperatureDelta +#else + public partial struct TemperatureDelta +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static LapseRate operator /(TemperatureDelta left, Length right) + { + return LapseRate.FromDegreesCelciusPerKilometer(left.DegreesCelsius / right.Kilometers); + } + + public static SpecificEnergy operator *(SpecificEntropy specificEntropy, TemperatureDelta temperatureDelta) + { + return SpecificEnergy.FromJoulesPerKilogram(specificEntropy.JoulesPerKilogramKelvin * temperatureDelta.Kelvins); + } + + public static SpecificEnergy operator *(TemperatureDelta temperatureDelta, SpecificEntropy specificEntropy) + { + return specificEntropy * temperatureDelta; + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs new file mode 100644 index 0000000000..ded64d2ec5 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Torque +#else + public partial struct Torque +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Force operator /(Torque torque, Length length) + { + return Force.FromNewtons(torque.NewtonMeters / length.Meters); + } + + public static Length operator /(Torque torque, Force force) + { + return Length.FromMeters(torque.NewtonMeters / force.Newtons); + } + + public static RotationalStiffness operator /(Torque torque, Angle angle) + { + return RotationalStiffness.FromNewtonMetersPerRadian(torque.NewtonMeters / angle.Radians); + } + + public static Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) + { + return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs new file mode 100644 index 0000000000..8792faf783 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs @@ -0,0 +1,64 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class Volume +#else + public partial struct Volume +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Area operator /(Volume volume, Length length) + { + return Area.FromSquareMeters(volume.CubicMeters / length.Meters); + } + + public static Length operator /(Volume volume, Area area) + { + return Length.FromMeters(volume.CubicMeters / area.SquareMeters); + } + + public static VolumeFlow operator /(Volume volume, Duration duration) + { + return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / duration.Seconds); + } + + public static VolumeFlow operator /(Volume volume, TimeSpan timeSpan) + { + return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / timeSpan.TotalSeconds); + } + + public static TimeSpan operator /(Volume volume, VolumeFlow volumeFlow) + { + return TimeSpan.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs new file mode 100644 index 0000000000..2d31a4785e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs @@ -0,0 +1,69 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. +#if WINDOWS_UWP + public sealed partial class VolumeFlow +#else + public partial struct VolumeFlow +#endif + { + // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx +#if !WINDOWS_UWP + public static Volume operator *(VolumeFlow volumeFlow, TimeSpan timeSpan) + { + return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * timeSpan.TotalSeconds); + } + + public static Volume operator *(VolumeFlow volumeFlow, Duration duration) + { + return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); + } + + public static Speed operator /(VolumeFlow volumeFlow, Area area) + { + return Speed.FromMetersPerSecond(volumeFlow.CubicMetersPerSecond / area.SquareMeters); + } + + public static Area operator /(VolumeFlow volumeFlow, Speed speed) + { + return Area.FromSquareMeters(volumeFlow.CubicMetersPerSecond / speed.MetersPerSecond); + } + + public static MassFlow operator *(VolumeFlow volumeFlow, Density density) + { + return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); + } + + public static MassFlow operator *(Density density, VolumeFlow volumeFlow) + { + return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs new file mode 100644 index 0000000000..20002b116a --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnitsNet.InternalHelpers; + +#if WINDOWS_UWP + using FromValue = System.Double; +#else + using FromValue = UnitsNet.QuantityValue; +#endif + +namespace UnitsNet +{ +#if WINDOWS_UWP + internal +#else + public +#endif + partial class Quantity + { + private static readonly Lazy InfosLazy; + + static Quantity() + { + var quantityTypes = Enum.GetValues(typeof(QuantityType)).Cast().Except(new[] {QuantityType.Undefined}).ToArray(); + Types = quantityTypes; + Names = quantityTypes.Select(qt => qt.ToString()).ToArray(); + +#if !WINDOWS_UWP + // A bunch of reflection to enumerate quantity types, instantiate with the default constructor and return its QuantityInfo property + InfosLazy = new Lazy(() => typeof(Length) + .Wrap() + .Assembly + .GetExportedTypes() + .Where(typeof(IQuantity).IsAssignableFrom) + .Where(t => t.Wrap().IsClass || t.Wrap().IsValueType) // Future-proofing: Considering changing quantities from struct to class + .Select(Activator.CreateInstance) + .Cast() + .Select(q => q.QuantityInfo) + .OrderBy(q => q.Name) + .ToArray()); +#endif + } + + /// + /// All enum values of , such as and . + /// + public static QuantityType[] Types { get; } + + /// + /// All enum value names of , such as "Length" and "Mass". + /// + public static string[] Names { get; } + +#if !WINDOWS_UWP + /// + /// All quantity information objects, such as and . + /// + public static QuantityInfo[] Infos => InfosLazy.Value; +#endif + + /// + /// Dynamically construct a quantity. + /// + /// Numeric value. + /// Unit enum value. + /// An object. + /// Unit value is not a know unit enum type. +#if WINDOWS_UWP + internal static IQuantity From(FromValue value, Enum unit) +#else + public static IQuantity From(FromValue value, Enum unit) +#endif + { + if (TryFrom(value, unit, out IQuantity quantity)) + return quantity; + + throw new ArgumentException( + $"Unit value {unit} of type {unit.GetType()} is not a known unit enum type. Expected types like UnitsNet.Units.LengthUnit. Did you pass in a third-party enum type defined outside UnitsNet library?"); + } + + public static IEnumerable GetQuantitiesWithBaseDimensions(BaseDimensions baseDimensions) + { + return InfosLazy.Value.Where(info => info.BaseDimensions.Equals(baseDimensions)); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs new file mode 100644 index 0000000000..d58df984a1 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs @@ -0,0 +1,241 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Linq; +using System.Text.RegularExpressions; +using JetBrains.Annotations; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + +#if !WINDOWS_UWP + internal delegate TQuantity QuantityFromDelegate(QuantityValue value, TUnitType fromUnit) + where TQuantity : IQuantity + where TUnitType : Enum; +#else + internal delegate TQuantity QuantityFromDelegate(double value, TUnitType fromUnit) + where TQuantity : IQuantity + where TUnitType : Enum; +#endif + + internal class QuantityParser + { + /// + /// Allow integer, floating point or exponential number formats. + /// + private const NumberStyles ParseNumberStyles = NumberStyles.Number | NumberStyles.Float | NumberStyles.AllowExponent; + + private readonly UnitAbbreviationsCache _unitAbbreviationsCache; + private UnitParser _unitParser; + + public static QuantityParser Default { get; } + + public QuantityParser(UnitAbbreviationsCache unitAbbreviationsCache) + { + _unitAbbreviationsCache = unitAbbreviationsCache ?? UnitAbbreviationsCache.Default; + _unitParser = new UnitParser(_unitAbbreviationsCache); + } + + static QuantityParser() + { + Default = new QuantityParser(UnitAbbreviationsCache.Default); + } + + [SuppressMessage("ReSharper", "UseStringInterpolation")] + internal TQuantity Parse([NotNull] string str, + [CanBeNull] IFormatProvider formatProvider, + [NotNull] QuantityFromDelegate fromDelegate) + where TQuantity : IQuantity + where TUnitType : Enum + { + if (str == null) throw new ArgumentNullException(nameof(str)); + str = str.Trim(); + + var numFormat = formatProvider != null + ? (NumberFormatInfo) formatProvider.GetFormat(typeof(NumberFormatInfo)) + : NumberFormatInfo.CurrentInfo; + + if (numFormat == null) + throw new InvalidOperationException($"No number format was found for the given format provider: {formatProvider}"); + + var regex = CreateRegexForQuantity(formatProvider); + + if (!ExtractValueAndUnit(regex, str, out var valueString, out var unitString)) + { + var ex = new FormatException("Unable to parse quantity. Expected the form \"{value} {unit abbreviation}\", such as \"5.5 m\". The spacing is optional."); + ex.Data["input"] = str; + throw ex; + } + + return ParseWithRegex(valueString, unitString, fromDelegate, formatProvider); + } + + [SuppressMessage("ReSharper", "UseStringInterpolation")] + internal bool TryParse([NotNull] string str, + [CanBeNull] IFormatProvider formatProvider, + [NotNull] QuantityFromDelegate fromDelegate, + out TQuantity result) + where TQuantity : IQuantity + where TUnitType : Enum + { + result = default; + + if(string.IsNullOrWhiteSpace(str)) return false; + str = str.Trim(); + + var numFormat = formatProvider != null + ? (NumberFormatInfo) formatProvider.GetFormat(typeof(NumberFormatInfo)) + : NumberFormatInfo.CurrentInfo; + + if(numFormat == null) + return false; + + var regex = CreateRegexForQuantity(formatProvider); + + if (!ExtractValueAndUnit(regex, str, out var valueString, out var unitString)) + return false; + + return TryParseWithRegex(valueString, unitString, fromDelegate, formatProvider, out result); + } + + /// + /// Workaround for C# not allowing to pass on 'out' param from type Length to IQuantity, even though the are compatible. + /// + [SuppressMessage("ReSharper", "UseStringInterpolation")] + internal bool TryParse([NotNull] string str, + [CanBeNull] IFormatProvider formatProvider, + [NotNull] QuantityFromDelegate fromDelegate, + out IQuantity result) + where TQuantity : IQuantity + where TUnitType : Enum + { + if (TryParse(str, formatProvider, fromDelegate, out TQuantity parsedQuantity)) + { + result = parsedQuantity; + return true; + } + + result = default; + return false; + } + + internal string CreateRegexPatternForUnit( + TUnitType unit, + IFormatProvider formatProvider, + bool matchEntireString = true) + where TUnitType : Enum + { + var unitAbbreviations = _unitAbbreviationsCache.GetUnitAbbreviations(unit, formatProvider); + var pattern = GetRegexPatternForUnitAbbreviations(unitAbbreviations); + return matchEntireString ? $"^{pattern}$" : pattern; + } + + private static string GetRegexPatternForUnitAbbreviations(IEnumerable abbreviations) + { + var orderedAbbreviations = abbreviations + .OrderByDescending(s => s.Length) // Important to order by length -- if "m" is before "mm" and the input is "mm", it will match just "m" + .Select(Regex.Escape) // Escape special regex characters + .ToArray(); + + var abbreviationsPiped = $"{string.Join("|", orderedAbbreviations)}"; + return $@"(?.*?)\s?(?{abbreviationsPiped})"; + } + + /// + /// Parse a string given a particular regular expression. + /// + /// Error parsing string. + private TQuantity ParseWithRegex(string valueString, + string unitString, + QuantityFromDelegate fromDelegate, + IFormatProvider formatProvider) + where TQuantity : IQuantity + where TUnitType : Enum + { + var value = double.Parse(valueString, ParseNumberStyles, formatProvider); + var parsedUnit = _unitParser.Parse(unitString, formatProvider); + return fromDelegate(value, parsedUnit); + } + + /// + /// Parse a string given a particular regular expression. + /// + /// Error parsing string. + private bool TryParseWithRegex(string valueString, + string unitString, + QuantityFromDelegate fromDelegate, + IFormatProvider formatProvider, + out TQuantity result) + where TQuantity : IQuantity + where TUnitType : Enum + { + result = default; + + if (!double.TryParse(valueString, ParseNumberStyles, formatProvider, out var value)) + return false; + + if (!_unitParser.TryParse(unitString, formatProvider, out var parsedUnit)) + return false; + + result = fromDelegate(value, parsedUnit); + return true; + } + + private static bool ExtractValueAndUnit(Regex regex, string str, out string valueString, out string unitString) + { + var match = regex.Match(str); + var groups = match.Groups; + + var valueGroup = groups["value"]; + var unitGroup = groups["unit"]; + if (!valueGroup.Success || !unitGroup.Success) + { + valueString = null; + unitString = null; + return false; + } + + valueString = valueGroup.Value; + unitString = unitGroup.Value; + return true; + } + + private string CreateRegexPatternForQuantity(IFormatProvider formatProvider) where TUnitType : Enum + { + var unitAbbreviations = _unitAbbreviationsCache.GetAllUnitAbbreviationsForQuantity(typeof(TUnitType), formatProvider); + var pattern = GetRegexPatternForUnitAbbreviations(unitAbbreviations); + + // Match entire string exactly + return $"^{pattern}$"; + } + + private Regex CreateRegexForQuantity([CanBeNull] IFormatProvider formatProvider) where TUnitType : Enum + { + var pattern = CreateRegexPatternForQuantity(formatProvider); + return new Regex(pattern, RegexOptions.Singleline); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs new file mode 100644 index 0000000000..6e2ab49532 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs @@ -0,0 +1,390 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using JetBrains.Annotations; +using UnitsNet.InternalHelpers; +using UnitsNet.Units; + +using UnitTypeToLookup = System.Collections.Generic.Dictionary; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + public sealed partial class UnitAbbreviationsCache + { + private readonly Dictionary _lookupsForCulture; + + /// + /// Fallback culture used by and + /// if no abbreviations are found with a given culture. + /// + /// + /// User wants to call or with Russian + /// culture, but no translation is defined, so we return the US English definition as a last resort. If it's not + /// defined there either, an exception is thrown. + /// + private static readonly CultureInfo FallbackCulture = new CultureInfo("en-US"); + + public static UnitAbbreviationsCache Default { get; } + + public UnitAbbreviationsCache() + { + _lookupsForCulture = new Dictionary(); + + LoadGeneratedAbbreviations(); + } + + static UnitAbbreviationsCache() + { + Default = new UnitAbbreviationsCache(); + } + + private void LoadGeneratedAbbreviations() + { + foreach(var localization in GeneratedLocalizations) + { + var culture = new CultureInfo(localization.CultureName); + MapUnitToAbbreviation(localization.UnitType, localization.UnitValue, culture, localization.UnitAbbreviations); + } + } + + /// + /// Adds one or more unit abbreviation for the given unit enum value. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum value. + /// Unit abbreviations to add. + /// The type of unit enum. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviations) where TUnitType : Enum + { + MapUnitToAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviations); + } + + /// + /// Adds a unit abbreviation for the given unit enum value and sets it as the default. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum value. + /// Unit abbreviations to add as default. + /// The type of unit enum. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation) where TUnitType : Enum + { + MapUnitToDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviation); + } + + /// + /// Adds one or more unit abbreviation for the given unit enum value. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviations to add. + /// The type of unit enum. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToAbbreviation(TUnitType unit, IFormatProvider formatProvider, params string[] abbreviations) where TUnitType : Enum + { + // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. + // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer + // http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum + var unitValue = Convert.ToInt32(unit); + var unitType = typeof(TUnitType); + + MapUnitToAbbreviation(unitType, unitValue, formatProvider, abbreviations); + } + + /// + /// Adds a unit abbreviation for the given unit enum value and sets it as the default. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviation to add as default. + /// The type of unit enum. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider, string abbreviation) where TUnitType : Enum + { + // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. + // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer + // http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum + var unitValue = Convert.ToInt32(unit); + var unitType = typeof(TUnitType); + + MapUnitToDefaultAbbreviation(unitType, unitValue, formatProvider, abbreviation); + } + + /// + /// Adds one or more unit abbreviation for the given unit enum value. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum type. + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviations to add. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) + { + PerformAbbreviationMapping(unitType, unitValue, formatProvider, false, abbreviations); + } + + /// + /// Adds a unit abbreviation for the given unit enum value and sets it as the default. + /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums + /// in order to or on them later. + /// + /// The unit enum type. + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviation to add as default. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + void MapUnitToDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] string abbreviation) + { + PerformAbbreviationMapping(unitType, unitValue, formatProvider, true, abbreviation); + } + + private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatProvider formatProvider, bool setAsDefault, [NotNull] params string[] abbreviations) + { + if (!unitType.Wrap().IsEnum) + throw new ArgumentException("Must be an enum type.", nameof(unitType)); + + if (abbreviations == null) + throw new ArgumentNullException(nameof(abbreviations)); + + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + if (!_lookupsForCulture.TryGetValue(formatProvider, out var quantitiesForProvider)) + quantitiesForProvider = _lookupsForCulture[formatProvider] = new UnitTypeToLookup(); + + if (!quantitiesForProvider.TryGetValue(unitType, out var unitToAbbreviations)) + unitToAbbreviations = quantitiesForProvider[unitType] = new UnitValueAbbreviationLookup(); + + foreach (var abbr in abbreviations) + { + unitToAbbreviations.Add(unitValue, abbr, setAsDefault); + } + } + + /// + /// Gets the default abbreviation for a given unit. If a unit has more than one abbreviation defined, then it returns the first one. + /// Example: GetDefaultAbbreviation<LengthUnit>(LengthUnit.Kilometer) => "km" + /// + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// The type of unit enum. + /// The default unit abbreviation string. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + { + var unitType = typeof(TUnitType); + + if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) + { + if(formatProvider != FallbackCulture) + return GetDefaultAbbreviation(unit, FallbackCulture); + else + throw new NotImplementedException($"No abbreviation is specified for {unitType.Name}.{unit}"); + } + + var abbreviations = lookup.GetAbbreviationsForUnit(unit); + if(abbreviations.Count == 0) + { + if(formatProvider != FallbackCulture) + return GetDefaultAbbreviation(unit, FallbackCulture); + else + throw new NotImplementedException($"No abbreviation is specified for {unitType.Name}.{unit}"); + } + + return abbreviations.First(); + } + + /// + /// Gets the default abbreviation for a given unit type and its numeric enum value. + /// If a unit has more than one abbreviation defined, then it returns the first one. + /// Example: GetDefaultAbbreviation<LengthUnit>(typeof(LengthUnit), 1) => "cm" + /// + /// The unit enum type. + /// The unit enum value. + /// The format provider to use for lookup. Defaults to if null. + /// The default unit abbreviation string. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) + { + if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) + { + if(formatProvider != FallbackCulture) + return GetDefaultAbbreviation(unitType, unitValue, FallbackCulture); + else + throw new NotImplementedException($"No abbreviation is specified for {unitType.Name} with numeric value {unitValue}."); + } + + var abbreviations = lookup.GetAbbreviationsForUnit(unitValue); + if(abbreviations.Count == 0) + { + if(formatProvider != FallbackCulture) + return GetDefaultAbbreviation(unitType, unitValue, FallbackCulture); + else + throw new NotImplementedException($"No abbreviation is specified for {unitType.Name} with numeric value {unitValue}."); + } + + return abbreviations.First(); + } + + /// + /// Get all abbreviations for unit. + /// + /// Enum type for units. + /// Enum value for unit. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviations associated with unit. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + { + return GetUnitAbbreviations(typeof(TUnitType), Convert.ToInt32(unit), formatProvider); + } + + /// + /// Get all abbreviations for unit. + /// + /// Enum type for unit. + /// Enum value for unit. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviations associated with unit. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) + return formatProvider != FallbackCulture ? GetUnitAbbreviations(unitType, unitValue, FallbackCulture) : new string[] { }; + + var abbreviations = lookup.GetAbbreviationsForUnit(unitValue); + if(abbreviations.Count == 0) + return formatProvider != FallbackCulture ? GetUnitAbbreviations(unitType, unitValue, FallbackCulture) : new string[] { }; + + return abbreviations.ToArray(); + } + + /// + /// Get all abbreviations for all units of a quantity. + /// + /// Enum type for unit. + /// The format provider to use for lookup. Defaults to if null. + /// Unit abbreviations associated with unit. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + if(!TryGetUnitValueAbbreviationLookup(unitEnumType, formatProvider, out var lookup)) + return formatProvider != FallbackCulture ? GetAllUnitAbbreviationsForQuantity(unitEnumType, FallbackCulture) : new string[] { }; + + return lookup.GetAllUnitAbbreviationsForQuantity(); + } + + internal bool TryGetUnitValueAbbreviationLookup(Type unitType, IFormatProvider formatProvider, out UnitValueAbbreviationLookup unitToAbbreviations) + { + unitToAbbreviations = null; + + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + if(!_lookupsForCulture.TryGetValue(formatProvider, out var quantitiesForProvider)) + return formatProvider != FallbackCulture ? TryGetUnitValueAbbreviationLookup(unitType, FallbackCulture, out unitToAbbreviations) : false; + + if(!quantitiesForProvider.TryGetValue(unitType, out unitToAbbreviations)) + return formatProvider != FallbackCulture ? TryGetUnitValueAbbreviationLookup(unitType, FallbackCulture, out unitToAbbreviations) : false; + + return true; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs new file mode 100644 index 0000000000..7e1d3e093f --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs @@ -0,0 +1,215 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Linq; +using JetBrains.Annotations; +using UnitsNet.Units; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + public sealed class UnitParser + { + private readonly UnitAbbreviationsCache _unitAbbreviationsCache; + + public static UnitParser Default { get; } + + public UnitParser(UnitAbbreviationsCache unitAbbreviationsCache) + { + _unitAbbreviationsCache = unitAbbreviationsCache ?? UnitAbbreviationsCache.Default; + } + + static UnitParser() + { + Default = new UnitParser(UnitAbbreviationsCache.Default); + } + + /// + /// Parses a unit abbreviation for a given unit enumeration type. + /// Example: Parse<LengthUnit>("km") => LengthUnit.Kilometer + /// + /// + /// The format provider to use for lookup. Defaults to if null. + /// + /// + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider = null) where TUnitType : Enum + { + return (TUnitType)Parse(unitAbbreviation, typeof(TUnitType)); + } + + /// + /// Parse a unit abbreviation, such as "kg" or "m", to the unit enum value of the enum type + /// . + /// + /// + /// Unit abbreviation, such as "kg" or "m" for and + /// respectively. + /// + /// Unit enum type, such as and . + /// The format provider to use for lookup. Defaults to if null. + /// Unit enum value, such as . + /// No units match the abbreviation. + /// More than one unit matches the abbreviation. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider = null) + { + if (unitAbbreviation == null) throw new ArgumentNullException(nameof(unitAbbreviation)); + unitAbbreviation = unitAbbreviation.Trim(); + + if(!_unitAbbreviationsCache.TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var abbreviations)) + throw new UnitNotFoundException($"No abbreviations defined for unit type [{unitType}] for culture [{formatProvider}]."); + + var unitIntValues = abbreviations.GetUnitsForAbbreviation(unitAbbreviation, ignoreCase: true); + + // Narrow the search if too many hits, for example Megabar "Mbar" and Millibar "mbar" need to be distinguished + if (unitIntValues.Count > 1) + unitIntValues = abbreviations.GetUnitsForAbbreviation(unitAbbreviation, ignoreCase: false); + + switch (unitIntValues.Count) + { + case 1: + return (Enum) Enum.ToObject(unitType, unitIntValues[0]); + case 0: + throw new UnitNotFoundException($"Unit not found with abbreviation [{unitAbbreviation}] for unit type [{unitType}]."); + default: + string unitsCsv = string.Join(", ", unitIntValues.Select(x => Enum.GetName(unitType, x)).ToArray()); + throw new AmbiguousUnitParseException( + $"Cannot parse \"{unitAbbreviation}\" since it could be either of these: {unitsCsv}"); + } + } + + /// + /// Try to parse a unit abbreviation. + /// + /// The string value. + /// The unit enum value as out result. + /// Type of unit enum. + /// True if successful. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + bool TryParse(string unitAbbreviation, out TUnitType unit) where TUnitType : Enum + { + return TryParse(unitAbbreviation, null, out unit); + } + + /// + /// Try to parse a unit abbreviation. + /// + /// The string value. + /// The format provider to use for lookup. Defaults to if null. + /// The unit enum value as out result. + /// Type of unit enum. + /// True if successful. + [PublicAPI] + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods +#if WINDOWS_UWP + internal +#else + public +#endif + bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider, out TUnitType unit) where TUnitType : Enum + { + unit = default; + + if(!TryParse(unitAbbreviation, typeof(TUnitType), formatProvider, out var unitObj)) + return false; + + unit = (TUnitType)unitObj; + return true; + } + + /// + /// Try to parse a unit abbreviation. + /// + /// The string value. + /// Type of unit enum. + /// The unit enum value as out result. + /// True if successful. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) + { + return TryParse(unitAbbreviation, unitType, null, out unit); + } + + /// + /// Try to parse a unit abbreviation. + /// + /// The string value. + /// Type of unit enum. + /// The format provider to use for lookup. Defaults to if null. + /// The unit enum value as out result. + /// True if successful. + [PublicAPI] +#if WINDOWS_UWP + internal +#else + public +#endif + bool TryParse(string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider, out Enum unit) + { + if (unitAbbreviation == null) + { + unit = default; + return false; + } + + unitAbbreviation = unitAbbreviation.Trim(); + unit = default; + + if(!_unitAbbreviationsCache.TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var abbreviations)) + return false; + + var unitIntValues = abbreviations.GetUnitsForAbbreviation(unitAbbreviation, ignoreCase: true); + + // Narrow the search if too many hits, for example Megabar "Mbar" and Millibar "mbar" need to be distinguished + if (unitIntValues.Count > 1) + unitIntValues = abbreviations.GetUnitsForAbbreviation(unitAbbreviation, ignoreCase: false); + + if(unitIntValues.Count != 1) + return false; + + unit = (Enum)Enum.ToObject(unitType, unitIntValues[0]); + return true; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitValueAbbreviationLookup.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitValueAbbreviationLookup.cs new file mode 100644 index 0000000000..c79d17e305 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitValueAbbreviationLookup.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Linq; + +using UnitToAbbreviationMap = System.Collections.Generic.Dictionary>; +using AbbreviationToUnitMap = System.Collections.Generic.Dictionary>; + +// ReSharper disable once CheckNamespace +namespace UnitsNet +{ + internal class UnitValueAbbreviationLookup + { + private readonly UnitToAbbreviationMap unitToAbbreviationMap = new UnitToAbbreviationMap(); + private readonly AbbreviationToUnitMap abbreviationToUnitMap = new AbbreviationToUnitMap(); + private readonly AbbreviationToUnitMap lowerCaseAbbreviationToUnitMap = new AbbreviationToUnitMap(); + + internal string[] GetAllUnitAbbreviationsForQuantity() + { + return unitToAbbreviationMap.Values.SelectMany((abbreviations) => + { + return abbreviations; + } ).Distinct().ToArray(); + } + + internal List GetAbbreviationsForUnit(UnitType unit) where UnitType : Enum + { + return GetAbbreviationsForUnit(Convert.ToInt32(unit)); + } + + internal List GetAbbreviationsForUnit(int unit) + { + if(!unitToAbbreviationMap.TryGetValue(unit, out var abbreviations)) + unitToAbbreviationMap[unit] = abbreviations = new List(); + + return abbreviations.Distinct().ToList(); + } + + internal List GetUnitsForAbbreviation(string abbreviation, bool ignoreCase) + { + var lowerCaseAbbreviation = abbreviation.ToLower(); + var key = ignoreCase ? lowerCaseAbbreviation : abbreviation; + var map = ignoreCase ? lowerCaseAbbreviationToUnitMap : abbreviationToUnitMap; + + if(!map.TryGetValue(key, out List units)) + map[key] = units = new List(); + + return units.Distinct().ToList(); + } + + internal void Add(int unit, string abbreviation, bool setAsDefault = false) + { + var lowerCaseAbbreviation = abbreviation.ToLower(); + + if(!unitToAbbreviationMap.TryGetValue(unit, out var abbreviationsForUnit)) + abbreviationsForUnit = unitToAbbreviationMap[unit] = new List(); + + if(!abbreviationToUnitMap.TryGetValue(abbreviation, out var unitsForAbbreviation)) + abbreviationToUnitMap[abbreviation] = unitsForAbbreviation = new List(); + + if(!lowerCaseAbbreviationToUnitMap.TryGetValue(lowerCaseAbbreviation, out var unitsForLowerCaseAbbreviation)) + lowerCaseAbbreviationToUnitMap[lowerCaseAbbreviation] = unitsForLowerCaseAbbreviation = new List(); + + unitsForLowerCaseAbbreviation.Remove(unit); + unitsForLowerCaseAbbreviation.Add(unit); + + unitsForAbbreviation.Remove(unit); + unitsForAbbreviation.Add(unit); + + abbreviationsForUnit.Remove(abbreviation); + if (setAsDefault) + abbreviationsForUnit.Insert(0, abbreviation); + else + abbreviationsForUnit.Add(abbreviation); + + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs new file mode 100644 index 0000000000..932a5b6975 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs @@ -0,0 +1,720 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Linq; +using JetBrains.Annotations; +using UnitsNet.InternalHelpers; +using UnitsNet.Units; + +#if WINDOWS_UWP +using FromValue = System.Double; +#else +using FromValue = UnitsNet.QuantityValue; +#endif + +namespace UnitsNet +{ + /// + /// Dynamically parse or construct quantities when types are only known at runtime. + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static partial class Quantity + { +#if !WINDOWS_UWP + /// + public static bool TryFrom(double value, Enum unit, out IQuantity quantity) + { + // Implicit cast to FromValue would prevent TryFrom from being called, + // so we need to explicitly check this here for double arguments. + if (double.IsNaN(value) || double.IsInfinity(value)) + { + quantity = default(IQuantity); + return false; + } + + return TryFrom((FromValue) value, unit, out quantity); + } +#endif + + /// + /// Try to dynamically construct a quantity. + /// + /// Numeric value. + /// Unit enum value. + /// The resulting quantity if successful, otherwise default. + /// True if successful with assigned the value, otherwise false. +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + { + switch (unit) + { + case AccelerationUnit accelerationUnit: + quantity = Acceleration.From(value, accelerationUnit); + return true; + case AmountOfSubstanceUnit amountOfSubstanceUnit: + quantity = AmountOfSubstance.From(value, amountOfSubstanceUnit); + return true; + case AmplitudeRatioUnit amplitudeRatioUnit: + quantity = AmplitudeRatio.From(value, amplitudeRatioUnit); + return true; + case AngleUnit angleUnit: + quantity = Angle.From(value, angleUnit); + return true; + case ApparentEnergyUnit apparentEnergyUnit: + quantity = ApparentEnergy.From(value, apparentEnergyUnit); + return true; + case ApparentPowerUnit apparentPowerUnit: + quantity = ApparentPower.From(value, apparentPowerUnit); + return true; + case AreaUnit areaUnit: + quantity = Area.From(value, areaUnit); + return true; + case AreaDensityUnit areaDensityUnit: + quantity = AreaDensity.From(value, areaDensityUnit); + return true; + case AreaMomentOfInertiaUnit areaMomentOfInertiaUnit: + quantity = AreaMomentOfInertia.From(value, areaMomentOfInertiaUnit); + return true; + case BitRateUnit bitRateUnit: + quantity = BitRate.From(value, bitRateUnit); + return true; + case BrakeSpecificFuelConsumptionUnit brakeSpecificFuelConsumptionUnit: + quantity = BrakeSpecificFuelConsumption.From(value, brakeSpecificFuelConsumptionUnit); + return true; + case CapacitanceUnit capacitanceUnit: + quantity = Capacitance.From(value, capacitanceUnit); + return true; + case CoefficientOfThermalExpansionUnit coefficientOfThermalExpansionUnit: + quantity = CoefficientOfThermalExpansion.From(value, coefficientOfThermalExpansionUnit); + return true; + case DensityUnit densityUnit: + quantity = Density.From(value, densityUnit); + return true; + case DurationUnit durationUnit: + quantity = Duration.From(value, durationUnit); + return true; + case DynamicViscosityUnit dynamicViscosityUnit: + quantity = DynamicViscosity.From(value, dynamicViscosityUnit); + return true; + case ElectricAdmittanceUnit electricAdmittanceUnit: + quantity = ElectricAdmittance.From(value, electricAdmittanceUnit); + return true; + case ElectricChargeUnit electricChargeUnit: + quantity = ElectricCharge.From(value, electricChargeUnit); + return true; + case ElectricChargeDensityUnit electricChargeDensityUnit: + quantity = ElectricChargeDensity.From(value, electricChargeDensityUnit); + return true; + case ElectricConductanceUnit electricConductanceUnit: + quantity = ElectricConductance.From(value, electricConductanceUnit); + return true; + case ElectricConductivityUnit electricConductivityUnit: + quantity = ElectricConductivity.From(value, electricConductivityUnit); + return true; + case ElectricCurrentUnit electricCurrentUnit: + quantity = ElectricCurrent.From(value, electricCurrentUnit); + return true; + case ElectricCurrentDensityUnit electricCurrentDensityUnit: + quantity = ElectricCurrentDensity.From(value, electricCurrentDensityUnit); + return true; + case ElectricCurrentGradientUnit electricCurrentGradientUnit: + quantity = ElectricCurrentGradient.From(value, electricCurrentGradientUnit); + return true; + case ElectricFieldUnit electricFieldUnit: + quantity = ElectricField.From(value, electricFieldUnit); + return true; + case ElectricInductanceUnit electricInductanceUnit: + quantity = ElectricInductance.From(value, electricInductanceUnit); + return true; + case ElectricPotentialUnit electricPotentialUnit: + quantity = ElectricPotential.From(value, electricPotentialUnit); + return true; + case ElectricPotentialAcUnit electricPotentialAcUnit: + quantity = ElectricPotentialAc.From(value, electricPotentialAcUnit); + return true; + case ElectricPotentialDcUnit electricPotentialDcUnit: + quantity = ElectricPotentialDc.From(value, electricPotentialDcUnit); + return true; + case ElectricResistanceUnit electricResistanceUnit: + quantity = ElectricResistance.From(value, electricResistanceUnit); + return true; + case ElectricResistivityUnit electricResistivityUnit: + quantity = ElectricResistivity.From(value, electricResistivityUnit); + return true; + case EnergyUnit energyUnit: + quantity = Energy.From(value, energyUnit); + return true; + case EntropyUnit entropyUnit: + quantity = Entropy.From(value, entropyUnit); + return true; + case ForceUnit forceUnit: + quantity = Force.From(value, forceUnit); + return true; + case ForceChangeRateUnit forceChangeRateUnit: + quantity = ForceChangeRate.From(value, forceChangeRateUnit); + return true; + case ForcePerLengthUnit forcePerLengthUnit: + quantity = ForcePerLength.From(value, forcePerLengthUnit); + return true; + case FrequencyUnit frequencyUnit: + quantity = Frequency.From(value, frequencyUnit); + return true; + case HeatFluxUnit heatFluxUnit: + quantity = HeatFlux.From(value, heatFluxUnit); + return true; + case HeatTransferCoefficientUnit heatTransferCoefficientUnit: + quantity = HeatTransferCoefficient.From(value, heatTransferCoefficientUnit); + return true; + case IlluminanceUnit illuminanceUnit: + quantity = Illuminance.From(value, illuminanceUnit); + return true; + case InformationUnit informationUnit: + quantity = Information.From(value, informationUnit); + return true; + case IrradianceUnit irradianceUnit: + quantity = Irradiance.From(value, irradianceUnit); + return true; + case IrradiationUnit irradiationUnit: + quantity = Irradiation.From(value, irradiationUnit); + return true; + case KinematicViscosityUnit kinematicViscosityUnit: + quantity = KinematicViscosity.From(value, kinematicViscosityUnit); + return true; + case LapseRateUnit lapseRateUnit: + quantity = LapseRate.From(value, lapseRateUnit); + return true; + case LengthUnit lengthUnit: + quantity = Length.From(value, lengthUnit); + return true; + case LevelUnit levelUnit: + quantity = Level.From(value, levelUnit); + return true; + case LinearDensityUnit linearDensityUnit: + quantity = LinearDensity.From(value, linearDensityUnit); + return true; + case LuminousFluxUnit luminousFluxUnit: + quantity = LuminousFlux.From(value, luminousFluxUnit); + return true; + case LuminousIntensityUnit luminousIntensityUnit: + quantity = LuminousIntensity.From(value, luminousIntensityUnit); + return true; + case MagneticFieldUnit magneticFieldUnit: + quantity = MagneticField.From(value, magneticFieldUnit); + return true; + case MagneticFluxUnit magneticFluxUnit: + quantity = MagneticFlux.From(value, magneticFluxUnit); + return true; + case MagnetizationUnit magnetizationUnit: + quantity = Magnetization.From(value, magnetizationUnit); + return true; + case MassUnit massUnit: + quantity = Mass.From(value, massUnit); + return true; + case MassFlowUnit massFlowUnit: + quantity = MassFlow.From(value, massFlowUnit); + return true; + case MassFluxUnit massFluxUnit: + quantity = MassFlux.From(value, massFluxUnit); + return true; + case MassMomentOfInertiaUnit massMomentOfInertiaUnit: + quantity = MassMomentOfInertia.From(value, massMomentOfInertiaUnit); + return true; + case MolarEnergyUnit molarEnergyUnit: + quantity = MolarEnergy.From(value, molarEnergyUnit); + return true; + case MolarEntropyUnit molarEntropyUnit: + quantity = MolarEntropy.From(value, molarEntropyUnit); + return true; + case MolarityUnit molarityUnit: + quantity = Molarity.From(value, molarityUnit); + return true; + case MolarMassUnit molarMassUnit: + quantity = MolarMass.From(value, molarMassUnit); + return true; + case PermeabilityUnit permeabilityUnit: + quantity = Permeability.From(value, permeabilityUnit); + return true; + case PermittivityUnit permittivityUnit: + quantity = Permittivity.From(value, permittivityUnit); + return true; + case PowerUnit powerUnit: + quantity = Power.From(value, powerUnit); + return true; + case PowerDensityUnit powerDensityUnit: + quantity = PowerDensity.From(value, powerDensityUnit); + return true; + case PowerRatioUnit powerRatioUnit: + quantity = PowerRatio.From(value, powerRatioUnit); + return true; + case PressureUnit pressureUnit: + quantity = Pressure.From(value, pressureUnit); + return true; + case PressureChangeRateUnit pressureChangeRateUnit: + quantity = PressureChangeRate.From(value, pressureChangeRateUnit); + return true; + case RatioUnit ratioUnit: + quantity = Ratio.From(value, ratioUnit); + return true; + case ReactiveEnergyUnit reactiveEnergyUnit: + quantity = ReactiveEnergy.From(value, reactiveEnergyUnit); + return true; + case ReactivePowerUnit reactivePowerUnit: + quantity = ReactivePower.From(value, reactivePowerUnit); + return true; + case RotationalAccelerationUnit rotationalAccelerationUnit: + quantity = RotationalAcceleration.From(value, rotationalAccelerationUnit); + return true; + case RotationalSpeedUnit rotationalSpeedUnit: + quantity = RotationalSpeed.From(value, rotationalSpeedUnit); + return true; + case RotationalStiffnessUnit rotationalStiffnessUnit: + quantity = RotationalStiffness.From(value, rotationalStiffnessUnit); + return true; + case RotationalStiffnessPerLengthUnit rotationalStiffnessPerLengthUnit: + quantity = RotationalStiffnessPerLength.From(value, rotationalStiffnessPerLengthUnit); + return true; + case SolidAngleUnit solidAngleUnit: + quantity = SolidAngle.From(value, solidAngleUnit); + return true; + case SpecificEnergyUnit specificEnergyUnit: + quantity = SpecificEnergy.From(value, specificEnergyUnit); + return true; + case SpecificEntropyUnit specificEntropyUnit: + quantity = SpecificEntropy.From(value, specificEntropyUnit); + return true; + case SpecificVolumeUnit specificVolumeUnit: + quantity = SpecificVolume.From(value, specificVolumeUnit); + return true; + case SpecificWeightUnit specificWeightUnit: + quantity = SpecificWeight.From(value, specificWeightUnit); + return true; + case SpeedUnit speedUnit: + quantity = Speed.From(value, speedUnit); + return true; + case TemperatureUnit temperatureUnit: + quantity = Temperature.From(value, temperatureUnit); + return true; + case TemperatureChangeRateUnit temperatureChangeRateUnit: + quantity = TemperatureChangeRate.From(value, temperatureChangeRateUnit); + return true; + case TemperatureDeltaUnit temperatureDeltaUnit: + quantity = TemperatureDelta.From(value, temperatureDeltaUnit); + return true; + case ThermalConductivityUnit thermalConductivityUnit: + quantity = ThermalConductivity.From(value, thermalConductivityUnit); + return true; + case ThermalResistanceUnit thermalResistanceUnit: + quantity = ThermalResistance.From(value, thermalResistanceUnit); + return true; + case TorqueUnit torqueUnit: + quantity = Torque.From(value, torqueUnit); + return true; + case VitaminAUnit vitaminAUnit: + quantity = VitaminA.From(value, vitaminAUnit); + return true; + case VolumeUnit volumeUnit: + quantity = Volume.From(value, volumeUnit); + return true; + case VolumeFlowUnit volumeFlowUnit: + quantity = VolumeFlow.From(value, volumeFlowUnit); + return true; + default: + { + quantity = default(IQuantity); + return false; + } + } + } + + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + + /// + /// Dynamically parse a quantity string representation. + /// + /// The format provider to use for lookup. Defaults to if null. + /// Type of quantity, such as . + /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. + /// The parsed quantity. + /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. +#if WINDOWS_UWP + internal +#else + public +#endif + static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + { + if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) + throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); + + if (TryParse(formatProvider, quantityType, quantityString, out IQuantity quantity)) return quantity; + + throw new ArgumentException($"Quantity string could not be parsed to quantity {quantityType}."); + } + + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + TryParse(null, quantityType, quantityString, out quantity); + + /// + /// Try to dynamically parse a quantity string representation. + /// + /// The format provider to use for lookup. Defaults to if null. + /// Type of quantity, such as . + /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. + /// The resulting quantity if successful, otherwise default. + /// The parsed quantity. +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + { + quantity = default(IQuantity); + + if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) + return false; + + var parser = QuantityParser.Default; + + if (quantityType == typeof(Acceleration)) + return parser.TryParse(quantityString, formatProvider, Acceleration.From, out quantity); + + if (quantityType == typeof(AmountOfSubstance)) + return parser.TryParse(quantityString, formatProvider, AmountOfSubstance.From, out quantity); + + if (quantityType == typeof(AmplitudeRatio)) + return parser.TryParse(quantityString, formatProvider, AmplitudeRatio.From, out quantity); + + if (quantityType == typeof(Angle)) + return parser.TryParse(quantityString, formatProvider, Angle.From, out quantity); + + if (quantityType == typeof(ApparentEnergy)) + return parser.TryParse(quantityString, formatProvider, ApparentEnergy.From, out quantity); + + if (quantityType == typeof(ApparentPower)) + return parser.TryParse(quantityString, formatProvider, ApparentPower.From, out quantity); + + if (quantityType == typeof(Area)) + return parser.TryParse(quantityString, formatProvider, Area.From, out quantity); + + if (quantityType == typeof(AreaDensity)) + return parser.TryParse(quantityString, formatProvider, AreaDensity.From, out quantity); + + if (quantityType == typeof(AreaMomentOfInertia)) + return parser.TryParse(quantityString, formatProvider, AreaMomentOfInertia.From, out quantity); + + if (quantityType == typeof(BitRate)) + return parser.TryParse(quantityString, formatProvider, BitRate.From, out quantity); + + if (quantityType == typeof(BrakeSpecificFuelConsumption)) + return parser.TryParse(quantityString, formatProvider, BrakeSpecificFuelConsumption.From, out quantity); + + if (quantityType == typeof(Capacitance)) + return parser.TryParse(quantityString, formatProvider, Capacitance.From, out quantity); + + if (quantityType == typeof(CoefficientOfThermalExpansion)) + return parser.TryParse(quantityString, formatProvider, CoefficientOfThermalExpansion.From, out quantity); + + if (quantityType == typeof(Density)) + return parser.TryParse(quantityString, formatProvider, Density.From, out quantity); + + if (quantityType == typeof(Duration)) + return parser.TryParse(quantityString, formatProvider, Duration.From, out quantity); + + if (quantityType == typeof(DynamicViscosity)) + return parser.TryParse(quantityString, formatProvider, DynamicViscosity.From, out quantity); + + if (quantityType == typeof(ElectricAdmittance)) + return parser.TryParse(quantityString, formatProvider, ElectricAdmittance.From, out quantity); + + if (quantityType == typeof(ElectricCharge)) + return parser.TryParse(quantityString, formatProvider, ElectricCharge.From, out quantity); + + if (quantityType == typeof(ElectricChargeDensity)) + return parser.TryParse(quantityString, formatProvider, ElectricChargeDensity.From, out quantity); + + if (quantityType == typeof(ElectricConductance)) + return parser.TryParse(quantityString, formatProvider, ElectricConductance.From, out quantity); + + if (quantityType == typeof(ElectricConductivity)) + return parser.TryParse(quantityString, formatProvider, ElectricConductivity.From, out quantity); + + if (quantityType == typeof(ElectricCurrent)) + return parser.TryParse(quantityString, formatProvider, ElectricCurrent.From, out quantity); + + if (quantityType == typeof(ElectricCurrentDensity)) + return parser.TryParse(quantityString, formatProvider, ElectricCurrentDensity.From, out quantity); + + if (quantityType == typeof(ElectricCurrentGradient)) + return parser.TryParse(quantityString, formatProvider, ElectricCurrentGradient.From, out quantity); + + if (quantityType == typeof(ElectricField)) + return parser.TryParse(quantityString, formatProvider, ElectricField.From, out quantity); + + if (quantityType == typeof(ElectricInductance)) + return parser.TryParse(quantityString, formatProvider, ElectricInductance.From, out quantity); + + if (quantityType == typeof(ElectricPotential)) + return parser.TryParse(quantityString, formatProvider, ElectricPotential.From, out quantity); + + if (quantityType == typeof(ElectricPotentialAc)) + return parser.TryParse(quantityString, formatProvider, ElectricPotentialAc.From, out quantity); + + if (quantityType == typeof(ElectricPotentialDc)) + return parser.TryParse(quantityString, formatProvider, ElectricPotentialDc.From, out quantity); + + if (quantityType == typeof(ElectricResistance)) + return parser.TryParse(quantityString, formatProvider, ElectricResistance.From, out quantity); + + if (quantityType == typeof(ElectricResistivity)) + return parser.TryParse(quantityString, formatProvider, ElectricResistivity.From, out quantity); + + if (quantityType == typeof(Energy)) + return parser.TryParse(quantityString, formatProvider, Energy.From, out quantity); + + if (quantityType == typeof(Entropy)) + return parser.TryParse(quantityString, formatProvider, Entropy.From, out quantity); + + if (quantityType == typeof(Force)) + return parser.TryParse(quantityString, formatProvider, Force.From, out quantity); + + if (quantityType == typeof(ForceChangeRate)) + return parser.TryParse(quantityString, formatProvider, ForceChangeRate.From, out quantity); + + if (quantityType == typeof(ForcePerLength)) + return parser.TryParse(quantityString, formatProvider, ForcePerLength.From, out quantity); + + if (quantityType == typeof(Frequency)) + return parser.TryParse(quantityString, formatProvider, Frequency.From, out quantity); + + if (quantityType == typeof(HeatFlux)) + return parser.TryParse(quantityString, formatProvider, HeatFlux.From, out quantity); + + if (quantityType == typeof(HeatTransferCoefficient)) + return parser.TryParse(quantityString, formatProvider, HeatTransferCoefficient.From, out quantity); + + if (quantityType == typeof(Illuminance)) + return parser.TryParse(quantityString, formatProvider, Illuminance.From, out quantity); + + if (quantityType == typeof(Information)) + return parser.TryParse(quantityString, formatProvider, Information.From, out quantity); + + if (quantityType == typeof(Irradiance)) + return parser.TryParse(quantityString, formatProvider, Irradiance.From, out quantity); + + if (quantityType == typeof(Irradiation)) + return parser.TryParse(quantityString, formatProvider, Irradiation.From, out quantity); + + if (quantityType == typeof(KinematicViscosity)) + return parser.TryParse(quantityString, formatProvider, KinematicViscosity.From, out quantity); + + if (quantityType == typeof(LapseRate)) + return parser.TryParse(quantityString, formatProvider, LapseRate.From, out quantity); + + if (quantityType == typeof(Length)) + return parser.TryParse(quantityString, formatProvider, Length.From, out quantity); + + if (quantityType == typeof(Level)) + return parser.TryParse(quantityString, formatProvider, Level.From, out quantity); + + if (quantityType == typeof(LinearDensity)) + return parser.TryParse(quantityString, formatProvider, LinearDensity.From, out quantity); + + if (quantityType == typeof(LuminousFlux)) + return parser.TryParse(quantityString, formatProvider, LuminousFlux.From, out quantity); + + if (quantityType == typeof(LuminousIntensity)) + return parser.TryParse(quantityString, formatProvider, LuminousIntensity.From, out quantity); + + if (quantityType == typeof(MagneticField)) + return parser.TryParse(quantityString, formatProvider, MagneticField.From, out quantity); + + if (quantityType == typeof(MagneticFlux)) + return parser.TryParse(quantityString, formatProvider, MagneticFlux.From, out quantity); + + if (quantityType == typeof(Magnetization)) + return parser.TryParse(quantityString, formatProvider, Magnetization.From, out quantity); + + if (quantityType == typeof(Mass)) + return parser.TryParse(quantityString, formatProvider, Mass.From, out quantity); + + if (quantityType == typeof(MassFlow)) + return parser.TryParse(quantityString, formatProvider, MassFlow.From, out quantity); + + if (quantityType == typeof(MassFlux)) + return parser.TryParse(quantityString, formatProvider, MassFlux.From, out quantity); + + if (quantityType == typeof(MassMomentOfInertia)) + return parser.TryParse(quantityString, formatProvider, MassMomentOfInertia.From, out quantity); + + if (quantityType == typeof(MolarEnergy)) + return parser.TryParse(quantityString, formatProvider, MolarEnergy.From, out quantity); + + if (quantityType == typeof(MolarEntropy)) + return parser.TryParse(quantityString, formatProvider, MolarEntropy.From, out quantity); + + if (quantityType == typeof(Molarity)) + return parser.TryParse(quantityString, formatProvider, Molarity.From, out quantity); + + if (quantityType == typeof(MolarMass)) + return parser.TryParse(quantityString, formatProvider, MolarMass.From, out quantity); + + if (quantityType == typeof(Permeability)) + return parser.TryParse(quantityString, formatProvider, Permeability.From, out quantity); + + if (quantityType == typeof(Permittivity)) + return parser.TryParse(quantityString, formatProvider, Permittivity.From, out quantity); + + if (quantityType == typeof(Power)) + return parser.TryParse(quantityString, formatProvider, Power.From, out quantity); + + if (quantityType == typeof(PowerDensity)) + return parser.TryParse(quantityString, formatProvider, PowerDensity.From, out quantity); + + if (quantityType == typeof(PowerRatio)) + return parser.TryParse(quantityString, formatProvider, PowerRatio.From, out quantity); + + if (quantityType == typeof(Pressure)) + return parser.TryParse(quantityString, formatProvider, Pressure.From, out quantity); + + if (quantityType == typeof(PressureChangeRate)) + return parser.TryParse(quantityString, formatProvider, PressureChangeRate.From, out quantity); + + if (quantityType == typeof(Ratio)) + return parser.TryParse(quantityString, formatProvider, Ratio.From, out quantity); + + if (quantityType == typeof(ReactiveEnergy)) + return parser.TryParse(quantityString, formatProvider, ReactiveEnergy.From, out quantity); + + if (quantityType == typeof(ReactivePower)) + return parser.TryParse(quantityString, formatProvider, ReactivePower.From, out quantity); + + if (quantityType == typeof(RotationalAcceleration)) + return parser.TryParse(quantityString, formatProvider, RotationalAcceleration.From, out quantity); + + if (quantityType == typeof(RotationalSpeed)) + return parser.TryParse(quantityString, formatProvider, RotationalSpeed.From, out quantity); + + if (quantityType == typeof(RotationalStiffness)) + return parser.TryParse(quantityString, formatProvider, RotationalStiffness.From, out quantity); + + if (quantityType == typeof(RotationalStiffnessPerLength)) + return parser.TryParse(quantityString, formatProvider, RotationalStiffnessPerLength.From, out quantity); + + if (quantityType == typeof(SolidAngle)) + return parser.TryParse(quantityString, formatProvider, SolidAngle.From, out quantity); + + if (quantityType == typeof(SpecificEnergy)) + return parser.TryParse(quantityString, formatProvider, SpecificEnergy.From, out quantity); + + if (quantityType == typeof(SpecificEntropy)) + return parser.TryParse(quantityString, formatProvider, SpecificEntropy.From, out quantity); + + if (quantityType == typeof(SpecificVolume)) + return parser.TryParse(quantityString, formatProvider, SpecificVolume.From, out quantity); + + if (quantityType == typeof(SpecificWeight)) + return parser.TryParse(quantityString, formatProvider, SpecificWeight.From, out quantity); + + if (quantityType == typeof(Speed)) + return parser.TryParse(quantityString, formatProvider, Speed.From, out quantity); + + if (quantityType == typeof(Temperature)) + return parser.TryParse(quantityString, formatProvider, Temperature.From, out quantity); + + if (quantityType == typeof(TemperatureChangeRate)) + return parser.TryParse(quantityString, formatProvider, TemperatureChangeRate.From, out quantity); + + if (quantityType == typeof(TemperatureDelta)) + return parser.TryParse(quantityString, formatProvider, TemperatureDelta.From, out quantity); + + if (quantityType == typeof(ThermalConductivity)) + return parser.TryParse(quantityString, formatProvider, ThermalConductivity.From, out quantity); + + if (quantityType == typeof(ThermalResistance)) + return parser.TryParse(quantityString, formatProvider, ThermalResistance.From, out quantity); + + if (quantityType == typeof(Torque)) + return parser.TryParse(quantityString, formatProvider, Torque.From, out quantity); + + if (quantityType == typeof(VitaminA)) + return parser.TryParse(quantityString, formatProvider, VitaminA.From, out quantity); + + if (quantityType == typeof(Volume)) + return parser.TryParse(quantityString, formatProvider, Volume.From, out quantity); + + if (quantityType == typeof(VolumeFlow)) + return parser.TryParse(quantityString, formatProvider, VolumeFlow.From, out quantity); + + throw new ArgumentException( + $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); + } + +#if !WINDOWS_UWP + /// + /// Get information about the given quantity type. + /// + /// The quantity type enum value. + /// Information about the quantity and its units. + public static QuantityInfo GetInfo(QuantityType quantityType) + { + return Infos.First(qi => qi.QuantityType == quantityType); + } +#endif + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/QuantityType.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/QuantityType.g.cs new file mode 100644 index 0000000000..470b8c5862 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/QuantityType.g.cs @@ -0,0 +1,142 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace + +namespace UnitsNet +{ + /// + /// Lists all generated quantities with the same name as the quantity struct type, + /// such as Length, Mass, Force etc. + /// This is useful for populating options in the UI, such as creating a generic conversion + /// tool with inputValue, quantityName, fromUnit and toUnit selectors. + /// + public enum QuantityType + { + Undefined = 0, + Acceleration, + AmountOfSubstance, + AmplitudeRatio, + Angle, + ApparentEnergy, + ApparentPower, + Area, + AreaDensity, + AreaMomentOfInertia, + BitRate, + BrakeSpecificFuelConsumption, + Capacitance, + CoefficientOfThermalExpansion, + Density, + Duration, + DynamicViscosity, + ElectricAdmittance, + ElectricCharge, + ElectricChargeDensity, + ElectricConductance, + ElectricConductivity, + ElectricCurrent, + ElectricCurrentDensity, + ElectricCurrentGradient, + ElectricField, + ElectricInductance, + ElectricPotential, + ElectricPotentialAc, + ElectricPotentialDc, + ElectricResistance, + ElectricResistivity, + Energy, + Entropy, + Force, + ForceChangeRate, + ForcePerLength, + Frequency, + HeatFlux, + HeatTransferCoefficient, + Illuminance, + Information, + Irradiance, + Irradiation, + KinematicViscosity, + LapseRate, + Length, + Level, + LinearDensity, + LuminousFlux, + LuminousIntensity, + MagneticField, + MagneticFlux, + Magnetization, + Mass, + MassFlow, + MassFlux, + MassMomentOfInertia, + MolarEnergy, + MolarEntropy, + Molarity, + MolarMass, + Permeability, + Permittivity, + Power, + PowerDensity, + PowerRatio, + Pressure, + PressureChangeRate, + Ratio, + ReactiveEnergy, + ReactivePower, + RotationalAcceleration, + RotationalSpeed, + RotationalStiffness, + RotationalStiffnessPerLength, + SolidAngle, + SpecificEnergy, + SpecificEntropy, + SpecificVolume, + SpecificWeight, + Speed, + Temperature, + TemperatureChangeRate, + TemperatureDelta, + ThermalConductivity, + ThermalResistance, + Torque, + VitaminA, + Volume, + VolumeFlow, + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs new file mode 100644 index 0000000000..e30134cd98 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs @@ -0,0 +1,1154 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable RedundantCommaInArrayInitializer +// ReSharper disable once CheckNamespace + +namespace UnitsNet +{ + public sealed partial class UnitAbbreviationsCache + { + private static readonly (string CultureName, Type UnitType, int UnitValue, string[] UnitAbbreviations)[] GeneratedLocalizations + = new [] + { + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.CentimeterPerSecondSquared, new string[]{"cm/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.DecimeterPerSecondSquared, new string[]{"dm/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.FootPerSecondSquared, new string[]{"ft/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.InchPerSecondSquared, new string[]{"in/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.KilometerPerSecondSquared, new string[]{"km/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.KnotPerHour, new string[]{"kn/h"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.KnotPerMinute, new string[]{"kn/min"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.KnotPerSecond, new string[]{"kn/s"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.MeterPerSecondSquared, new string[]{"m/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.MicrometerPerSecondSquared, new string[]{"µm/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.MillimeterPerSecondSquared, new string[]{"mm/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.NanometerPerSecondSquared, new string[]{"nm/s²"}), + ("en-US", typeof(AccelerationUnit), (int)AccelerationUnit.StandardGravity, new string[]{"g"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Centimole, new string[]{"cmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.CentipoundMole, new string[]{"clbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Decimole, new string[]{"dmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.DecipoundMole, new string[]{"dlbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Kilomole, new string[]{"kmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.KilopoundMole, new string[]{"klbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Megamole, new string[]{"Mmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Micromole, new string[]{"µmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.MicropoundMole, new string[]{"µlbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Millimole, new string[]{"mmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.MillipoundMole, new string[]{"mlbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Mole, new string[]{"mol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.Nanomole, new string[]{"nmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.NanopoundMole, new string[]{"nlbmol"}), + ("en-US", typeof(AmountOfSubstanceUnit), (int)AmountOfSubstanceUnit.PoundMole, new string[]{"lbmol"}), + ("en-US", typeof(AmplitudeRatioUnit), (int)AmplitudeRatioUnit.DecibelMicrovolt, new string[]{"dBµV"}), + ("en-US", typeof(AmplitudeRatioUnit), (int)AmplitudeRatioUnit.DecibelMillivolt, new string[]{"dBmV"}), + ("en-US", typeof(AmplitudeRatioUnit), (int)AmplitudeRatioUnit.DecibelUnloaded, new string[]{"dBu"}), + ("en-US", typeof(AmplitudeRatioUnit), (int)AmplitudeRatioUnit.DecibelVolt, new string[]{"dBV"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Arcminute, new string[]{"'", "arcmin", "amin", "min"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Arcsecond, new string[]{"″", "arcsec", "asec", "sec"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Centiradian, new string[]{"crad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Centiradian, new string[]{"cрад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Deciradian, new string[]{"drad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Deciradian, new string[]{"dрад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Degree, new string[]{"°", "deg"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Degree, new string[]{"°"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Gradian, new string[]{"g"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Gradian, new string[]{"g"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Microdegree, new string[]{"µ°"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Microdegree, new string[]{"µ°"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Microradian, new string[]{"µrad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Microradian, new string[]{"µрад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Millidegree, new string[]{"m°"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Millidegree, new string[]{"m°"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Milliradian, new string[]{"mrad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Milliradian, new string[]{"mрад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Nanodegree, new string[]{"n°"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Nanodegree, new string[]{"n°"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Nanoradian, new string[]{"nrad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Nanoradian, new string[]{"nрад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Radian, new string[]{"rad"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Radian, new string[]{"рад"}), + ("en-US", typeof(AngleUnit), (int)AngleUnit.Revolution, new string[]{"r"}), + ("ru-RU", typeof(AngleUnit), (int)AngleUnit.Revolution, new string[]{"r"}), + ("en-US", typeof(ApparentEnergyUnit), (int)ApparentEnergyUnit.KilovoltampereHour, new string[]{"kVAh"}), + ("en-US", typeof(ApparentEnergyUnit), (int)ApparentEnergyUnit.MegavoltampereHour, new string[]{"MVAh"}), + ("en-US", typeof(ApparentEnergyUnit), (int)ApparentEnergyUnit.VoltampereHour, new string[]{"VAh"}), + ("en-US", typeof(ApparentPowerUnit), (int)ApparentPowerUnit.Gigavoltampere, new string[]{"GVA"}), + ("en-US", typeof(ApparentPowerUnit), (int)ApparentPowerUnit.Kilovoltampere, new string[]{"kVA"}), + ("en-US", typeof(ApparentPowerUnit), (int)ApparentPowerUnit.Megavoltampere, new string[]{"MVA"}), + ("en-US", typeof(ApparentPowerUnit), (int)ApparentPowerUnit.Voltampere, new string[]{"VA"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.Acre, new string[]{"ac"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.Hectare, new string[]{"ha"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareCentimeter, new string[]{"cm²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareCentimeter, new string[]{"см²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareDecimeter, new string[]{"dm²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareDecimeter, new string[]{"дм²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareFoot, new string[]{"ft²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareFoot, new string[]{"фут²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareInch, new string[]{"in²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareInch, new string[]{"дюйм²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareKilometer, new string[]{"km²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareKilometer, new string[]{"км²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareMeter, new string[]{"m²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareMeter, new string[]{"м²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareMicrometer, new string[]{"µm²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareMicrometer, new string[]{"мкм²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareMile, new string[]{"mi²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareMile, new string[]{"миля²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareMillimeter, new string[]{"mm²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareMillimeter, new string[]{"мм²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.SquareYard, new string[]{"yd²"}), + ("ru-RU", typeof(AreaUnit), (int)AreaUnit.SquareYard, new string[]{"ярд²"}), + ("en-US", typeof(AreaUnit), (int)AreaUnit.UsSurveySquareFoot, new string[]{"ft² (US)"}), + ("en-US", typeof(AreaDensityUnit), (int)AreaDensityUnit.KilogramPerSquareMeter, new string[]{"kg/m²"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.CentimeterToTheFourth, new string[]{"cm⁴", "cm^4"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.DecimeterToTheFourth, new string[]{"dm⁴", "dm^4"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.FootToTheFourth, new string[]{"ft⁴", "ft^4"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.InchToTheFourth, new string[]{"in⁴", "in^4"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.MeterToTheFourth, new string[]{"m⁴", "m^4"}), + ("en-US", typeof(AreaMomentOfInertiaUnit), (int)AreaMomentOfInertiaUnit.MillimeterToTheFourth, new string[]{"mm⁴", "mm^4"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.BitPerSecond, new string[]{"bit/s", "bps"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.BytePerSecond, new string[]{"B/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.ExabitPerSecond, new string[]{"Ebit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.ExabytePerSecond, new string[]{"EB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.ExbibitPerSecond, new string[]{"Eibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.ExbibytePerSecond, new string[]{"EiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.GibibitPerSecond, new string[]{"Gibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.GibibytePerSecond, new string[]{"GiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.GigabitPerSecond, new string[]{"Gbit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.GigabytePerSecond, new string[]{"GB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.KibibitPerSecond, new string[]{"Kibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.KibibytePerSecond, new string[]{"KiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.KilobitPerSecond, new string[]{"kbit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.KilobytePerSecond, new string[]{"kB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.MebibitPerSecond, new string[]{"Mibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.MebibytePerSecond, new string[]{"MiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.MegabitPerSecond, new string[]{"Mbit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.MegabytePerSecond, new string[]{"MB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.PebibitPerSecond, new string[]{"Pibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.PebibytePerSecond, new string[]{"PiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.PetabitPerSecond, new string[]{"Pbit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.PetabytePerSecond, new string[]{"PB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.TebibitPerSecond, new string[]{"Tibit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.TebibytePerSecond, new string[]{"TiB/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.TerabitPerSecond, new string[]{"Tbit/s"}), + ("en-US", typeof(BitRateUnit), (int)BitRateUnit.TerabytePerSecond, new string[]{"TB/s"}), + ("en-US", typeof(BrakeSpecificFuelConsumptionUnit), (int)BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour, new string[]{"g/kWh"}), + ("en-US", typeof(BrakeSpecificFuelConsumptionUnit), (int)BrakeSpecificFuelConsumptionUnit.KilogramPerJoule, new string[]{"kg/J"}), + ("en-US", typeof(BrakeSpecificFuelConsumptionUnit), (int)BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour, new string[]{"lb/hph"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Farad, new string[]{"F"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Kilofarad, new string[]{"kF"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Megafarad, new string[]{"MF"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Microfarad, new string[]{"µF"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Millifarad, new string[]{"mF"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Nanofarad, new string[]{"nF"}), + ("en-US", typeof(CapacitanceUnit), (int)CapacitanceUnit.Picofarad, new string[]{"pF"}), + ("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseDegreeCelsius, new string[]{"°C⁻¹", "1/°C"}), + ("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseDegreeFahrenheit, new string[]{"°F⁻¹", "1/°F"}), + ("en-US", typeof(CoefficientOfThermalExpansionUnit), (int)CoefficientOfThermalExpansionUnit.InverseKelvin, new string[]{"K⁻¹", "1/K"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerDeciliter, new string[]{"cg/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerLiter, new string[]{"cg/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.CentigramPerMilliliter, new string[]{"cg/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.DecigramPerDeciliter, new string[]{"dg/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.DecigramPerLiter, new string[]{"dg/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.DecigramPerMilliliter, new string[]{"dg/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerCubicCentimeter, new string[]{"g/cm³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerCubicMeter, new string[]{"g/m³"}), + ("ru-RU", typeof(DensityUnit), (int)DensityUnit.GramPerCubicMeter, new string[]{"г/м³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerCubicMillimeter, new string[]{"g/mm³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerDeciliter, new string[]{"g/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerLiter, new string[]{"g/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.GramPerMilliliter, new string[]{"g/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.KilogramPerCubicCentimeter, new string[]{"kg/cm³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.KilogramPerCubicMeter, new string[]{"kg/m³"}), + ("ru-RU", typeof(DensityUnit), (int)DensityUnit.KilogramPerCubicMeter, new string[]{"kг/м³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.KilogramPerCubicMillimeter, new string[]{"kg/mm³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.KilopoundPerCubicFoot, new string[]{"kip/ft³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.KilopoundPerCubicInch, new string[]{"kip/in³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MicrogramPerCubicMeter, new string[]{"µg/m³"}), + ("ru-RU", typeof(DensityUnit), (int)DensityUnit.MicrogramPerCubicMeter, new string[]{"µг/м³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MicrogramPerDeciliter, new string[]{"µg/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MicrogramPerLiter, new string[]{"µg/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MicrogramPerMilliliter, new string[]{"µg/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MilligramPerCubicMeter, new string[]{"mg/m³"}), + ("ru-RU", typeof(DensityUnit), (int)DensityUnit.MilligramPerCubicMeter, new string[]{"mг/м³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MilligramPerDeciliter, new string[]{"mg/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MilligramPerLiter, new string[]{"mg/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.MilligramPerMilliliter, new string[]{"mg/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.NanogramPerDeciliter, new string[]{"ng/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.NanogramPerLiter, new string[]{"ng/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.NanogramPerMilliliter, new string[]{"ng/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PicogramPerDeciliter, new string[]{"pg/dl"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PicogramPerLiter, new string[]{"pg/L"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PicogramPerMilliliter, new string[]{"pg/ml"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PoundPerCubicFoot, new string[]{"lb/ft³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PoundPerCubicInch, new string[]{"lb/in³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PoundPerImperialGallon, new string[]{"ppg (imp.)"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.PoundPerUSGallon, new string[]{"ppg (U.S.)"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.SlugPerCubicFoot, new string[]{"slug/ft³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.TonnePerCubicCentimeter, new string[]{"t/cm³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.TonnePerCubicMeter, new string[]{"t/m³"}), + ("en-US", typeof(DensityUnit), (int)DensityUnit.TonnePerCubicMillimeter, new string[]{"t/mm³"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Day, new string[]{"d", "day", "days"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Day, new string[]{"д"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Hour, new string[]{"h", "hr", "hrs", "hour", "hours"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Hour, new string[]{"ч"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Microsecond, new string[]{"µs"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Microsecond, new string[]{"мкс"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Millisecond, new string[]{"ms"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Millisecond, new string[]{"мс"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Minute, new string[]{"m", "min", "minute", "minutes"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Minute, new string[]{"мин"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Month30, new string[]{"mo", "month", "months"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Month30, new string[]{"месяц"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Nanosecond, new string[]{"ns"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Nanosecond, new string[]{"нс"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Second, new string[]{"s", "sec", "secs", "second", "seconds"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Second, new string[]{"с"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Week, new string[]{"wk", "week", "weeks"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Week, new string[]{"мин"}), + ("en-US", typeof(DurationUnit), (int)DurationUnit.Year365, new string[]{"yr", "year", "years"}), + ("ru-RU", typeof(DurationUnit), (int)DurationUnit.Year365, new string[]{"год"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.Centipoise, new string[]{"cP"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.MicropascalSecond, new string[]{"µPaS"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.MillipascalSecond, new string[]{"mPaS"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.NewtonSecondPerMeterSquared, new string[]{"Ns/m²"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.PascalSecond, new string[]{"PaS"}), + ("en-US", typeof(DynamicViscosityUnit), (int)DynamicViscosityUnit.Poise, new string[]{"P"}), + ("en-US", typeof(ElectricAdmittanceUnit), (int)ElectricAdmittanceUnit.Microsiemens, new string[]{"µS"}), + ("en-US", typeof(ElectricAdmittanceUnit), (int)ElectricAdmittanceUnit.Millisiemens, new string[]{"mS"}), + ("en-US", typeof(ElectricAdmittanceUnit), (int)ElectricAdmittanceUnit.Nanosiemens, new string[]{"nS"}), + ("en-US", typeof(ElectricAdmittanceUnit), (int)ElectricAdmittanceUnit.Siemens, new string[]{"S"}), + ("en-US", typeof(ElectricChargeUnit), (int)ElectricChargeUnit.Coulomb, new string[]{"C"}), + ("en-US", typeof(ElectricChargeDensityUnit), (int)ElectricChargeDensityUnit.CoulombPerCubicMeter, new string[]{"C/m³"}), + ("en-US", typeof(ElectricConductanceUnit), (int)ElectricConductanceUnit.Microsiemens, new string[]{"µS"}), + ("en-US", typeof(ElectricConductanceUnit), (int)ElectricConductanceUnit.Millisiemens, new string[]{"mS"}), + ("en-US", typeof(ElectricConductanceUnit), (int)ElectricConductanceUnit.Siemens, new string[]{"S"}), + ("en-US", typeof(ElectricConductivityUnit), (int)ElectricConductivityUnit.SiemensPerMeter, new string[]{"S/m"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Ampere, new string[]{"A"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Centiampere, new string[]{"cA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Kiloampere, new string[]{"kA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Megaampere, new string[]{"MA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Microampere, new string[]{"µA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Milliampere, new string[]{"mA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Nanoampere, new string[]{"nA"}), + ("en-US", typeof(ElectricCurrentUnit), (int)ElectricCurrentUnit.Picoampere, new string[]{"pA"}), + ("en-US", typeof(ElectricCurrentDensityUnit), (int)ElectricCurrentDensityUnit.AmperePerSquareMeter, new string[]{"A/m²"}), + ("en-US", typeof(ElectricCurrentGradientUnit), (int)ElectricCurrentGradientUnit.AmperePerSecond, new string[]{"A/s"}), + ("en-US", typeof(ElectricFieldUnit), (int)ElectricFieldUnit.VoltPerMeter, new string[]{"V/m"}), + ("en-US", typeof(ElectricInductanceUnit), (int)ElectricInductanceUnit.Henry, new string[]{"H"}), + ("en-US", typeof(ElectricInductanceUnit), (int)ElectricInductanceUnit.Microhenry, new string[]{"µH"}), + ("en-US", typeof(ElectricInductanceUnit), (int)ElectricInductanceUnit.Millihenry, new string[]{"mH"}), + ("en-US", typeof(ElectricInductanceUnit), (int)ElectricInductanceUnit.Nanohenry, new string[]{"nH"}), + ("en-US", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Kilovolt, new string[]{"kV"}), + ("ru-RU", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Kilovolt, new string[]{"kВ"}), + ("en-US", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Megavolt, new string[]{"MV"}), + ("ru-RU", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Megavolt, new string[]{"MВ"}), + ("en-US", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Microvolt, new string[]{"µV"}), + ("ru-RU", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Microvolt, new string[]{"µВ"}), + ("en-US", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Millivolt, new string[]{"mV"}), + ("ru-RU", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Millivolt, new string[]{"mВ"}), + ("en-US", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Volt, new string[]{"V"}), + ("ru-RU", typeof(ElectricPotentialUnit), (int)ElectricPotentialUnit.Volt, new string[]{"В"}), + ("en-US", typeof(ElectricPotentialAcUnit), (int)ElectricPotentialAcUnit.KilovoltAc, new string[]{"kVac"}), + ("en-US", typeof(ElectricPotentialAcUnit), (int)ElectricPotentialAcUnit.MegavoltAc, new string[]{"MVac"}), + ("en-US", typeof(ElectricPotentialAcUnit), (int)ElectricPotentialAcUnit.MicrovoltAc, new string[]{"µVac"}), + ("en-US", typeof(ElectricPotentialAcUnit), (int)ElectricPotentialAcUnit.MillivoltAc, new string[]{"mVac"}), + ("en-US", typeof(ElectricPotentialAcUnit), (int)ElectricPotentialAcUnit.VoltAc, new string[]{"Vac"}), + ("en-US", typeof(ElectricPotentialDcUnit), (int)ElectricPotentialDcUnit.KilovoltDc, new string[]{"kVdc"}), + ("en-US", typeof(ElectricPotentialDcUnit), (int)ElectricPotentialDcUnit.MegavoltDc, new string[]{"MVdc"}), + ("en-US", typeof(ElectricPotentialDcUnit), (int)ElectricPotentialDcUnit.MicrovoltDc, new string[]{"µVdc"}), + ("en-US", typeof(ElectricPotentialDcUnit), (int)ElectricPotentialDcUnit.MillivoltDc, new string[]{"mVdc"}), + ("en-US", typeof(ElectricPotentialDcUnit), (int)ElectricPotentialDcUnit.VoltDc, new string[]{"Vdc"}), + ("en-US", typeof(ElectricResistanceUnit), (int)ElectricResistanceUnit.Gigaohm, new string[]{"GΩ"}), + ("en-US", typeof(ElectricResistanceUnit), (int)ElectricResistanceUnit.Kiloohm, new string[]{"kΩ"}), + ("en-US", typeof(ElectricResistanceUnit), (int)ElectricResistanceUnit.Megaohm, new string[]{"MΩ"}), + ("en-US", typeof(ElectricResistanceUnit), (int)ElectricResistanceUnit.Milliohm, new string[]{"mΩ"}), + ("en-US", typeof(ElectricResistanceUnit), (int)ElectricResistanceUnit.Ohm, new string[]{"Ω"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.KiloohmCentimeter, new string[]{"kΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.KiloohmMeter, new string[]{"kΩ·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MegaohmCentimeter, new string[]{"MΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MegaohmMeter, new string[]{"MΩ·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MicroohmCentimeter, new string[]{"µΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MicroohmMeter, new string[]{"µΩ·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MilliohmCentimeter, new string[]{"mΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.MilliohmMeter, new string[]{"mΩ·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.NanoohmCentimeter, new string[]{"nΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.NanoohmMeter, new string[]{"nΩ·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.OhmCentimeter, new string[]{"Ω·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.OhmMeter, new string[]{"Ω·m"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.PicoohmCentimeter, new string[]{"pΩ·cm"}), + ("en-US", typeof(ElectricResistivityUnit), (int)ElectricResistivityUnit.PicoohmMeter, new string[]{"pΩ·m"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.BritishThermalUnit, new string[]{"BTU"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Calorie, new string[]{"cal"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.DecathermEc, new string[]{"Dth (E.C.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.DecathermEc, new string[]{"Европейский декатерм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.DecathermImperial, new string[]{"Dth (imp.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.DecathermImperial, new string[]{"Английский декатерм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.DecathermUs, new string[]{"Dth (U.S.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.DecathermUs, new string[]{"Американский декатерм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.ElectronVolt, new string[]{"eV"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Erg, new string[]{"erg"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.FootPound, new string[]{"ft·lb"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.GigabritishThermalUnit, new string[]{"GBTU"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.GigawattHour, new string[]{"GWh"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.GigawattHour, new string[]{"GВт/ч"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Joule, new string[]{"J"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.KilobritishThermalUnit, new string[]{"kBTU"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Kilocalorie, new string[]{"kcal"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Kilojoule, new string[]{"kJ"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.KilowattHour, new string[]{"kWh"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.KilowattHour, new string[]{"kВт/ч"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.MegabritishThermalUnit, new string[]{"MBTU"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.Megajoule, new string[]{"MJ"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.MegawattHour, new string[]{"MWh"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.MegawattHour, new string[]{"MВт/ч"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.ThermEc, new string[]{"th (E.C.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.ThermEc, new string[]{"Европейский терм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.ThermImperial, new string[]{"th (imp.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.ThermImperial, new string[]{"Английский терм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.ThermUs, new string[]{"th (U.S.)"}), + ("ru-RU", typeof(EnergyUnit), (int)EnergyUnit.ThermUs, new string[]{"Американский терм"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.WattHour, new string[]{"Wh"}), + ("en-US", typeof(EnergyUnit), (int)EnergyUnit.WattHour, new string[]{"Вт/ч"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.CaloriePerKelvin, new string[]{"cal/K"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.JoulePerDegreeCelsius, new string[]{"J/C"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.JoulePerKelvin, new string[]{"J/K"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.KilocaloriePerKelvin, new string[]{"kcal/K"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.KilojoulePerDegreeCelsius, new string[]{"kJ/C"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.KilojoulePerKelvin, new string[]{"kJ/K"}), + ("en-US", typeof(EntropyUnit), (int)EntropyUnit.MegajoulePerKelvin, new string[]{"MJ/K"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Decanewton, new string[]{"daN"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Decanewton, new string[]{"даН"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Dyn, new string[]{"dyn"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Dyn, new string[]{"дин"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.KilogramForce, new string[]{"kgf"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.KilogramForce, new string[]{"кгс"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Kilonewton, new string[]{"kN"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Kilonewton, new string[]{"кН"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.KiloPond, new string[]{"kp"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.KiloPond, new string[]{"кгс"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Meganewton, new string[]{"MN"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Meganewton, new string[]{"МН"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Micronewton, new string[]{"µN"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Micronewton, new string[]{"мкН"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Millinewton, new string[]{"mN"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Millinewton, new string[]{"мН"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Newton, new string[]{"N"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Newton, new string[]{"Н"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.OunceForce, new string[]{"ozf"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.Poundal, new string[]{"pdl"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.Poundal, new string[]{"паундаль"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.PoundForce, new string[]{"lbf"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.PoundForce, new string[]{"фунт-сила"}), + ("en-US", typeof(ForceUnit), (int)ForceUnit.TonneForce, new string[]{"Ton"}), + ("ru-RU", typeof(ForceUnit), (int)ForceUnit.TonneForce, new string[]{"тс"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.CentinewtonPerSecond, new string[]{"cN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.DecanewtonPerMinute, new string[]{"daN/min"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.DecanewtonPerSecond, new string[]{"daN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.DecinewtonPerSecond, new string[]{"dN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.KilonewtonPerMinute, new string[]{"kN/min"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.KilonewtonPerSecond, new string[]{"kN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.MicronewtonPerSecond, new string[]{"µN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.MillinewtonPerSecond, new string[]{"mN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.NanonewtonPerSecond, new string[]{"nN/s"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.NewtonPerMinute, new string[]{"N/min"}), + ("en-US", typeof(ForceChangeRateUnit), (int)ForceChangeRateUnit.NewtonPerSecond, new string[]{"N/s"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.CentinewtonPerMeter, new string[]{"cN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.DecinewtonPerMeter, new string[]{"dN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.KilogramForcePerMeter, new string[]{"kgf/m"}), + ("ru-RU", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.KilogramForcePerMeter, new string[]{"кгс/м"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.KilonewtonPerMeter, new string[]{"kN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.MeganewtonPerMeter, new string[]{"MN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.MicronewtonPerMeter, new string[]{"µN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.MillinewtonPerMeter, new string[]{"mN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.NanonewtonPerMeter, new string[]{"nN/m"}), + ("en-US", typeof(ForcePerLengthUnit), (int)ForcePerLengthUnit.NewtonPerMeter, new string[]{"N/m"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.CyclePerHour, new string[]{"cph"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.CyclePerMinute, new string[]{"cpm"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.Gigahertz, new string[]{"GHz"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.Hertz, new string[]{"Hz"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.Kilohertz, new string[]{"kHz"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.Megahertz, new string[]{"MHz"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.RadianPerSecond, new string[]{"rad/s"}), + ("en-US", typeof(FrequencyUnit), (int)FrequencyUnit.Terahertz, new string[]{"THz"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.BtuPerHourSquareFoot, new string[]{"BTU/h·ft²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.BtuPerMinuteSquareFoot, new string[]{"BTU/min·ft²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.BtuPerSecondSquareFoot, new string[]{"BTU/s·ft²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.BtuPerSecondSquareInch, new string[]{"BTU/s·in²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.CaloriePerSecondSquareCentimeter, new string[]{"cal/s·cm²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.CentiwattPerSquareMeter, new string[]{"cW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.DeciwattPerSquareMeter, new string[]{"dW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.KilocaloriePerHourSquareMeter, new string[]{"kcal/h·m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.KilocaloriePerSecondSquareCentimeter, new string[]{"kcal/s·cm²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.KilowattPerSquareMeter, new string[]{"kW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.MicrowattPerSquareMeter, new string[]{"µW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.MilliwattPerSquareMeter, new string[]{"mW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.NanowattPerSquareMeter, new string[]{"nW/m²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.PoundForcePerFootSecond, new string[]{"lbf/(ft·s)"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.PoundPerSecondCubed, new string[]{"lb/s³", "lbm/s³"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.WattPerSquareFoot, new string[]{"W/ft²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.WattPerSquareInch, new string[]{"W/in²"}), + ("en-US", typeof(HeatFluxUnit), (int)HeatFluxUnit.WattPerSquareMeter, new string[]{"W/m²"}), + ("en-US", typeof(HeatTransferCoefficientUnit), (int)HeatTransferCoefficientUnit.WattPerSquareMeterCelsius, new string[]{"W/m²·°C"}), + ("en-US", typeof(HeatTransferCoefficientUnit), (int)HeatTransferCoefficientUnit.WattPerSquareMeterKelvin, new string[]{"W/m²·K"}), + ("en-US", typeof(IlluminanceUnit), (int)IlluminanceUnit.Kilolux, new string[]{"klx"}), + ("en-US", typeof(IlluminanceUnit), (int)IlluminanceUnit.Lux, new string[]{"lx"}), + ("en-US", typeof(IlluminanceUnit), (int)IlluminanceUnit.Megalux, new string[]{"Mlx"}), + ("en-US", typeof(IlluminanceUnit), (int)IlluminanceUnit.Millilux, new string[]{"mlx"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Bit, new string[]{"b"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Byte, new string[]{"B"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Exabit, new string[]{"Eb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Exabyte, new string[]{"EB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Exbibit, new string[]{"Eib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Exbibyte, new string[]{"EiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Gibibit, new string[]{"Gib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Gibibyte, new string[]{"GiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Gigabit, new string[]{"Gb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Gigabyte, new string[]{"GB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Kibibit, new string[]{"Kib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Kibibyte, new string[]{"KiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Kilobit, new string[]{"kb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Kilobyte, new string[]{"kB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Mebibit, new string[]{"Mib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Mebibyte, new string[]{"MiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Megabit, new string[]{"Mb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Megabyte, new string[]{"MB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Pebibit, new string[]{"Pib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Pebibyte, new string[]{"PiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Petabit, new string[]{"Pb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Petabyte, new string[]{"PB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Tebibit, new string[]{"Tib"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Tebibyte, new string[]{"TiB"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Terabit, new string[]{"Tb"}), + ("en-US", typeof(InformationUnit), (int)InformationUnit.Terabyte, new string[]{"TB"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.KilowattPerSquareCentimeter, new string[]{"kW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.KilowattPerSquareMeter, new string[]{"kW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MegawattPerSquareCentimeter, new string[]{"MW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MegawattPerSquareMeter, new string[]{"MW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MicrowattPerSquareCentimeter, new string[]{"µW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MicrowattPerSquareMeter, new string[]{"µW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MilliwattPerSquareCentimeter, new string[]{"mW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.MilliwattPerSquareMeter, new string[]{"mW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.NanowattPerSquareCentimeter, new string[]{"nW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.NanowattPerSquareMeter, new string[]{"nW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.PicowattPerSquareCentimeter, new string[]{"pW/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.PicowattPerSquareMeter, new string[]{"pW/m²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.WattPerSquareCentimeter, new string[]{"W/cm²"}), + ("en-US", typeof(IrradianceUnit), (int)IrradianceUnit.WattPerSquareMeter, new string[]{"W/m²"}), + ("en-US", typeof(IrradiationUnit), (int)IrradiationUnit.JoulePerSquareMeter, new string[]{"J/m²"}), + ("en-US", typeof(IrradiationUnit), (int)IrradiationUnit.JoulePerSquareMillimeter, new string[]{"J/mm²"}), + ("en-US", typeof(IrradiationUnit), (int)IrradiationUnit.KilowattHourPerSquareMeter, new string[]{"kWh/m²"}), + ("en-US", typeof(IrradiationUnit), (int)IrradiationUnit.WattHourPerSquareMeter, new string[]{"Wh/m²"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Centistokes, new string[]{"cSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Centistokes, new string[]{"сСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Decistokes, new string[]{"dSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Decistokes, new string[]{"дСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Kilostokes, new string[]{"kSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Kilostokes, new string[]{"кСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Microstokes, new string[]{"µSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Microstokes, new string[]{"мкСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Millistokes, new string[]{"mSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Millistokes, new string[]{"мСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Nanostokes, new string[]{"nSt"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Nanostokes, new string[]{"нСт"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.SquareMeterPerSecond, new string[]{"m²/s"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.SquareMeterPerSecond, new string[]{"м²/с"}), + ("en-US", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Stokes, new string[]{"St"}), + ("ru-RU", typeof(KinematicViscosityUnit), (int)KinematicViscosityUnit.Stokes, new string[]{"Ст"}), + ("en-US", typeof(LapseRateUnit), (int)LapseRateUnit.DegreeCelsiusPerKilometer, new string[]{"∆°C/km"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Centimeter, new string[]{"cm"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Centimeter, new string[]{"см"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Decimeter, new string[]{"dm"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Decimeter, new string[]{"дм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.DtpPica, new string[]{"pica"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.DtpPoint, new string[]{"pt"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Fathom, new string[]{"fathom"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Foot, new string[]{"ft", "'", "′"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Foot, new string[]{"фут"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Inch, new string[]{"in", "\"", "″"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Inch, new string[]{"дюйм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Kilometer, new string[]{"km"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Kilometer, new string[]{"км"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Meter, new string[]{"m"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Meter, new string[]{"м"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Microinch, new string[]{"µin"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Microinch, new string[]{"микродюйм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Micrometer, new string[]{"µm"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Micrometer, new string[]{"мкм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Mil, new string[]{"mil"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Mil, new string[]{"мил"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Mile, new string[]{"mi"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Mile, new string[]{"миля"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Millimeter, new string[]{"mm"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Millimeter, new string[]{"мм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Nanometer, new string[]{"nm"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Nanometer, new string[]{"нм"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.NauticalMile, new string[]{"NM"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.NauticalMile, new string[]{"мил"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.PrinterPica, new string[]{"pica"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.PrinterPoint, new string[]{"pt"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Shackle, new string[]{"shackle"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Twip, new string[]{"twip"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.UsSurveyFoot, new string[]{"ftUS"}), + ("en-US", typeof(LengthUnit), (int)LengthUnit.Yard, new string[]{"yd"}), + ("ru-RU", typeof(LengthUnit), (int)LengthUnit.Yard, new string[]{"ярд"}), + ("en-US", typeof(LevelUnit), (int)LevelUnit.Decibel, new string[]{"dB"}), + ("en-US", typeof(LevelUnit), (int)LevelUnit.Neper, new string[]{"Np"}), + ("en-US", typeof(LinearDensityUnit), (int)LinearDensityUnit.GramPerMeter, new string[]{"g/m"}), + ("en-US", typeof(LinearDensityUnit), (int)LinearDensityUnit.KilogramPerMeter, new string[]{"kg/m"}), + ("en-US", typeof(LinearDensityUnit), (int)LinearDensityUnit.PoundPerFoot, new string[]{"lb/ft"}), + ("en-US", typeof(LuminousFluxUnit), (int)LuminousFluxUnit.Lumen, new string[]{"lm"}), + ("en-US", typeof(LuminousIntensityUnit), (int)LuminousIntensityUnit.Candela, new string[]{"cd"}), + ("en-US", typeof(MagneticFieldUnit), (int)MagneticFieldUnit.Microtesla, new string[]{"µT"}), + ("en-US", typeof(MagneticFieldUnit), (int)MagneticFieldUnit.Millitesla, new string[]{"mT"}), + ("en-US", typeof(MagneticFieldUnit), (int)MagneticFieldUnit.Nanotesla, new string[]{"nT"}), + ("en-US", typeof(MagneticFieldUnit), (int)MagneticFieldUnit.Tesla, new string[]{"T"}), + ("en-US", typeof(MagneticFluxUnit), (int)MagneticFluxUnit.Weber, new string[]{"Wb"}), + ("en-US", typeof(MagnetizationUnit), (int)MagnetizationUnit.AmperePerMeter, new string[]{"A/m"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Centigram, new string[]{"cg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Centigram, new string[]{"сг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Decagram, new string[]{"dag"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Decagram, new string[]{"даг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Decigram, new string[]{"dg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Decigram, new string[]{"дг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Grain, new string[]{"gr"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Gram, new string[]{"g"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Gram, new string[]{"г"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Hectogram, new string[]{"hg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Hectogram, new string[]{"гг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Kilogram, new string[]{"kg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Kilogram, new string[]{"кг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Kilopound, new string[]{"klb"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Kilopound, new string[]{"kфунт"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Kilotonne, new string[]{"kt"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Kilotonne, new string[]{"кт"}), + ("en-US", typeof(MassUnit), (int)MassUnit.LongHundredweight, new string[]{"cwt"}), + ("en-US", typeof(MassUnit), (int)MassUnit.LongTon, new string[]{"long tn"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.LongTon, new string[]{"тонна большая"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Megapound, new string[]{"Mlb"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Megapound, new string[]{"Mфунт"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Megatonne, new string[]{"Mt"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Megatonne, new string[]{"Мт"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Microgram, new string[]{"µg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Microgram, new string[]{"мкг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Milligram, new string[]{"mg"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Milligram, new string[]{"мг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Nanogram, new string[]{"ng"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Nanogram, new string[]{"нг"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Ounce, new string[]{"oz"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Pound, new string[]{"lb", "lbs", "lbm"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Pound, new string[]{"фунт"}), + ("en-US", typeof(MassUnit), (int)MassUnit.ShortHundredweight, new string[]{"cwt"}), + ("en-US", typeof(MassUnit), (int)MassUnit.ShortTon, new string[]{"short tn"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.ShortTon, new string[]{"тонна малая"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Slug, new string[]{"slug"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Stone, new string[]{"st"}), + ("en-US", typeof(MassUnit), (int)MassUnit.Tonne, new string[]{"t"}), + ("ru-RU", typeof(MassUnit), (int)MassUnit.Tonne, new string[]{"т"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.CentigramPerDay, new string[]{"cg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.CentigramPerSecond, new string[]{"cg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.DecagramPerDay, new string[]{"dag/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.DecagramPerSecond, new string[]{"dag/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.DecigramPerDay, new string[]{"dg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.DecigramPerSecond, new string[]{"dg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.GramPerDay, new string[]{"g/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.GramPerHour, new string[]{"g/h"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.GramPerSecond, new string[]{"g/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.HectogramPerDay, new string[]{"hg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.HectogramPerSecond, new string[]{"hg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerDay, new string[]{"kg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerHour, new string[]{"kg/h"}), + ("ru-RU", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerHour, new string[]{"кг/ч"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerMinute, new string[]{"kg/min"}), + ("ru-RU", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerMinute, new string[]{"кг/мин"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.KilogramPerSecond, new string[]{"kg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegagramPerDay, new string[]{"Mg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegapoundPerDay, new string[]{"Mlb/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegapoundPerHour, new string[]{"Mlb/h"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MegapoundPerMinute, new string[]{"Mlb/min"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MicrogramPerDay, new string[]{"µg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MicrogramPerSecond, new string[]{"µg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MilligramPerDay, new string[]{"mg/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.MilligramPerSecond, new string[]{"mg/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.NanogramPerDay, new string[]{"ng/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.NanogramPerSecond, new string[]{"ng/S"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.PoundPerDay, new string[]{"lb/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.PoundPerHour, new string[]{"lb/h"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.PoundPerMinute, new string[]{"lb/min"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.ShortTonPerHour, new string[]{"short tn/h"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.TonnePerDay, new string[]{"t/d"}), + ("en-US", typeof(MassFlowUnit), (int)MassFlowUnit.TonnePerHour, new string[]{"t/h"}), + ("en-US", typeof(MassFluxUnit), (int)MassFluxUnit.GramPerSecondPerSquareMeter, new string[]{"g·s⁻¹·m⁻²"}), + ("en-US", typeof(MassFluxUnit), (int)MassFluxUnit.KilogramPerSecondPerSquareMeter, new string[]{"kg·s⁻¹·m⁻²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.GramSquareCentimeter, new string[]{"g·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.GramSquareDecimeter, new string[]{"g·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.GramSquareMeter, new string[]{"g·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.GramSquareMillimeter, new string[]{"g·mm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilogramSquareCentimeter, new string[]{"kg·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilogramSquareDecimeter, new string[]{"kg·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilogramSquareMeter, new string[]{"kg·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilogramSquareMillimeter, new string[]{"kg·mm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilotonneSquareCentimeter, new string[]{"kt·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilotonneSquareDecimeter, new string[]{"kt·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilotonneSquareMeter, new string[]{"kt·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.KilotonneSquareMilimeter, new string[]{"kt·mm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MegatonneSquareCentimeter, new string[]{"Mt·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MegatonneSquareDecimeter, new string[]{"Mt·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MegatonneSquareMeter, new string[]{"Mt·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MegatonneSquareMilimeter, new string[]{"Mt·mm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MilligramSquareCentimeter, new string[]{"mg·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MilligramSquareDecimeter, new string[]{"mg·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MilligramSquareMeter, new string[]{"mg·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.MilligramSquareMillimeter, new string[]{"mg·mm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.PoundSquareFoot, new string[]{"lb·ft²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.PoundSquareInch, new string[]{"lb·in²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.SlugSquareFoot, new string[]{"slug·ft²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.SlugSquareInch, new string[]{"slug·in²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.TonneSquareCentimeter, new string[]{"t·cm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.TonneSquareDecimeter, new string[]{"t·dm²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.TonneSquareMeter, new string[]{"t·m²"}), + ("en-US", typeof(MassMomentOfInertiaUnit), (int)MassMomentOfInertiaUnit.TonneSquareMilimeter, new string[]{"t·mm²"}), + ("en-US", typeof(MolarEnergyUnit), (int)MolarEnergyUnit.JoulePerMole, new string[]{"J/mol"}), + ("en-US", typeof(MolarEnergyUnit), (int)MolarEnergyUnit.KilojoulePerMole, new string[]{"kJ/mol"}), + ("en-US", typeof(MolarEnergyUnit), (int)MolarEnergyUnit.MegajoulePerMole, new string[]{"MJ/mol"}), + ("en-US", typeof(MolarEntropyUnit), (int)MolarEntropyUnit.JoulePerMoleKelvin, new string[]{"J/(mol*K)"}), + ("en-US", typeof(MolarEntropyUnit), (int)MolarEntropyUnit.KilojoulePerMoleKelvin, new string[]{"kJ/(mol*K)"}), + ("en-US", typeof(MolarEntropyUnit), (int)MolarEntropyUnit.MegajoulePerMoleKelvin, new string[]{"MJ/(mol*K)"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.CentimolesPerLiter, new string[]{"cmol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.DecimolesPerLiter, new string[]{"dmol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.MicromolesPerLiter, new string[]{"µmol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.MillimolesPerLiter, new string[]{"mmol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.MolesPerCubicMeter, new string[]{"mol/m³"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.MolesPerLiter, new string[]{"mol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.NanomolesPerLiter, new string[]{"nmol/L"}), + ("en-US", typeof(MolarityUnit), (int)MolarityUnit.PicomolesPerLiter, new string[]{"pmol/L"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.CentigramPerMole, new string[]{"cg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.CentigramPerMole, new string[]{"сг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.DecagramPerMole, new string[]{"dag/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.DecagramPerMole, new string[]{"даг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.DecigramPerMole, new string[]{"dg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.DecigramPerMole, new string[]{"дг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.GramPerMole, new string[]{"g/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.GramPerMole, new string[]{"г/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.HectogramPerMole, new string[]{"hg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.HectogramPerMole, new string[]{"гг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.KilogramPerMole, new string[]{"kg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.KilogramPerMole, new string[]{"кг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.KilopoundPerMole, new string[]{"klb/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.KilopoundPerMole, new string[]{"kфунт/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.MegapoundPerMole, new string[]{"Mlb/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.MegapoundPerMole, new string[]{"Mфунт/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.MicrogramPerMole, new string[]{"µg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.MicrogramPerMole, new string[]{"мкг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.MilligramPerMole, new string[]{"mg/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.MilligramPerMole, new string[]{"мг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.NanogramPerMole, new string[]{"ng/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.NanogramPerMole, new string[]{"нг/моль"}), + ("en-US", typeof(MolarMassUnit), (int)MolarMassUnit.PoundPerMole, new string[]{"lb/mol"}), + ("ru-RU", typeof(MolarMassUnit), (int)MolarMassUnit.PoundPerMole, new string[]{"фунт/моль"}), + ("en-US", typeof(PermeabilityUnit), (int)PermeabilityUnit.HenryPerMeter, new string[]{"H/m"}), + ("en-US", typeof(PermittivityUnit), (int)PermittivityUnit.FaradPerMeter, new string[]{"F/m"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.BoilerHorsepower, new string[]{"hp(S)"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.BritishThermalUnitPerHour, new string[]{"Btu/hr"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Decawatt, new string[]{"daW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Deciwatt, new string[]{"dW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.ElectricalHorsepower, new string[]{"hp(E)"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Femtowatt, new string[]{"fW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Gigawatt, new string[]{"GW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.HydraulicHorsepower, new string[]{"hp(H)"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.KilobritishThermalUnitPerHour, new string[]{"kBtu/hr"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Kilowatt, new string[]{"kW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.MechanicalHorsepower, new string[]{"hp(I)"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Megawatt, new string[]{"MW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.MetricHorsepower, new string[]{"hp(M)"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Microwatt, new string[]{"µW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Milliwatt, new string[]{"mW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Nanowatt, new string[]{"nW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Petawatt, new string[]{"PW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Picowatt, new string[]{"pW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Terawatt, new string[]{"TW"}), + ("en-US", typeof(PowerUnit), (int)PowerUnit.Watt, new string[]{"W"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DecawattPerCubicFoot, new string[]{"daW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DecawattPerCubicInch, new string[]{"daW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DecawattPerCubicMeter, new string[]{"daW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DecawattPerLiter, new string[]{"daW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DeciwattPerCubicFoot, new string[]{"dW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DeciwattPerCubicInch, new string[]{"dW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DeciwattPerCubicMeter, new string[]{"dW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.DeciwattPerLiter, new string[]{"dW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.GigawattPerCubicFoot, new string[]{"GW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.GigawattPerCubicInch, new string[]{"GW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.GigawattPerCubicMeter, new string[]{"GW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.GigawattPerLiter, new string[]{"GW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.KilowattPerCubicFoot, new string[]{"kW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.KilowattPerCubicInch, new string[]{"kW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.KilowattPerCubicMeter, new string[]{"kW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.KilowattPerLiter, new string[]{"kW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MegawattPerCubicFoot, new string[]{"MW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MegawattPerCubicInch, new string[]{"MW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MegawattPerCubicMeter, new string[]{"MW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MegawattPerLiter, new string[]{"MW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MicrowattPerCubicFoot, new string[]{"µW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MicrowattPerCubicInch, new string[]{"µW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MicrowattPerCubicMeter, new string[]{"µW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MicrowattPerLiter, new string[]{"µW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MilliwattPerCubicFoot, new string[]{"mW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MilliwattPerCubicInch, new string[]{"mW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MilliwattPerCubicMeter, new string[]{"mW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.MilliwattPerLiter, new string[]{"mW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.NanowattPerCubicFoot, new string[]{"nW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.NanowattPerCubicInch, new string[]{"nW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.NanowattPerCubicMeter, new string[]{"nW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.NanowattPerLiter, new string[]{"nW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.PicowattPerCubicFoot, new string[]{"pW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.PicowattPerCubicInch, new string[]{"pW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.PicowattPerCubicMeter, new string[]{"pW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.PicowattPerLiter, new string[]{"pW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.TerawattPerCubicFoot, new string[]{"TW/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.TerawattPerCubicInch, new string[]{"TW/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.TerawattPerCubicMeter, new string[]{"TW/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.TerawattPerLiter, new string[]{"TW/l"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.WattPerCubicFoot, new string[]{"W/ft³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.WattPerCubicInch, new string[]{"W/in³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.WattPerCubicMeter, new string[]{"W/m³"}), + ("en-US", typeof(PowerDensityUnit), (int)PowerDensityUnit.WattPerLiter, new string[]{"W/l"}), + ("en-US", typeof(PowerRatioUnit), (int)PowerRatioUnit.DecibelMilliwatt, new string[]{"dBmW", "dBm"}), + ("en-US", typeof(PowerRatioUnit), (int)PowerRatioUnit.DecibelWatt, new string[]{"dBW"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Atmosphere, new string[]{"atm"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Atmosphere, new string[]{"атм"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Bar, new string[]{"bar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Bar, new string[]{"бар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Centibar, new string[]{"cbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Centibar, new string[]{"cбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Decapascal, new string[]{"daPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Decapascal, new string[]{"даПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Decibar, new string[]{"dbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Decibar, new string[]{"dбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.DynePerSquareCentimeter, new string[]{"dyn/cm²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.FootOfHead, new string[]{"ft of head"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Gigapascal, new string[]{"GPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Gigapascal, new string[]{"ГПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Hectopascal, new string[]{"hPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Hectopascal, new string[]{"гПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.InchOfMercury, new string[]{"inHg"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.InchOfWaterColumn, new string[]{"wc"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Kilobar, new string[]{"kbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Kilobar, new string[]{"kбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareCentimeter, new string[]{"kgf/cm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareCentimeter, new string[]{"кгс/см²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareMeter, new string[]{"kgf/m²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareMeter, new string[]{"кгс/м²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareMillimeter, new string[]{"kgf/mm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilogramForcePerSquareMillimeter, new string[]{"кгс/мм²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareCentimeter, new string[]{"kN/cm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareCentimeter, new string[]{"кН/см²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareMeter, new string[]{"kN/m²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareMeter, new string[]{"кН/м²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareMillimeter, new string[]{"kN/mm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.KilonewtonPerSquareMillimeter, new string[]{"кН/мм²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Kilopascal, new string[]{"kPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Kilopascal, new string[]{"кПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilopoundForcePerSquareFoot, new string[]{"kipf/ft²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.KilopoundForcePerSquareInch, new string[]{"kipf/in²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Megabar, new string[]{"Mbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Megabar, new string[]{"Mбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.MeganewtonPerSquareMeter, new string[]{"MN/m²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.MeganewtonPerSquareMeter, new string[]{"Мн/м²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Megapascal, new string[]{"MPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Megapascal, new string[]{"МПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.MeterOfHead, new string[]{"m of head"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Microbar, new string[]{"µbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Microbar, new string[]{"µбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Micropascal, new string[]{"µPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Micropascal, new string[]{"мкПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Millibar, new string[]{"mbar"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Millibar, new string[]{"mбар"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.MillimeterOfMercury, new string[]{"mmHg"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Millipascal, new string[]{"mPa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Millipascal, new string[]{"ммПа"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareCentimeter, new string[]{"N/cm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareCentimeter, new string[]{"Н/см²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareMeter, new string[]{"N/m²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareMeter, new string[]{"Н/м²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareMillimeter, new string[]{"N/mm²"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.NewtonPerSquareMillimeter, new string[]{"Н/мм²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Pascal, new string[]{"Pa"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Pascal, new string[]{"Па"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.PoundForcePerSquareFoot, new string[]{"lb/ft²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.PoundForcePerSquareInch, new string[]{"psi", "lb/in²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.PoundPerInchSecondSquared, new string[]{"lbm/(in·s²)", "lb/(in·s²)"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.TechnicalAtmosphere, new string[]{"at"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.TechnicalAtmosphere, new string[]{"ат"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.TonneForcePerSquareCentimeter, new string[]{"tf/cm²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.TonneForcePerSquareMeter, new string[]{"tf/m²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.TonneForcePerSquareMillimeter, new string[]{"tf/mm²"}), + ("en-US", typeof(PressureUnit), (int)PressureUnit.Torr, new string[]{"torr"}), + ("ru-RU", typeof(PressureUnit), (int)PressureUnit.Torr, new string[]{"торр"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.AtmospherePerSecond, new string[]{"atm/s"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.AtmospherePerSecond, new string[]{"атм/с"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.KilopascalPerMinute, new string[]{"kPa/min"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.KilopascalPerMinute, new string[]{"кПа/мин"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.KilopascalPerSecond, new string[]{"kPa/s"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.KilopascalPerSecond, new string[]{"кПа/с"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.MegapascalPerMinute, new string[]{"MPa/min"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.MegapascalPerMinute, new string[]{"МПа/мин"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.MegapascalPerSecond, new string[]{"MPa/s"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.MegapascalPerSecond, new string[]{"МПа/с"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.PascalPerMinute, new string[]{"Pa/min"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.PascalPerMinute, new string[]{"Па/с"}), + ("en-US", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.PascalPerSecond, new string[]{"Pa/s"}), + ("ru-RU", typeof(PressureChangeRateUnit), (int)PressureChangeRateUnit.PascalPerSecond, new string[]{"Па/с"}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.DecimalFraction, new string[]{""}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.PartPerBillion, new string[]{"ppb"}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.PartPerMillion, new string[]{"ppm"}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.PartPerThousand, new string[]{"‰"}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.PartPerTrillion, new string[]{"ppt"}), + ("en-US", typeof(RatioUnit), (int)RatioUnit.Percent, new string[]{"%"}), + ("en-US", typeof(ReactiveEnergyUnit), (int)ReactiveEnergyUnit.KilovoltampereReactiveHour, new string[]{"kvarh"}), + ("en-US", typeof(ReactiveEnergyUnit), (int)ReactiveEnergyUnit.MegavoltampereReactiveHour, new string[]{"Mvarh"}), + ("en-US", typeof(ReactiveEnergyUnit), (int)ReactiveEnergyUnit.VoltampereReactiveHour, new string[]{"varh"}), + ("en-US", typeof(ReactivePowerUnit), (int)ReactivePowerUnit.GigavoltampereReactive, new string[]{"Gvar"}), + ("en-US", typeof(ReactivePowerUnit), (int)ReactivePowerUnit.KilovoltampereReactive, new string[]{"kvar"}), + ("en-US", typeof(ReactivePowerUnit), (int)ReactivePowerUnit.MegavoltampereReactive, new string[]{"Mvar"}), + ("en-US", typeof(ReactivePowerUnit), (int)ReactivePowerUnit.VoltampereReactive, new string[]{"var"}), + ("en-US", typeof(RotationalAccelerationUnit), (int)RotationalAccelerationUnit.DegreePerSecondSquared, new string[]{"°/s²", "deg/s²"}), + ("en-US", typeof(RotationalAccelerationUnit), (int)RotationalAccelerationUnit.RadianPerSecondSquared, new string[]{"rad/s²"}), + ("en-US", typeof(RotationalAccelerationUnit), (int)RotationalAccelerationUnit.RevolutionPerMinutePerSecond, new string[]{"rpm/s"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.CentiradianPerSecond, new string[]{"crad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.CentiradianPerSecond, new string[]{"cрад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.DeciradianPerSecond, new string[]{"drad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.DeciradianPerSecond, new string[]{"dрад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.DegreePerMinute, new string[]{"°/min", "deg/min"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.DegreePerSecond, new string[]{"°/s", "deg/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.DegreePerSecond, new string[]{"°/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MicrodegreePerSecond, new string[]{"µ°/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MicrodegreePerSecond, new string[]{"µ°/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MicroradianPerSecond, new string[]{"µrad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MicroradianPerSecond, new string[]{"µрад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MillidegreePerSecond, new string[]{"m°/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MillidegreePerSecond, new string[]{"m°/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MilliradianPerSecond, new string[]{"mrad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.MilliradianPerSecond, new string[]{"mрад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.NanodegreePerSecond, new string[]{"n°/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.NanodegreePerSecond, new string[]{"n°/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.NanoradianPerSecond, new string[]{"nrad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.NanoradianPerSecond, new string[]{"nрад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RadianPerSecond, new string[]{"rad/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RadianPerSecond, new string[]{"рад/с"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RevolutionPerMinute, new string[]{"rpm", "r/min"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RevolutionPerMinute, new string[]{"об/мин"}), + ("en-US", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RevolutionPerSecond, new string[]{"r/s"}), + ("ru-RU", typeof(RotationalSpeedUnit), (int)RotationalSpeedUnit.RevolutionPerSecond, new string[]{"об/с"}), + ("en-US", typeof(RotationalStiffnessUnit), (int)RotationalStiffnessUnit.KilonewtonMeterPerRadian, new string[]{"kN·m/rad"}), + ("en-US", typeof(RotationalStiffnessUnit), (int)RotationalStiffnessUnit.MeganewtonMeterPerRadian, new string[]{"MN·m/rad"}), + ("en-US", typeof(RotationalStiffnessUnit), (int)RotationalStiffnessUnit.NewtonMeterPerRadian, new string[]{"N·m/rad", "Nm/rad"}), + ("en-US", typeof(RotationalStiffnessPerLengthUnit), (int)RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter, new string[]{"kN·m/rad/m"}), + ("en-US", typeof(RotationalStiffnessPerLengthUnit), (int)RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter, new string[]{"MN·m/rad/m"}), + ("en-US", typeof(RotationalStiffnessPerLengthUnit), (int)RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter, new string[]{"N·m/rad/m", "Nm/rad/m"}), + ("en-US", typeof(SolidAngleUnit), (int)SolidAngleUnit.Steradian, new string[]{"sr"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.BtuPerPound, new string[]{"btu/lb"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.CaloriePerGram, new string[]{"cal/g"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.JoulePerKilogram, new string[]{"J/kg"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.KilocaloriePerGram, new string[]{"kcal/g"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.KilojoulePerKilogram, new string[]{"kJ/kg"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.KilowattHourPerKilogram, new string[]{"kWh/kg"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.MegajoulePerKilogram, new string[]{"MJ/kg"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.MegawattHourPerKilogram, new string[]{"MWh/kg"}), + ("en-US", typeof(SpecificEnergyUnit), (int)SpecificEnergyUnit.WattHourPerKilogram, new string[]{"Wh/kg"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.CaloriePerGramKelvin, new string[]{"cal/g.K"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.JoulePerKilogramDegreeCelsius, new string[]{"J/kg.C"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.JoulePerKilogramKelvin, new string[]{"J/kg.K"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.KilocaloriePerGramKelvin, new string[]{"kcal/g.K"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius, new string[]{"kJ/kg.C"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.KilojoulePerKilogramKelvin, new string[]{"kJ/kg.K"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius, new string[]{"MJ/kg.C"}), + ("en-US", typeof(SpecificEntropyUnit), (int)SpecificEntropyUnit.MegajoulePerKilogramKelvin, new string[]{"MJ/kg.K"}), + ("en-US", typeof(SpecificVolumeUnit), (int)SpecificVolumeUnit.CubicFootPerPound, new string[]{"ft³/lb"}), + ("en-US", typeof(SpecificVolumeUnit), (int)SpecificVolumeUnit.CubicMeterPerKilogram, new string[]{"m³/kg"}), + ("en-US", typeof(SpecificVolumeUnit), (int)SpecificVolumeUnit.MillicubicMeterPerKilogram, new string[]{"mm³/kg"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilogramForcePerCubicCentimeter, new string[]{"kgf/cm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilogramForcePerCubicMeter, new string[]{"kgf/m³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilogramForcePerCubicMillimeter, new string[]{"kgf/mm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilonewtonPerCubicCentimeter, new string[]{"kN/cm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilonewtonPerCubicMeter, new string[]{"kN/m³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilonewtonPerCubicMillimeter, new string[]{"kN/mm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilopoundForcePerCubicFoot, new string[]{"kipf/ft³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.KilopoundForcePerCubicInch, new string[]{"kipf/in³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.MeganewtonPerCubicMeter, new string[]{"MN/m³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.NewtonPerCubicCentimeter, new string[]{"N/cm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.NewtonPerCubicMeter, new string[]{"N/m³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.NewtonPerCubicMillimeter, new string[]{"N/mm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.PoundForcePerCubicFoot, new string[]{"lbf/ft³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.PoundForcePerCubicInch, new string[]{"lbf/in³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.TonneForcePerCubicCentimeter, new string[]{"tf/cm³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.TonneForcePerCubicMeter, new string[]{"tf/m³"}), + ("en-US", typeof(SpecificWeightUnit), (int)SpecificWeightUnit.TonneForcePerCubicMillimeter, new string[]{"tf/mm³"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.CentimeterPerHour, new string[]{"cm/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.CentimeterPerMinute, new string[]{"cm/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.CentimeterPerSecond, new string[]{"cm/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.DecimeterPerMinute, new string[]{"dm/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.DecimeterPerSecond, new string[]{"dm/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.FootPerHour, new string[]{"ft/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.FootPerMinute, new string[]{"ft/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.FootPerSecond, new string[]{"ft/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.InchPerHour, new string[]{"in/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.InchPerMinute, new string[]{"in/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.InchPerSecond, new string[]{"in/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.KilometerPerHour, new string[]{"km/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.KilometerPerMinute, new string[]{"km/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.KilometerPerSecond, new string[]{"km/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.Knot, new string[]{"kn", "kt", "knot", "knots"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MeterPerHour, new string[]{"m/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MeterPerMinute, new string[]{"m/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MeterPerSecond, new string[]{"m/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MicrometerPerMinute, new string[]{"µm/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MicrometerPerSecond, new string[]{"µm/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MilePerHour, new string[]{"mph"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MillimeterPerHour, new string[]{"mm/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MillimeterPerMinute, new string[]{"mm/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.MillimeterPerSecond, new string[]{"mm/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.NanometerPerMinute, new string[]{"nm/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.NanometerPerSecond, new string[]{"nm/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.UsSurveyFootPerHour, new string[]{"ftUS/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.UsSurveyFootPerMinute, new string[]{"ftUS/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.UsSurveyFootPerSecond, new string[]{"ftUS/s"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.YardPerHour, new string[]{"yd/h"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.YardPerMinute, new string[]{"yd/min"}), + ("en-US", typeof(SpeedUnit), (int)SpeedUnit.YardPerSecond, new string[]{"yd/s"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeCelsius, new string[]{"°C"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeDelisle, new string[]{"°De"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeFahrenheit, new string[]{"°F"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeNewton, new string[]{"°N"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeRankine, new string[]{"°R"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeReaumur, new string[]{"°Ré"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.DegreeRoemer, new string[]{"°Rø"}), + ("en-US", typeof(TemperatureUnit), (int)TemperatureUnit.Kelvin, new string[]{"K"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond, new string[]{"c°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond, new string[]{"da°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond, new string[]{"d°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.DegreeCelsiusPerMinute, new string[]{"°C/min"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.DegreeCelsiusPerSecond, new string[]{"°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond, new string[]{"h°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond, new string[]{"k°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond, new string[]{"µ°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond, new string[]{"m°C/s"}), + ("en-US", typeof(TemperatureChangeRateUnit), (int)TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond, new string[]{"n°C/s"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeCelsius, new string[]{"∆°C"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeDelisle, new string[]{"∆°De"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeFahrenheit, new string[]{"∆°F"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeNewton, new string[]{"∆°N"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeRankine, new string[]{"∆°R"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeReaumur, new string[]{"∆°Ré"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.DegreeRoemer, new string[]{"∆°Rø"}), + ("en-US", typeof(TemperatureDeltaUnit), (int)TemperatureDeltaUnit.Kelvin, new string[]{"∆K"}), + ("en-US", typeof(ThermalConductivityUnit), (int)ThermalConductivityUnit.BtuPerHourFootFahrenheit, new string[]{"BTU/h·ft·°F"}), + ("en-US", typeof(ThermalConductivityUnit), (int)ThermalConductivityUnit.WattPerMeterKelvin, new string[]{"W/m·K"}), + ("en-US", typeof(ThermalResistanceUnit), (int)ThermalResistanceUnit.HourSquareFeetDegreeFahrenheitPerBtu, new string[]{"Hrft²°F/Btu"}), + ("en-US", typeof(ThermalResistanceUnit), (int)ThermalResistanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie, new string[]{"cm²Hr°C/kcal"}), + ("en-US", typeof(ThermalResistanceUnit), (int)ThermalResistanceUnit.SquareCentimeterKelvinPerWatt, new string[]{"cm²K/W"}), + ("en-US", typeof(ThermalResistanceUnit), (int)ThermalResistanceUnit.SquareMeterDegreeCelsiusPerWatt, new string[]{"m²°C/W"}), + ("en-US", typeof(ThermalResistanceUnit), (int)ThermalResistanceUnit.SquareMeterKelvinPerKilowatt, new string[]{"m²K/kW"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilogramForceCentimeter, new string[]{"kgf·cm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilogramForceMeter, new string[]{"kgf·m"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilogramForceMillimeter, new string[]{"kgf·mm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilonewtonCentimeter, new string[]{"kN·cm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilonewtonMeter, new string[]{"kN·m"}), + ("ru-RU", typeof(TorqueUnit), (int)TorqueUnit.KilonewtonMeter, new string[]{"кН·м"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilonewtonMillimeter, new string[]{"kN·mm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilopoundForceFoot, new string[]{"kipf·ft"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.KilopoundForceInch, new string[]{"kipf·in"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.MeganewtonCentimeter, new string[]{"MN·cm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.MeganewtonMeter, new string[]{"MN·m"}), + ("ru-RU", typeof(TorqueUnit), (int)TorqueUnit.MeganewtonMeter, new string[]{"МН·м"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.MeganewtonMillimeter, new string[]{"MN·mm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.MegapoundForceFoot, new string[]{"Mlbf·ft"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.MegapoundForceInch, new string[]{"Mlbf·in"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.NewtonCentimeter, new string[]{"N·cm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.NewtonMeter, new string[]{"N·m"}), + ("ru-RU", typeof(TorqueUnit), (int)TorqueUnit.NewtonMeter, new string[]{"Н·м"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.NewtonMillimeter, new string[]{"N·mm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.PoundForceFoot, new string[]{"lbf·ft"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.PoundForceInch, new string[]{"lbf·in"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.TonneForceCentimeter, new string[]{"tf·cm"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.TonneForceMeter, new string[]{"tf·m"}), + ("en-US", typeof(TorqueUnit), (int)TorqueUnit.TonneForceMillimeter, new string[]{"tf·mm"}), + ("en-US", typeof(VitaminAUnit), (int)VitaminAUnit.InternationalUnit, new string[]{"IU"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.AcreFoot, new string[]{"ac-ft", "acre-foot", "acre-feet"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.AuTablespoon, new string[]{""}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.AuTablespoon, new string[]{""}), + ("nb-NO", typeof(VolumeUnit), (int)VolumeUnit.AuTablespoon, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Centiliter, new string[]{"cl"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Centiliter, new string[]{"сл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicCentimeter, new string[]{"cm³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicCentimeter, new string[]{"см³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicDecimeter, new string[]{"dm³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicDecimeter, new string[]{"дм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicFoot, new string[]{"ft³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicFoot, new string[]{"фут³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicInch, new string[]{"in³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicInch, new string[]{"дюйм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicKilometer, new string[]{"km³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicKilometer, new string[]{"км³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicMeter, new string[]{"m³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicMeter, new string[]{"м³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicMicrometer, new string[]{"µm³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicMicrometer, new string[]{"мкм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicMile, new string[]{"mi³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicMile, new string[]{"миля³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicMillimeter, new string[]{"mm³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicMillimeter, new string[]{"мм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.CubicYard, new string[]{"yd³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.CubicYard, new string[]{"ярд³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Deciliter, new string[]{"dl"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Deciliter, new string[]{"дл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.HectocubicFoot, new string[]{"hft³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.HectocubicFoot, new string[]{"hфут³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.HectocubicMeter, new string[]{"hm³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.HectocubicMeter, new string[]{"hм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Hectoliter, new string[]{"hl"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Hectoliter, new string[]{"гл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.ImperialBeerBarrel, new string[]{"bl (imp.)"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.ImperialGallon, new string[]{"gal (imp.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.ImperialGallon, new string[]{"Английский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.ImperialOunce, new string[]{"oz (imp.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.ImperialOunce, new string[]{"Английская унция"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.KilocubicFoot, new string[]{"kft³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KilocubicFoot, new string[]{"kфут³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.KilocubicMeter, new string[]{"km³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KilocubicMeter, new string[]{"kм³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.KiloimperialGallon, new string[]{"kgal (imp.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KiloimperialGallon, new string[]{"kАнглийский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Kiloliter, new string[]{"kl"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Kiloliter, new string[]{"кл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.KilousGallon, new string[]{"kgal (U.S.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.KilousGallon, new string[]{"kАмериканский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Liter, new string[]{"l"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Liter, new string[]{"л"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.MegacubicFoot, new string[]{"Mft³"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.MegacubicFoot, new string[]{"Mфут³"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.MegaimperialGallon, new string[]{"Mgal (imp.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.MegaimperialGallon, new string[]{"MАнглийский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Megaliter, new string[]{"Ml"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Megaliter, new string[]{"Mкл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.MegausGallon, new string[]{"Mgal (U.S.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.MegausGallon, new string[]{"MАмериканский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.MetricCup, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.MetricTeaspoon, new string[]{"tsp", "t", "ts", "tspn", "t.", "ts.", "tsp.", "tspn.", "teaspoon"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.MetricTeaspoon, new string[]{""}), + ("nb-NO", typeof(VolumeUnit), (int)VolumeUnit.MetricTeaspoon, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Microliter, new string[]{"µl"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Microliter, new string[]{"мкл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.Milliliter, new string[]{"ml"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.Milliliter, new string[]{"мл"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.OilBarrel, new string[]{"bbl"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UkTablespoon, new string[]{""}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.UkTablespoon, new string[]{""}), + ("nb-NO", typeof(VolumeUnit), (int)VolumeUnit.UkTablespoon, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsBeerBarrel, new string[]{"bl (U.S.)"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsCustomaryCup, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsGallon, new string[]{"gal (U.S.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.UsGallon, new string[]{"Американский галлон"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsLegalCup, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsOunce, new string[]{"oz (U.S.)"}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.UsOunce, new string[]{"Американская унция"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsPint, new string[]{"pt (U.S.)"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsQuart, new string[]{"qt (U.S.)"}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsTablespoon, new string[]{""}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.UsTablespoon, new string[]{""}), + ("nb-NO", typeof(VolumeUnit), (int)VolumeUnit.UsTablespoon, new string[]{""}), + ("en-US", typeof(VolumeUnit), (int)VolumeUnit.UsTeaspoon, new string[]{""}), + ("ru-RU", typeof(VolumeUnit), (int)VolumeUnit.UsTeaspoon, new string[]{""}), + ("nb-NO", typeof(VolumeUnit), (int)VolumeUnit.UsTeaspoon, new string[]{""}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.AcreFootPerDay, new string[]{"af/d"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.AcreFootPerHour, new string[]{"af/h"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.AcreFootPerMinute, new string[]{"af/m"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.AcreFootPerSecond, new string[]{"af/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CentiliterPerDay, new string[]{"cl/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CentiliterPerMinute, new string[]{"cLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicDecimeterPerMinute, new string[]{"dm³/min"}), + ("ru-RU", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicDecimeterPerMinute, new string[]{"дм³/мин"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicFootPerHour, new string[]{"ft³/h", "cf/hr"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicFootPerMinute, new string[]{"ft³/min"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicFootPerSecond, new string[]{"ft³/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerDay, new string[]{"m³/d"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerHour, new string[]{"m³/h"}), + ("ru-RU", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerHour, new string[]{"м³/ч"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerMinute, new string[]{"m³/min"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerSecond, new string[]{"m³/s"}), + ("ru-RU", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMeterPerSecond, new string[]{"м³/с"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMillimeterPerSecond, new string[]{"mm³/s"}), + ("ru-RU", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicMillimeterPerSecond, new string[]{"мм³/с"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicYardPerDay, new string[]{"cy/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicYardPerHour, new string[]{"yd³/h"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicYardPerMinute, new string[]{"yd³/min"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.CubicYardPerSecond, new string[]{"yd³/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.DeciliterPerDay, new string[]{"dl/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.DeciliterPerMinute, new string[]{"dLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.KiloliterPerDay, new string[]{"kl/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.KiloliterPerMinute, new string[]{"kLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.KilousGallonPerMinute, new string[]{"kgal (U.S.)/min", "KGPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.LiterPerDay, new string[]{"l/day", "L/d", "LPD"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.LiterPerHour, new string[]{"LPH"}), + ("ru-RU", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.LiterPerHour, new string[]{"л/ч"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.LiterPerMinute, new string[]{"LPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.LiterPerSecond, new string[]{"LPS"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MegaliterPerDay, new string[]{"Ml/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MegaukGallonPerSecond, new string[]{"Mgal (imp.)/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MicroliterPerDay, new string[]{"µl/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MicroliterPerMinute, new string[]{"µLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MilliliterPerDay, new string[]{"ml/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MilliliterPerMinute, new string[]{"mLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.MillionUsGallonsPerDay, new string[]{"MGD"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.NanoliterPerDay, new string[]{"nl/day"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.NanoliterPerMinute, new string[]{"nLPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.OilBarrelPerDay, new string[]{"bbl/d", "BOPD"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.OilBarrelPerHour, new string[]{"bbl/hr", "bph"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.OilBarrelPerMinute, new string[]{"bbl/min", "bpm"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.OilBarrelPerSecond, new string[]{"bbl/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UkGallonPerDay, new string[]{"gal (U. K.)/d"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UkGallonPerMinute, new string[]{"gal (imp.)/min"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UkGallonPerSecond, new string[]{"gal (imp.)/s"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UsGallonPerDay, new string[]{"gpd", "gal/d"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UsGallonPerHour, new string[]{"gal (U.S.)/h"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UsGallonPerMinute, new string[]{"gal (U.S.)/min", "GPM"}), + ("en-US", typeof(VolumeFlowUnit), (int)VolumeFlowUnit.UsGallonPerSecond, new string[]{"gal (U.S.)/s"}), + }; + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AccelerationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AccelerationUnit.g.cs new file mode 100644 index 0000000000..2b9021f204 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AccelerationUnit.g.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AccelerationUnit + { + Undefined = 0, + CentimeterPerSecondSquared, + DecimeterPerSecondSquared, + FootPerSecondSquared, + InchPerSecondSquared, + KilometerPerSecondSquared, + KnotPerHour, + KnotPerMinute, + KnotPerSecond, + MeterPerSecondSquared, + MicrometerPerSecondSquared, + MillimeterPerSecondSquared, + NanometerPerSecondSquared, + StandardGravity, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmountOfSubstanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmountOfSubstanceUnit.g.cs new file mode 100644 index 0000000000..8100f63818 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmountOfSubstanceUnit.g.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AmountOfSubstanceUnit + { + Undefined = 0, + Centimole, + CentipoundMole, + Decimole, + DecipoundMole, + Kilomole, + KilopoundMole, + Megamole, + Micromole, + MicropoundMole, + Millimole, + MillipoundMole, + Mole, + Nanomole, + NanopoundMole, + PoundMole, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmplitudeRatioUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmplitudeRatioUnit.g.cs new file mode 100644 index 0000000000..34fbf79551 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AmplitudeRatioUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AmplitudeRatioUnit + { + Undefined = 0, + DecibelMicrovolt, + DecibelMillivolt, + DecibelUnloaded, + DecibelVolt, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AngleUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AngleUnit.g.cs new file mode 100644 index 0000000000..e0685956e2 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AngleUnit.g.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AngleUnit + { + Undefined = 0, + Arcminute, + Arcsecond, + Centiradian, + Deciradian, + Degree, + Gradian, + Microdegree, + Microradian, + Millidegree, + Milliradian, + Nanodegree, + Nanoradian, + Radian, + Revolution, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentEnergyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentEnergyUnit.g.cs new file mode 100644 index 0000000000..d7302fffe5 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentEnergyUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ApparentEnergyUnit + { + Undefined = 0, + KilovoltampereHour, + MegavoltampereHour, + VoltampereHour, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentPowerUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentPowerUnit.g.cs new file mode 100644 index 0000000000..802534b7ad --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ApparentPowerUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ApparentPowerUnit + { + Undefined = 0, + Gigavoltampere, + Kilovoltampere, + Megavoltampere, + Voltampere, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaDensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaDensityUnit.g.cs new file mode 100644 index 0000000000..aef1c8b643 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaDensityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AreaDensityUnit + { + Undefined = 0, + KilogramPerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaMomentOfInertiaUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaMomentOfInertiaUnit.g.cs new file mode 100644 index 0000000000..46e1832024 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaMomentOfInertiaUnit.g.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AreaMomentOfInertiaUnit + { + Undefined = 0, + CentimeterToTheFourth, + DecimeterToTheFourth, + FootToTheFourth, + InchToTheFourth, + MeterToTheFourth, + MillimeterToTheFourth, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaUnit.g.cs new file mode 100644 index 0000000000..2530b08548 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/AreaUnit.g.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum AreaUnit + { + Undefined = 0, + Acre, + Hectare, + SquareCentimeter, + SquareDecimeter, + SquareFoot, + SquareInch, + SquareKilometer, + SquareMeter, + SquareMicrometer, + SquareMile, + SquareMillimeter, + SquareYard, + UsSurveySquareFoot, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BitRateUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BitRateUnit.g.cs new file mode 100644 index 0000000000..df94d0cdf8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BitRateUnit.g.cs @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum BitRateUnit + { + Undefined = 0, + BitPerSecond, + BytePerSecond, + ExabitPerSecond, + ExabytePerSecond, + ExbibitPerSecond, + ExbibytePerSecond, + GibibitPerSecond, + GibibytePerSecond, + GigabitPerSecond, + GigabytePerSecond, + KibibitPerSecond, + KibibytePerSecond, + KilobitPerSecond, + KilobytePerSecond, + MebibitPerSecond, + MebibytePerSecond, + MegabitPerSecond, + MegabytePerSecond, + PebibitPerSecond, + PebibytePerSecond, + PetabitPerSecond, + PetabytePerSecond, + TebibitPerSecond, + TebibytePerSecond, + TerabitPerSecond, + TerabytePerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BrakeSpecificFuelConsumptionUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BrakeSpecificFuelConsumptionUnit.g.cs new file mode 100644 index 0000000000..0ee63f52c1 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/BrakeSpecificFuelConsumptionUnit.g.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum BrakeSpecificFuelConsumptionUnit + { + Undefined = 0, + GramPerKiloWattHour, + KilogramPerJoule, + + /// + /// The pound per horse power hour uses mechanical horse power and the imperial pound + /// + PoundPerMechanicalHorsepowerHour, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CapacitanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CapacitanceUnit.g.cs new file mode 100644 index 0000000000..ace63c4ea4 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CapacitanceUnit.g.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum CapacitanceUnit + { + Undefined = 0, + Farad, + Kilofarad, + Megafarad, + Microfarad, + Millifarad, + Nanofarad, + Picofarad, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs new file mode 100644 index 0000000000..a9ab3be40f --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/CoefficientOfThermalExpansionUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum CoefficientOfThermalExpansionUnit + { + Undefined = 0, + InverseDegreeCelsius, + InverseDegreeFahrenheit, + InverseKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DensityUnit.g.cs new file mode 100644 index 0000000000..381d028d8d --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DensityUnit.g.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum DensityUnit + { + Undefined = 0, + CentigramPerDeciliter, + CentigramPerLiter, + CentigramPerMilliliter, + DecigramPerDeciliter, + DecigramPerLiter, + DecigramPerMilliliter, + GramPerCubicCentimeter, + GramPerCubicMeter, + GramPerCubicMillimeter, + GramPerDeciliter, + GramPerLiter, + GramPerMilliliter, + KilogramPerCubicCentimeter, + KilogramPerCubicMeter, + KilogramPerCubicMillimeter, + KilopoundPerCubicFoot, + KilopoundPerCubicInch, + MicrogramPerCubicMeter, + MicrogramPerDeciliter, + MicrogramPerLiter, + MicrogramPerMilliliter, + MilligramPerCubicMeter, + MilligramPerDeciliter, + MilligramPerLiter, + MilligramPerMilliliter, + NanogramPerDeciliter, + NanogramPerLiter, + NanogramPerMilliliter, + PicogramPerDeciliter, + PicogramPerLiter, + PicogramPerMilliliter, + PoundPerCubicFoot, + PoundPerCubicInch, + PoundPerImperialGallon, + PoundPerUSGallon, + SlugPerCubicFoot, + TonnePerCubicCentimeter, + TonnePerCubicMeter, + TonnePerCubicMillimeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DurationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DurationUnit.g.cs new file mode 100644 index 0000000000..57b59e4143 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DurationUnit.g.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum DurationUnit + { + Undefined = 0, + Day, + Hour, + Microsecond, + Millisecond, + Minute, + Month30, + Nanosecond, + Second, + Week, + Year365, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DynamicViscosityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DynamicViscosityUnit.g.cs new file mode 100644 index 0000000000..f4cd0a365b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/DynamicViscosityUnit.g.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum DynamicViscosityUnit + { + Undefined = 0, + Centipoise, + MicropascalSecond, + MillipascalSecond, + NewtonSecondPerMeterSquared, + PascalSecond, + Poise, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricAdmittanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricAdmittanceUnit.g.cs new file mode 100644 index 0000000000..56241699b0 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricAdmittanceUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricAdmittanceUnit + { + Undefined = 0, + Microsiemens, + Millisiemens, + Nanosiemens, + Siemens, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeDensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeDensityUnit.g.cs new file mode 100644 index 0000000000..0c895418ba --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeDensityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricChargeDensityUnit + { + Undefined = 0, + CoulombPerCubicMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeUnit.g.cs new file mode 100644 index 0000000000..b1a74e6ef5 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricChargeUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricChargeUnit + { + Undefined = 0, + Coulomb, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductanceUnit.g.cs new file mode 100644 index 0000000000..4bc13c12b0 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductanceUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricConductanceUnit + { + Undefined = 0, + Microsiemens, + Millisiemens, + Siemens, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductivityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductivityUnit.g.cs new file mode 100644 index 0000000000..d47b79e70a --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricConductivityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricConductivityUnit + { + Undefined = 0, + SiemensPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentDensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentDensityUnit.g.cs new file mode 100644 index 0000000000..806746666e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentDensityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricCurrentDensityUnit + { + Undefined = 0, + AmperePerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentGradientUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentGradientUnit.g.cs new file mode 100644 index 0000000000..dd0b12f633 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentGradientUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricCurrentGradientUnit + { + Undefined = 0, + AmperePerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentUnit.g.cs new file mode 100644 index 0000000000..dd9dce6a63 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricCurrentUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricCurrentUnit + { + Undefined = 0, + Ampere, + Centiampere, + Kiloampere, + Megaampere, + Microampere, + Milliampere, + Nanoampere, + Picoampere, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricFieldUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricFieldUnit.g.cs new file mode 100644 index 0000000000..97eb162198 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricFieldUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricFieldUnit + { + Undefined = 0, + VoltPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricInductanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricInductanceUnit.g.cs new file mode 100644 index 0000000000..fe13141424 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricInductanceUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricInductanceUnit + { + Undefined = 0, + Henry, + Microhenry, + Millihenry, + Nanohenry, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialAcUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialAcUnit.g.cs new file mode 100644 index 0000000000..ac0ac58180 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialAcUnit.g.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricPotentialAcUnit + { + Undefined = 0, + KilovoltAc, + MegavoltAc, + MicrovoltAc, + MillivoltAc, + VoltAc, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialDcUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialDcUnit.g.cs new file mode 100644 index 0000000000..c3e26c24b8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialDcUnit.g.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricPotentialDcUnit + { + Undefined = 0, + KilovoltDc, + MegavoltDc, + MicrovoltDc, + MillivoltDc, + VoltDc, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialUnit.g.cs new file mode 100644 index 0000000000..5c7800adbe --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricPotentialUnit.g.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricPotentialUnit + { + Undefined = 0, + Kilovolt, + Megavolt, + Microvolt, + Millivolt, + Volt, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistanceUnit.g.cs new file mode 100644 index 0000000000..b03bc94781 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistanceUnit.g.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricResistanceUnit + { + Undefined = 0, + Gigaohm, + Kiloohm, + Megaohm, + Milliohm, + Ohm, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistivityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistivityUnit.g.cs new file mode 100644 index 0000000000..1e51aa31e1 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ElectricResistivityUnit.g.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ElectricResistivityUnit + { + Undefined = 0, + KiloohmCentimeter, + KiloohmMeter, + MegaohmCentimeter, + MegaohmMeter, + MicroohmCentimeter, + MicroohmMeter, + MilliohmCentimeter, + MilliohmMeter, + NanoohmCentimeter, + NanoohmMeter, + OhmCentimeter, + OhmMeter, + PicoohmCentimeter, + PicoohmMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EnergyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EnergyUnit.g.cs new file mode 100644 index 0000000000..d29480b5e8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EnergyUnit.g.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum EnergyUnit + { + Undefined = 0, + BritishThermalUnit, + Calorie, + DecathermEc, + DecathermImperial, + DecathermUs, + ElectronVolt, + Erg, + FootPound, + GigabritishThermalUnit, + GigawattHour, + Joule, + KilobritishThermalUnit, + Kilocalorie, + Kilojoule, + KilowattHour, + MegabritishThermalUnit, + Megajoule, + MegawattHour, + ThermEc, + ThermImperial, + ThermUs, + WattHour, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EntropyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EntropyUnit.g.cs new file mode 100644 index 0000000000..b493323b9b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/EntropyUnit.g.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum EntropyUnit + { + Undefined = 0, + CaloriePerKelvin, + JoulePerDegreeCelsius, + JoulePerKelvin, + KilocaloriePerKelvin, + KilojoulePerDegreeCelsius, + KilojoulePerKelvin, + MegajoulePerKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceChangeRateUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceChangeRateUnit.g.cs new file mode 100644 index 0000000000..32eb98ab5f --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceChangeRateUnit.g.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ForceChangeRateUnit + { + Undefined = 0, + CentinewtonPerSecond, + DecanewtonPerMinute, + DecanewtonPerSecond, + DecinewtonPerSecond, + KilonewtonPerMinute, + KilonewtonPerSecond, + MicronewtonPerSecond, + MillinewtonPerSecond, + NanonewtonPerSecond, + NewtonPerMinute, + NewtonPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForcePerLengthUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForcePerLengthUnit.g.cs new file mode 100644 index 0000000000..5673df929e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForcePerLengthUnit.g.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ForcePerLengthUnit + { + Undefined = 0, + CentinewtonPerMeter, + DecinewtonPerMeter, + KilogramForcePerMeter, + KilonewtonPerMeter, + MeganewtonPerMeter, + MicronewtonPerMeter, + MillinewtonPerMeter, + NanonewtonPerMeter, + NewtonPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceUnit.g.cs new file mode 100644 index 0000000000..97ed2c68cf --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ForceUnit.g.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ForceUnit + { + Undefined = 0, + Decanewton, + Dyn, + KilogramForce, + Kilonewton, + KiloPond, + Meganewton, + Micronewton, + Millinewton, + Newton, + OunceForce, + Poundal, + PoundForce, + TonneForce, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/FrequencyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/FrequencyUnit.g.cs new file mode 100644 index 0000000000..98d4d43584 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/FrequencyUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum FrequencyUnit + { + Undefined = 0, + CyclePerHour, + CyclePerMinute, + Gigahertz, + Hertz, + Kilohertz, + Megahertz, + RadianPerSecond, + Terahertz, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatFluxUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatFluxUnit.g.cs new file mode 100644 index 0000000000..6505998ada --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatFluxUnit.g.cs @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum HeatFluxUnit + { + Undefined = 0, + BtuPerHourSquareFoot, + BtuPerMinuteSquareFoot, + BtuPerSecondSquareFoot, + BtuPerSecondSquareInch, + CaloriePerSecondSquareCentimeter, + CentiwattPerSquareMeter, + DeciwattPerSquareMeter, + KilocaloriePerHourSquareMeter, + KilocaloriePerSecondSquareCentimeter, + KilowattPerSquareMeter, + MicrowattPerSquareMeter, + MilliwattPerSquareMeter, + NanowattPerSquareMeter, + PoundForcePerFootSecond, + PoundPerSecondCubed, + WattPerSquareFoot, + WattPerSquareInch, + WattPerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs new file mode 100644 index 0000000000..7421fde985 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/HeatTransferCoefficientUnit.g.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum HeatTransferCoefficientUnit + { + Undefined = 0, + WattPerSquareMeterCelsius, + WattPerSquareMeterKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IlluminanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IlluminanceUnit.g.cs new file mode 100644 index 0000000000..715d90b7a2 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IlluminanceUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum IlluminanceUnit + { + Undefined = 0, + Kilolux, + Lux, + Megalux, + Millilux, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/InformationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/InformationUnit.g.cs new file mode 100644 index 0000000000..d9b59e1841 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/InformationUnit.g.cs @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum InformationUnit + { + Undefined = 0, + Bit, + Byte, + Exabit, + Exabyte, + Exbibit, + Exbibyte, + Gibibit, + Gibibyte, + Gigabit, + Gigabyte, + Kibibit, + Kibibyte, + Kilobit, + Kilobyte, + Mebibit, + Mebibyte, + Megabit, + Megabyte, + Pebibit, + Pebibyte, + Petabit, + Petabyte, + Tebibit, + Tebibyte, + Terabit, + Terabyte, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradianceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradianceUnit.g.cs new file mode 100644 index 0000000000..c2d2c3557d --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradianceUnit.g.cs @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum IrradianceUnit + { + Undefined = 0, + KilowattPerSquareCentimeter, + KilowattPerSquareMeter, + MegawattPerSquareCentimeter, + MegawattPerSquareMeter, + MicrowattPerSquareCentimeter, + MicrowattPerSquareMeter, + MilliwattPerSquareCentimeter, + MilliwattPerSquareMeter, + NanowattPerSquareCentimeter, + NanowattPerSquareMeter, + PicowattPerSquareCentimeter, + PicowattPerSquareMeter, + WattPerSquareCentimeter, + WattPerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradiationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradiationUnit.g.cs new file mode 100644 index 0000000000..8db3408b40 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/IrradiationUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum IrradiationUnit + { + Undefined = 0, + JoulePerSquareMeter, + JoulePerSquareMillimeter, + KilowattHourPerSquareMeter, + WattHourPerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/KinematicViscosityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/KinematicViscosityUnit.g.cs new file mode 100644 index 0000000000..cb8d525fc6 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/KinematicViscosityUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum KinematicViscosityUnit + { + Undefined = 0, + Centistokes, + Decistokes, + Kilostokes, + Microstokes, + Millistokes, + Nanostokes, + SquareMeterPerSecond, + Stokes, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LapseRateUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LapseRateUnit.g.cs new file mode 100644 index 0000000000..f13c5b65c3 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LapseRateUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LapseRateUnit + { + Undefined = 0, + DegreeCelsiusPerKilometer, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LengthUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LengthUnit.g.cs new file mode 100644 index 0000000000..8da7420323 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LengthUnit.g.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LengthUnit + { + Undefined = 0, + Centimeter, + Decimeter, + DtpPica, + DtpPoint, + Fathom, + Foot, + Inch, + Kilometer, + Meter, + Microinch, + Micrometer, + Mil, + Mile, + Millimeter, + Nanometer, + NauticalMile, + PrinterPica, + PrinterPoint, + Shackle, + Twip, + UsSurveyFoot, + Yard, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LevelUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LevelUnit.g.cs new file mode 100644 index 0000000000..0f3441fe14 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LevelUnit.g.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LevelUnit + { + Undefined = 0, + Decibel, + Neper, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LinearDensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LinearDensityUnit.g.cs new file mode 100644 index 0000000000..84ca79123a --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LinearDensityUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LinearDensityUnit + { + Undefined = 0, + GramPerMeter, + KilogramPerMeter, + PoundPerFoot, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousFluxUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousFluxUnit.g.cs new file mode 100644 index 0000000000..0bfa2c6815 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousFluxUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LuminousFluxUnit + { + Undefined = 0, + Lumen, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousIntensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousIntensityUnit.g.cs new file mode 100644 index 0000000000..d5d34cac09 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/LuminousIntensityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum LuminousIntensityUnit + { + Undefined = 0, + Candela, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFieldUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFieldUnit.g.cs new file mode 100644 index 0000000000..51a0d07644 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFieldUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MagneticFieldUnit + { + Undefined = 0, + Microtesla, + Millitesla, + Nanotesla, + Tesla, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFluxUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFluxUnit.g.cs new file mode 100644 index 0000000000..76eb6ee7d4 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagneticFluxUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MagneticFluxUnit + { + Undefined = 0, + Weber, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagnetizationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagnetizationUnit.g.cs new file mode 100644 index 0000000000..46baaadc67 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MagnetizationUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MagnetizationUnit + { + Undefined = 0, + AmperePerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFlowUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFlowUnit.g.cs new file mode 100644 index 0000000000..1308fd1426 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFlowUnit.g.cs @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MassFlowUnit + { + Undefined = 0, + CentigramPerDay, + CentigramPerSecond, + DecagramPerDay, + DecagramPerSecond, + DecigramPerDay, + DecigramPerSecond, + GramPerDay, + GramPerHour, + GramPerSecond, + HectogramPerDay, + HectogramPerSecond, + KilogramPerDay, + KilogramPerHour, + KilogramPerMinute, + KilogramPerSecond, + MegagramPerDay, + MegapoundPerDay, + MegapoundPerHour, + MegapoundPerMinute, + MicrogramPerDay, + MicrogramPerSecond, + MilligramPerDay, + MilligramPerSecond, + NanogramPerDay, + NanogramPerSecond, + PoundPerDay, + PoundPerHour, + PoundPerMinute, + ShortTonPerHour, + TonnePerDay, + TonnePerHour, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFluxUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFluxUnit.g.cs new file mode 100644 index 0000000000..e801ad4c63 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassFluxUnit.g.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MassFluxUnit + { + Undefined = 0, + GramPerSecondPerSquareMeter, + KilogramPerSecondPerSquareMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassMomentOfInertiaUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassMomentOfInertiaUnit.g.cs new file mode 100644 index 0000000000..48269e967a --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassMomentOfInertiaUnit.g.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MassMomentOfInertiaUnit + { + Undefined = 0, + GramSquareCentimeter, + GramSquareDecimeter, + GramSquareMeter, + GramSquareMillimeter, + KilogramSquareCentimeter, + KilogramSquareDecimeter, + KilogramSquareMeter, + KilogramSquareMillimeter, + KilotonneSquareCentimeter, + KilotonneSquareDecimeter, + KilotonneSquareMeter, + KilotonneSquareMilimeter, + MegatonneSquareCentimeter, + MegatonneSquareDecimeter, + MegatonneSquareMeter, + MegatonneSquareMilimeter, + MilligramSquareCentimeter, + MilligramSquareDecimeter, + MilligramSquareMeter, + MilligramSquareMillimeter, + PoundSquareFoot, + PoundSquareInch, + SlugSquareFoot, + SlugSquareInch, + TonneSquareCentimeter, + TonneSquareDecimeter, + TonneSquareMeter, + TonneSquareMilimeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassUnit.g.cs new file mode 100644 index 0000000000..2aac301b31 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MassUnit.g.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MassUnit + { + Undefined = 0, + Centigram, + Decagram, + Decigram, + + /// + /// A grain is a unit of measurement of mass, and in the troy weight, avoirdupois, and Apothecaries' system, equal to exactly 64.79891 milligrams. + /// + /// https://en.wikipedia.org/wiki/Grain_(unit) + Grain, + Gram, + Hectogram, + Kilogram, + Kilopound, + Kilotonne, + + /// + /// The long or imperial hundredweight (abbreviation cwt) is a unit of mass equal to 112 pounds in US and Canada. + /// + /// https://en.wikipedia.org/wiki/Hundredweight + LongHundredweight, + + /// + /// Long ton (weight ton or Imperial ton) is a unit of mass equal to 2,240 pounds (1,016 kg) and is the name for the unit called the "ton" in the avoirdupois or Imperial system of measurements that was used in the United Kingdom and several other Commonwealth countries before metrication. + /// + /// http://en.wikipedia.org/wiki/Long_ton + LongTon, + Megapound, + Megatonne, + Microgram, + Milligram, + Nanogram, + + /// + /// An ounce (abbreviated oz) is usually the international avoirdupois ounce as used in the United States customary and British imperial systems, which is equal to one-sixteenth of a pound or approximately 28 grams. The abbreviation 'oz' derives from the Italian word onza (now spelled oncia). + /// + /// http://en.wikipedia.org/wiki/Ounce + Ounce, + + /// + /// The pound or pound-mass (abbreviations: lb, lbm) is a unit of mass used in the imperial, United States customary and other systems of measurement. A number of different definitions have been used, the most common today being the international avoirdupois pound which is legally defined as exactly 0.45359237 kilograms, and which is divided into 16 avoirdupois ounces. + /// + Pound, + + /// + /// The short hundredweight (abbreviation cwt) is a unit of mass equal to 100 pounds in US and Canada. In British English, the short hundredweight is referred to as the "cental". + /// + /// https://en.wikipedia.org/wiki/Hundredweight + ShortHundredweight, + + /// + /// The short ton is a unit of mass equal to 2,000 pounds (907.18474 kg), that is most commonly used in the United States – known there simply as the ton. + /// + /// http://en.wikipedia.org/wiki/Short_ton + ShortTon, + + /// + /// The slug (abbreviation slug) is a unit of mass that is accelerated by 1 ft/s² when a force of one pound (lbf) is exerted on it. + /// + /// http://en.wikipedia.org/wiki/Slug_(unit) + Slug, + + /// + /// The stone (abbreviation st) is a unit of mass equal to 14 pounds avoirdupois (about 6.35 kilograms) used in Great Britain and Ireland for measuring human body weight. + /// + /// http://en.wikipedia.org/wiki/Stone_(unit) + Stone, + Tonne, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEnergyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEnergyUnit.g.cs new file mode 100644 index 0000000000..fcb75d0bb9 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEnergyUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MolarEnergyUnit + { + Undefined = 0, + JoulePerMole, + KilojoulePerMole, + MegajoulePerMole, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEntropyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEntropyUnit.g.cs new file mode 100644 index 0000000000..1ba0f0ae63 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarEntropyUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MolarEntropyUnit + { + Undefined = 0, + JoulePerMoleKelvin, + KilojoulePerMoleKelvin, + MegajoulePerMoleKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarMassUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarMassUnit.g.cs new file mode 100644 index 0000000000..80dd9d1374 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarMassUnit.g.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MolarMassUnit + { + Undefined = 0, + CentigramPerMole, + DecagramPerMole, + DecigramPerMole, + GramPerMole, + HectogramPerMole, + KilogramPerMole, + KilopoundPerMole, + MegapoundPerMole, + MicrogramPerMole, + MilligramPerMole, + NanogramPerMole, + PoundPerMole, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarityUnit.g.cs new file mode 100644 index 0000000000..4766690daa --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/MolarityUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum MolarityUnit + { + Undefined = 0, + CentimolesPerLiter, + DecimolesPerLiter, + MicromolesPerLiter, + MillimolesPerLiter, + MolesPerCubicMeter, + MolesPerLiter, + NanomolesPerLiter, + PicomolesPerLiter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermeabilityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermeabilityUnit.g.cs new file mode 100644 index 0000000000..5d8e8033fd --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermeabilityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PermeabilityUnit + { + Undefined = 0, + HenryPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermittivityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermittivityUnit.g.cs new file mode 100644 index 0000000000..9693bc2f0c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PermittivityUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PermittivityUnit + { + Undefined = 0, + FaradPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerDensityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerDensityUnit.g.cs new file mode 100644 index 0000000000..fed2a74c81 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerDensityUnit.g.cs @@ -0,0 +1,94 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PowerDensityUnit + { + Undefined = 0, + DecawattPerCubicFoot, + DecawattPerCubicInch, + DecawattPerCubicMeter, + DecawattPerLiter, + DeciwattPerCubicFoot, + DeciwattPerCubicInch, + DeciwattPerCubicMeter, + DeciwattPerLiter, + GigawattPerCubicFoot, + GigawattPerCubicInch, + GigawattPerCubicMeter, + GigawattPerLiter, + KilowattPerCubicFoot, + KilowattPerCubicInch, + KilowattPerCubicMeter, + KilowattPerLiter, + MegawattPerCubicFoot, + MegawattPerCubicInch, + MegawattPerCubicMeter, + MegawattPerLiter, + MicrowattPerCubicFoot, + MicrowattPerCubicInch, + MicrowattPerCubicMeter, + MicrowattPerLiter, + MilliwattPerCubicFoot, + MilliwattPerCubicInch, + MilliwattPerCubicMeter, + MilliwattPerLiter, + NanowattPerCubicFoot, + NanowattPerCubicInch, + NanowattPerCubicMeter, + NanowattPerLiter, + PicowattPerCubicFoot, + PicowattPerCubicInch, + PicowattPerCubicMeter, + PicowattPerLiter, + TerawattPerCubicFoot, + TerawattPerCubicInch, + TerawattPerCubicMeter, + TerawattPerLiter, + WattPerCubicFoot, + WattPerCubicInch, + WattPerCubicMeter, + WattPerLiter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerRatioUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerRatioUnit.g.cs new file mode 100644 index 0000000000..2a2702b85e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerRatioUnit.g.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PowerRatioUnit + { + Undefined = 0, + DecibelMilliwatt, + DecibelWatt, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerUnit.g.cs new file mode 100644 index 0000000000..7ab0c3d46f --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PowerUnit.g.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PowerUnit + { + Undefined = 0, + BoilerHorsepower, + BritishThermalUnitPerHour, + Decawatt, + Deciwatt, + ElectricalHorsepower, + Femtowatt, + Gigawatt, + HydraulicHorsepower, + KilobritishThermalUnitPerHour, + Kilowatt, + MechanicalHorsepower, + Megawatt, + MetricHorsepower, + Microwatt, + Milliwatt, + Nanowatt, + Petawatt, + Picowatt, + Terawatt, + Watt, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureChangeRateUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureChangeRateUnit.g.cs new file mode 100644 index 0000000000..bf54f7de41 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureChangeRateUnit.g.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PressureChangeRateUnit + { + Undefined = 0, + AtmospherePerSecond, + KilopascalPerMinute, + KilopascalPerSecond, + MegapascalPerMinute, + MegapascalPerSecond, + PascalPerMinute, + PascalPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureUnit.g.cs new file mode 100644 index 0000000000..53d352deec --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/PressureUnit.g.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum PressureUnit + { + Undefined = 0, + Atmosphere, + Bar, + Centibar, + Decapascal, + Decibar, + DynePerSquareCentimeter, + FootOfHead, + Gigapascal, + Hectopascal, + InchOfMercury, + InchOfWaterColumn, + Kilobar, + KilogramForcePerSquareCentimeter, + KilogramForcePerSquareMeter, + KilogramForcePerSquareMillimeter, + KilonewtonPerSquareCentimeter, + KilonewtonPerSquareMeter, + KilonewtonPerSquareMillimeter, + Kilopascal, + KilopoundForcePerSquareFoot, + KilopoundForcePerSquareInch, + Megabar, + MeganewtonPerSquareMeter, + Megapascal, + MeterOfHead, + Microbar, + Micropascal, + Millibar, + MillimeterOfMercury, + Millipascal, + NewtonPerSquareCentimeter, + NewtonPerSquareMeter, + NewtonPerSquareMillimeter, + Pascal, + PoundForcePerSquareFoot, + PoundForcePerSquareInch, + PoundPerInchSecondSquared, + TechnicalAtmosphere, + TonneForcePerSquareCentimeter, + TonneForcePerSquareMeter, + TonneForcePerSquareMillimeter, + Torr, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RatioUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RatioUnit.g.cs new file mode 100644 index 0000000000..cdeb18176e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RatioUnit.g.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum RatioUnit + { + Undefined = 0, + DecimalFraction, + PartPerBillion, + PartPerMillion, + PartPerThousand, + PartPerTrillion, + Percent, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactiveEnergyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactiveEnergyUnit.g.cs new file mode 100644 index 0000000000..f48ea86ece --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactiveEnergyUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ReactiveEnergyUnit + { + Undefined = 0, + KilovoltampereReactiveHour, + MegavoltampereReactiveHour, + VoltampereReactiveHour, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactivePowerUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactivePowerUnit.g.cs new file mode 100644 index 0000000000..78f0610799 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ReactivePowerUnit.g.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ReactivePowerUnit + { + Undefined = 0, + GigavoltampereReactive, + KilovoltampereReactive, + MegavoltampereReactive, + VoltampereReactive, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalAccelerationUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalAccelerationUnit.g.cs new file mode 100644 index 0000000000..dfd69c5d9b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalAccelerationUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum RotationalAccelerationUnit + { + Undefined = 0, + DegreePerSecondSquared, + RadianPerSecondSquared, + RevolutionPerMinutePerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalSpeedUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalSpeedUnit.g.cs new file mode 100644 index 0000000000..b5215b9ba1 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalSpeedUnit.g.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum RotationalSpeedUnit + { + Undefined = 0, + CentiradianPerSecond, + DeciradianPerSecond, + DegreePerMinute, + DegreePerSecond, + MicrodegreePerSecond, + MicroradianPerSecond, + MillidegreePerSecond, + MilliradianPerSecond, + NanodegreePerSecond, + NanoradianPerSecond, + RadianPerSecond, + RevolutionPerMinute, + RevolutionPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessPerLengthUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessPerLengthUnit.g.cs new file mode 100644 index 0000000000..9e15fe4a17 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessPerLengthUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum RotationalStiffnessPerLengthUnit + { + Undefined = 0, + KilonewtonMeterPerRadianPerMeter, + MeganewtonMeterPerRadianPerMeter, + NewtonMeterPerRadianPerMeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessUnit.g.cs new file mode 100644 index 0000000000..4308f84274 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/RotationalStiffnessUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum RotationalStiffnessUnit + { + Undefined = 0, + KilonewtonMeterPerRadian, + MeganewtonMeterPerRadian, + NewtonMeterPerRadian, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SolidAngleUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SolidAngleUnit.g.cs new file mode 100644 index 0000000000..79aa7ae5ad --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SolidAngleUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SolidAngleUnit + { + Undefined = 0, + Steradian, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEnergyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEnergyUnit.g.cs new file mode 100644 index 0000000000..92492d143c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEnergyUnit.g.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SpecificEnergyUnit + { + Undefined = 0, + BtuPerPound, + CaloriePerGram, + JoulePerKilogram, + KilocaloriePerGram, + KilojoulePerKilogram, + KilowattHourPerKilogram, + MegajoulePerKilogram, + MegawattHourPerKilogram, + WattHourPerKilogram, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEntropyUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEntropyUnit.g.cs new file mode 100644 index 0000000000..c58a0a00d7 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificEntropyUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SpecificEntropyUnit + { + Undefined = 0, + CaloriePerGramKelvin, + JoulePerKilogramDegreeCelsius, + JoulePerKilogramKelvin, + KilocaloriePerGramKelvin, + KilojoulePerKilogramDegreeCelsius, + KilojoulePerKilogramKelvin, + MegajoulePerKilogramDegreeCelsius, + MegajoulePerKilogramKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificVolumeUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificVolumeUnit.g.cs new file mode 100644 index 0000000000..4001c95e26 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificVolumeUnit.g.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SpecificVolumeUnit + { + Undefined = 0, + CubicFootPerPound, + CubicMeterPerKilogram, + MillicubicMeterPerKilogram, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificWeightUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificWeightUnit.g.cs new file mode 100644 index 0000000000..4de112c05e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpecificWeightUnit.g.cs @@ -0,0 +1,67 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SpecificWeightUnit + { + Undefined = 0, + KilogramForcePerCubicCentimeter, + KilogramForcePerCubicMeter, + KilogramForcePerCubicMillimeter, + KilonewtonPerCubicCentimeter, + KilonewtonPerCubicMeter, + KilonewtonPerCubicMillimeter, + KilopoundForcePerCubicFoot, + KilopoundForcePerCubicInch, + MeganewtonPerCubicMeter, + NewtonPerCubicCentimeter, + NewtonPerCubicMeter, + NewtonPerCubicMillimeter, + PoundForcePerCubicFoot, + PoundForcePerCubicInch, + TonneForcePerCubicCentimeter, + TonneForcePerCubicMeter, + TonneForcePerCubicMillimeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpeedUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpeedUnit.g.cs new file mode 100644 index 0000000000..78d4029157 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/SpeedUnit.g.cs @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum SpeedUnit + { + Undefined = 0, + CentimeterPerHour, + CentimeterPerMinute, + CentimeterPerSecond, + DecimeterPerMinute, + DecimeterPerSecond, + FootPerHour, + FootPerMinute, + FootPerSecond, + InchPerHour, + InchPerMinute, + InchPerSecond, + KilometerPerHour, + KilometerPerMinute, + KilometerPerSecond, + Knot, + MeterPerHour, + MeterPerMinute, + MeterPerSecond, + MicrometerPerMinute, + MicrometerPerSecond, + MilePerHour, + MillimeterPerHour, + MillimeterPerMinute, + MillimeterPerSecond, + NanometerPerMinute, + NanometerPerSecond, + UsSurveyFootPerHour, + UsSurveyFootPerMinute, + UsSurveyFootPerSecond, + YardPerHour, + YardPerMinute, + YardPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureChangeRateUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureChangeRateUnit.g.cs new file mode 100644 index 0000000000..ea6d2d10e2 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureChangeRateUnit.g.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum TemperatureChangeRateUnit + { + Undefined = 0, + CentidegreeCelsiusPerSecond, + DecadegreeCelsiusPerSecond, + DecidegreeCelsiusPerSecond, + DegreeCelsiusPerMinute, + DegreeCelsiusPerSecond, + HectodegreeCelsiusPerSecond, + KilodegreeCelsiusPerSecond, + MicrodegreeCelsiusPerSecond, + MillidegreeCelsiusPerSecond, + NanodegreeCelsiusPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureDeltaUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureDeltaUnit.g.cs new file mode 100644 index 0000000000..031ee4369c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureDeltaUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum TemperatureDeltaUnit + { + Undefined = 0, + DegreeCelsius, + DegreeDelisle, + DegreeFahrenheit, + DegreeNewton, + DegreeRankine, + DegreeReaumur, + DegreeRoemer, + Kelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureUnit.g.cs new file mode 100644 index 0000000000..6aed814f0b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TemperatureUnit.g.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum TemperatureUnit + { + Undefined = 0, + DegreeCelsius, + DegreeDelisle, + DegreeFahrenheit, + DegreeNewton, + DegreeRankine, + DegreeReaumur, + DegreeRoemer, + Kelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalConductivityUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalConductivityUnit.g.cs new file mode 100644 index 0000000000..9b440faa73 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalConductivityUnit.g.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ThermalConductivityUnit + { + Undefined = 0, + BtuPerHourFootFahrenheit, + WattPerMeterKelvin, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalResistanceUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalResistanceUnit.g.cs new file mode 100644 index 0000000000..d4f267cee8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/ThermalResistanceUnit.g.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum ThermalResistanceUnit + { + Undefined = 0, + HourSquareFeetDegreeFahrenheitPerBtu, + SquareCentimeterHourDegreeCelsiusPerKilocalorie, + SquareCentimeterKelvinPerWatt, + SquareMeterDegreeCelsiusPerWatt, + SquareMeterKelvinPerKilowatt, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TorqueUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TorqueUnit.g.cs new file mode 100644 index 0000000000..e8a126324e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/TorqueUnit.g.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum TorqueUnit + { + Undefined = 0, + KilogramForceCentimeter, + KilogramForceMeter, + KilogramForceMillimeter, + KilonewtonCentimeter, + KilonewtonMeter, + KilonewtonMillimeter, + KilopoundForceFoot, + KilopoundForceInch, + MeganewtonCentimeter, + MeganewtonMeter, + MeganewtonMillimeter, + MegapoundForceFoot, + MegapoundForceInch, + NewtonCentimeter, + NewtonMeter, + NewtonMillimeter, + PoundForceFoot, + PoundForceInch, + TonneForceCentimeter, + TonneForceMeter, + TonneForceMillimeter, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VitaminAUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VitaminAUnit.g.cs new file mode 100644 index 0000000000..3563925062 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VitaminAUnit.g.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum VitaminAUnit + { + Undefined = 0, + InternationalUnit, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeFlowUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeFlowUnit.g.cs new file mode 100644 index 0000000000..381a31cfb8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeFlowUnit.g.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum VolumeFlowUnit + { + Undefined = 0, + AcreFootPerDay, + AcreFootPerHour, + AcreFootPerMinute, + AcreFootPerSecond, + CentiliterPerDay, + CentiliterPerMinute, + CubicDecimeterPerMinute, + CubicFootPerHour, + CubicFootPerMinute, + CubicFootPerSecond, + CubicMeterPerDay, + CubicMeterPerHour, + CubicMeterPerMinute, + CubicMeterPerSecond, + CubicMillimeterPerSecond, + CubicYardPerDay, + CubicYardPerHour, + CubicYardPerMinute, + CubicYardPerSecond, + DeciliterPerDay, + DeciliterPerMinute, + KiloliterPerDay, + KiloliterPerMinute, + KilousGallonPerMinute, + LiterPerDay, + LiterPerHour, + LiterPerMinute, + LiterPerSecond, + MegaliterPerDay, + MegaukGallonPerSecond, + MicroliterPerDay, + MicroliterPerMinute, + MilliliterPerDay, + MilliliterPerMinute, + MillionUsGallonsPerDay, + NanoliterPerDay, + NanoliterPerMinute, + OilBarrelPerDay, + OilBarrelPerHour, + OilBarrelPerMinute, + OilBarrelPerSecond, + UkGallonPerDay, + UkGallonPerMinute, + UkGallonPerSecond, + UsGallonPerDay, + UsGallonPerHour, + UsGallonPerMinute, + UsGallonPerSecond, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeUnit.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeUnit.g.cs new file mode 100644 index 0000000000..8e915b6bb7 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Units/VolumeUnit.g.cs @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum VolumeUnit + { + Undefined = 0, + AcreFoot, + AuTablespoon, + Centiliter, + CubicCentimeter, + CubicDecimeter, + CubicFoot, + CubicInch, + CubicKilometer, + CubicMeter, + CubicMicrometer, + CubicMile, + CubicMillimeter, + CubicYard, + Deciliter, + HectocubicFoot, + HectocubicMeter, + Hectoliter, + ImperialBeerBarrel, + ImperialGallon, + ImperialOunce, + KilocubicFoot, + KilocubicMeter, + KiloimperialGallon, + Kiloliter, + KilousGallon, + Liter, + MegacubicFoot, + MegaimperialGallon, + Megaliter, + MegausGallon, + MetricCup, + MetricTeaspoon, + Microliter, + Milliliter, + OilBarrel, + UkTablespoon, + UsBeerBarrel, + UsCustomaryCup, + UsGallon, + UsLegalCup, + UsOunce, + UsPint, + UsQuart, + UsTablespoon, + UsTeaspoon, + } + + #pragma warning restore 1591 +} diff --git a/UnitsNet.WindowsRuntimeComponent/IQuantity.cs b/UnitsNet.WindowsRuntimeComponent/IQuantity.cs new file mode 100644 index 0000000000..dcb6cdf144 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/IQuantity.cs @@ -0,0 +1,165 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using JetBrains.Annotations; +using UnitsNet.Units; + +namespace UnitsNet +{ + /// + /// Represents a quantity. + /// + public partial interface IQuantity + { + /// + /// The of this quantity. + /// + QuantityType Type { get; } + + /// + /// The of this quantity. + /// + BaseDimensions Dimensions { get; } + +#if !WINDOWS_UWP + /// + /// Information about the quantity type, such as unit values and names. + /// + QuantityInfo QuantityInfo { get; } +#endif + + /// + /// Dynamically convert to another unit representation. + /// + /// The unit enum value. The unit must be compatible, so for you should provide a value. + /// Value converted to the specified unit. + /// Wrong unit enum type was given. +#if WINDOWS_UWP + double As(object unit); +#else + double As(Enum unit); +#endif + + /// + /// The unit this quantity was constructed with or the BaseUnit if the default constructor was used. + /// + +#if WINDOWS_UWP + object Unit { get; } +#else + Enum Unit { get; } +#endif + +#if !WINDOWS_UWP + /// + /// 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. + IQuantity ToUnit(Enum unit); +#endif + } + +#if !WINDOWS_UWP + + public partial interface IQuantity + { + /// + /// Get string representation of value and unit. Using two significant digits after radix. + /// + /// String representation. + /// Format to use for localization and number formatting. Defaults to if null. + string ToString([CanBeNull] IFormatProvider provider); + + /// + /// Get string representation of value and unit. + /// + /// The number of significant digits after the radix point. + /// String representation. + /// Format to use for localization and number formatting. Defaults to if null. + string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix); + + /// + /// Get string representation of value and unit. + /// + /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." + /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. + /// String representation. + /// Format to use for localization and number formatting. Defaults to if null. + string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args); + } + +#else + + public partial interface IQuantity + { + /// + /// Get string representation of value and unit. Using two significant digits after radix. + /// + /// String representation. + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + string ToString([CanBeNull] string cultureName); + + /// + /// Get string representation of value and unit. + /// + /// The number of significant digits after the radix point. + /// String representation. + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + string ToString(string cultureName, int significantDigitsAfterRadix); + + /// + /// Get string representation of value and unit. + /// + /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." + /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. + /// String representation. + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args); + } + +#endif + +#if !WINDOWS_UWP + public interface IQuantity : IQuantity where TUnitType : Enum + { + /// + /// Convert to a unit representation . + /// + /// Value converted to the specified unit. + double As(TUnitType unit); + + /// + new TUnitType Unit { get; } + + /// + new QuantityInfo QuantityInfo { get; } + + /// + /// Change the default unit representation of the quantity, which affects things like . + /// + /// + /// + IQuantity ToUnit(TUnitType unit); + } +#endif +} diff --git a/UnitsNet.WindowsRuntimeComponent/InternalHelpers/Guard.cs b/UnitsNet.WindowsRuntimeComponent/InternalHelpers/Guard.cs new file mode 100644 index 0000000000..9a30d55ecc --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/InternalHelpers/Guard.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using JetBrains.Annotations; + +namespace UnitsNet.InternalHelpers +{ + /// + /// Guard methods to ensure parameter values satisfy pre-conditions and use a consistent exception message. + /// + internal static class Guard + { + /// + /// Throws if value is , + /// or . + /// + /// The value to check. + /// Name of parameter in calling method. + /// The given if valid. + /// If is invalid. + internal static double EnsureValidNumber(double value, [InvokerParameterName] string paramName) + { + if (double.IsNaN(value)) throw new ArgumentException("NaN is not a valid number.", paramName); + if (double.IsInfinity(value)) throw new ArgumentException("PositiveInfinity or NegativeInfinity is not a valid number.", paramName); + return value; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/InternalHelpers/ReflectionBridgeExtensions.cs b/UnitsNet.WindowsRuntimeComponent/InternalHelpers/ReflectionBridgeExtensions.cs new file mode 100644 index 0000000000..db971f3d00 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/InternalHelpers/ReflectionBridgeExtensions.cs @@ -0,0 +1,107 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; +#if NET40 || NET35 || NET20 || SILVERLIGHT +using UniformTypeInfo = System.Type; +#else +using UniformTypeInfo = System.Reflection.TypeInfo; +#endif + +[assembly: + InternalsVisibleTo( + "UnitsNet.Serialization.JsonNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010089abdcb0025f7d1c4c766686dd852b978ca5bb9fd80bba9d3539e8399b01170ae0ea10c0c3baa301b1d13090d5aff770532de00c88b67c4b24669fde7f9d87218f1c6c073a09016cbb2f87119b94227c2301f4e2a096043e30f7c47c872bbd8e0b80d924952e6b36990f13f847e83e9efb107ec2121fe39d7edaaa4e235af8c4")] + +// Based on +// https://github.com/StefH/ReflectionBridge/blob/c1e34e57fe3fc93507e83d5cebc1677396645397/ReflectionBridge/src/ReflectionBridge/Extensions/ReflectionBridgeExtensions.cs +// MIT license +namespace UnitsNet.InternalHelpers +{ + internal struct TypeWrapper + { + private readonly Type _type; + + public TypeWrapper(Type type) + { + _type = type; + } + + internal Assembly Assembly => _type.ToUniformType().Assembly; + internal bool IsEnum => _type.ToUniformType().IsEnum; + internal bool IsClass => _type.ToUniformType().IsClass; + internal bool IsAssignableFrom(Type other) => _type.ToUniformType().IsAssignableFrom(other.ToUniformType()); + internal bool IsValueType => _type.ToUniformType().IsValueType; + + internal PropertyInfo GetProperty(string name) + { +#if NET40 || NET35 || NET20 || SILVERLIGHT + return _type.GetProperty(name); +#else + return _type.GetTypeInfo().GetDeclaredProperty(name); +#endif + } + + internal IEnumerable GetDeclaredMethods() + { + var t = _type.ToUniformType(); + while (t != null) + { +#if NET40 || NET35 || NET20 || SILVERLIGHT + foreach (MethodInfo m in t.GetMethods()) +#else + foreach (MethodInfo m in t.DeclaredMethods) +#endif + yield return m; + + t = t.BaseType?.ToUniformType(); + } + } + } + + internal static class ReflectionBridgeExtensions + { + /// + /// Wrap the type to make it .NET agnostic using Type for old targets and the newer TypeInfo for newer targets. + /// + public static TypeWrapper Wrap(this Type type) + { + return new TypeWrapper(type); + } + + /// + /// Returns the type or type info object depending on compile target, such as TypeInfo for .NET 4.5+ and Type for .NET + /// 4.0 and older. + /// The APIs of these two objects are similar, but obtaining them is slightly different. + /// The idea is to get fewer #if pragma statements in the code. + /// + public static UniformTypeInfo ToUniformType(this Type type) + { +#if NET40 || NET35 || NET20 || SILVERLIGHT + return type; +#else + return type.GetTypeInfo(); +#endif + } + } +} diff --git a/UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs b/UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs similarity index 100% rename from UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs rename to UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs b/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs new file mode 100644 index 0000000000..6eabf7ddbe --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs @@ -0,0 +1,173 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Linq; +using System.Reflection; +using JetBrains.Annotations; +using UnitsNet.InternalHelpers; +using UnitsNet.Units; + +namespace UnitsNet +{ + /// + /// Information about the quantity, such as names, unit values and zero quantity. + /// This is useful to enumerate units and present names with quantities and units + /// chose dynamically at runtime, such as unit conversion apps or allowing the user to change the + /// unit representation. + /// + /// + /// Typically you obtain this by looking it up via . + /// +#if WINDOWS_UWP + internal +#else + public +#endif + class QuantityInfo + { + private static readonly string UnitEnumNamespace = typeof(LengthUnit).Namespace; + + private static readonly Type[] UnitEnumTypes = typeof(Length) + .Wrap() + .Assembly + .GetExportedTypes() + .Where(t => t.Wrap().IsEnum && t.Namespace == UnitEnumNamespace && t.Name.EndsWith("Unit")) + .ToArray(); + + public QuantityInfo(QuantityType quantityType, [NotNull] Enum[] units, [NotNull] Enum baseUnit, [NotNull] IQuantity zero, [NotNull] BaseDimensions baseDimensions) + { + if(quantityType == QuantityType.Undefined) throw new ArgumentException("Quantity type can not be undefined.", nameof(quantityType)); + if(units == null) throw new ArgumentNullException(nameof(units)); + if(baseUnit == null) throw new ArgumentNullException(nameof(baseUnit)); + if(zero == null) throw new ArgumentNullException(nameof(zero)); + if(baseDimensions == null) throw new ArgumentNullException(nameof(baseDimensions)); + + Name = quantityType.ToString(); + QuantityType = quantityType; + UnitType = UnitEnumTypes.First(t => t.Name == $"{quantityType}Unit"); + UnitInfos = units.Select(unit => new UnitInfo(unit)).ToArray(); + UnitNames = UnitInfos.Select(unitInfo => unitInfo.Name).ToArray(); + Units = units; + BaseUnitInfo = new UnitInfo(baseUnit); + BaseUnit = BaseUnitInfo.Value; + Zero = zero; + ValueType = zero.GetType(); + BaseDimensions = baseDimensions; + } + + /// + /// Quantity name, such as "Length" or "Mass". + /// + public string Name { get; } + + /// + /// Quantity type, such as or . + /// + public QuantityType QuantityType { get; } + + public UnitInfo[] UnitInfos { get; } + + /// + /// All unit names for the quantity, such as ["Centimeter", "Decimeter", "Meter", ...]. + /// + [Obsolete("This property is deprecated and will be removed at a future release. Please use the UnitInfos property.")] + public string[] UnitNames { get; } + + /// + /// All unit enum values for the quantity, such as [, + /// , , ...]. + /// + [Obsolete("This property is deprecated and will be removed at a future release. Please use the UnitInfos property.")] + public Enum[] Units { get; } + + public UnitInfo BaseUnitInfo { get; } + + /// + /// The base unit for the quantity, such as . + /// + [Obsolete("This property is deprecated and will be removed at a future release. Please use the BaseUnitInfo property.")] + public Enum BaseUnit { get; } + + /// + /// Zero value of quantity, such as . + /// + public IQuantity Zero { get; } + + /// + /// Unit enum type, such as or . + /// + public Type UnitType { get; } + + /// + /// Quantity value type, such as or . + /// + public Type ValueType { get; } + + /// + /// The for a quantity. + /// + public BaseDimensions BaseDimensions { get; } + } + +#if !WINDOWS_UWP + /// + /// + /// This is a specialization of , for when the unit type is known. + /// Typically you obtain this by looking it up statically from or + /// , or dynamically via . + /// + /// The unit enum type, such as . + public class QuantityInfo : QuantityInfo + where TUnit : Enum + { + public QuantityInfo(QuantityType quantityType, TUnit[] units, TUnit baseUnit, IQuantity zero, BaseDimensions baseDimensions) + : base(quantityType, units.Cast().ToArray(), baseUnit, zero, baseDimensions) + { + Zero = zero; + UnitInfos = units.Select(unit => new UnitInfo(unit)).ToArray(); + Units = units; + BaseUnitInfo = new UnitInfo(baseUnit); + BaseUnit = BaseUnitInfo.Value; + } + + /// + public new UnitInfo[] UnitInfos { get; } + + /// + [Obsolete("This property is deprecated and will be removed at a future release. Please use the UnitInfos property.")] + public new TUnit[] Units { get; } + + /// + public new UnitInfo BaseUnitInfo { get; } + + /// + [Obsolete("This property is deprecated and will be removed at a future release. Please use the BaseUnitInfo property.")] + public new TUnit BaseUnit { get; } + + /// + public new IQuantity Zero { get; } + + /// + public new TUnit UnitType { get; } + } +#endif +} diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs b/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs new file mode 100644 index 0000000000..d7e6be736b --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ + /// + /// Quantity type was not found. This is typically thrown for dynamic conversions, + /// such as . + /// +#if WINDOWS_UWP + internal +#else + public +#endif + class QuantityNotFoundException : UnitsNetException + { + public QuantityNotFoundException() + { + } + + public QuantityNotFoundException(string message) : base(message) + { + } + + public QuantityNotFoundException(string message, Exception innerException) : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs b/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs new file mode 100644 index 0000000000..e1385fa68e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs @@ -0,0 +1,113 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// Operator overloads not supported in Windows Runtime Components, we use 'double' type instead + +using UnitsNet.InternalHelpers; + +#if !WINDOWS_UWP +namespace UnitsNet +{ + /// + /// A type that supports implicit cast from all .NET numeric types, in order to avoid a large number of overloads + /// and binary size for all From(value, unit) factory methods, for each of the 700+ units in the library. + /// stores the value internally with the proper type to preserve the range or precision of the original value: + /// + /// for [byte, short, int, long, float, double] + /// for [decimal] to preserve the 128-bit precision + /// + /// + /// + /// At the time of this writing, this reduces the number of From(value, unit) overloads to 1/4th: + /// From 8 (int, long, double, decimal + each nullable) down to 2 (QuantityValue and QuantityValue?). + /// This also adds more numeric types with no extra overhead, such as float, short and byte. + /// + public struct QuantityValue + { + /// + /// Value assigned when implicitly casting from all numeric types except , since + /// has the greatest range and is 64 bits versus 128 bits for . + /// + private readonly double? _value; + + /// + /// Value assigned when implicitly casting from type, since it has a greater precision than + /// and we want to preserve that when constructing quantities that use + /// as their value type. + /// + private readonly decimal? _valueDecimal; + + private QuantityValue(double val) + { + _value = Guard.EnsureValidNumber(val, nameof(val)); + _valueDecimal = null; + } + + private QuantityValue(decimal val) + { + _valueDecimal = val; + _value = null; + } + + #region To QuantityValue + +#pragma warning disable 618 + // Prefer double for integer types, since most quantities use that type as of now and + // that avoids unnecessary casts back and forth. + // If we later change to use decimal more, we should revisit this. + public static implicit operator QuantityValue(byte val) => new QuantityValue((double) val); + public static implicit operator QuantityValue(short val) => new QuantityValue((double) val); + public static implicit operator QuantityValue(int val) => new QuantityValue((double) val); + public static implicit operator QuantityValue(long val) => new QuantityValue((double) val); + public static implicit operator QuantityValue(float val) => new QuantityValue(val); // double + public static implicit operator QuantityValue(double val) => new QuantityValue(val); // double + public static implicit operator QuantityValue(decimal val) => new QuantityValue(val); // decimal +#pragma warning restore 618 + + #endregion + + #region To double + + public static explicit operator double(QuantityValue number) + { + // double -> decimal -> zero (since we can't implement the default struct ctor) + return number._value ?? (double) number._valueDecimal.GetValueOrDefault(); + } + + #endregion + + #region To decimal + + public static explicit operator decimal(QuantityValue number) + { + // decimal -> double -> zero (since we can't implement the default struct ctor) + return number._valueDecimal ?? (decimal) number._value.GetValueOrDefault(); + } + + #endregion + + public override string ToString() + { + return _value.HasValue ? _value.ToString() : _valueDecimal.ToString(); + } + } +} +#endif diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 new file mode 100644 index 0000000000..56191e7025 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 @@ -0,0 +1,335 @@ +using module ".\Types.psm1" + +#Requires -Version 5.1 + +# Set Write-Output used by Include- files to UTF8 encoding to fix copyright character +[Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8 +$OutputEncoding = [Text.UTF8Encoding]::UTF8 + +# DaddyCool => daddyCool +function ToCamelCase($str) +{ + return $str.Substring(0,1).ToLowerInvariant() + $str.Substring(1) +} + +function ValueOrDefault($value, $defaultValue){ + if ($value -ne $null) { $value } else { $defaultValue } +} + +function GenerateQuantity([Quantity]$quantity, $outDir) +{ + $outFileName = "$outDir/$($quantity.Name).NetFramework.g.cs" + GenerateQuantitySourceCode $quantity "NetFramework" | Out-File -Encoding "UTF8" $outFileName | Out-Null + if (!$?) { exit 1 } + Write-Host -NoNewline "quantity .NET(OK) " + + $outFileName = "$outDir/../../../UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/$($quantity.Name).WindowsRuntimeComponent.g.cs" + GenerateQuantitySourceCode $quantity "WindowsRuntimeComponent" | Out-File -Encoding "UTF8" $outFileName | Out-Null + if (!$?) { exit 1 } + Write-Host -NoNewline "quantity WRC(OK) " +} + +function GenerateUnitTestBaseClass([Quantity]$quantity, $outDir) +{ + $outFileName = "$outDir/$($quantity.Name)TestsBase.g.cs" + GenerateUnitTestBaseClassSourceCode $quantity | Out-File -Encoding "UTF8" $outFileName | Out-Null + if (!$?) { + exit 1 + } + Write-Host -NoNewline "test base(OK) " +} + +function GenerateUnitTestClassIfNotExists([Quantity]$quantity, $outDir) +{ + Write-Host -NoNewline "test stub" + $outFileName = "$outDir/$($quantity.Name)Tests.cs" + if (Test-Path $outFileName) + { + Write-Host -NoNewline "(skip) " + return + } + else + { + GenerateUnitTestPlaceholderSourceCode $quantity | Out-File -Encoding "UTF8" $outFileName | Out-Null + if (!$?) { + exit 1 + } + Write-Host -NoNewline "(OK) " + } +} + +function GenerateUnitType([Quantity]$quantity, $outDir) +{ + $outFileName = "$outDir/$($quantity.Name)Unit.g.cs" + + GenerateUnitTypeSourceCode $quantity | Out-File -Encoding "UTF8" -Force $outFileName | Out-Null + if (!$?) { + exit 1 + } + Write-Host -NoNewline "unit(OK) " +} + +function GenerateUnitSystemDefault($quantities, $outDir) +{ + Write-Host -NoNewline "UnitAbbreviationsCache.g.cs: " + $outFileName = "$outDir/UnitAbbreviationsCache.g.cs" + + GenerateUnitSystemDefaultSourceCode $quantities | Out-File -Encoding "UTF8" -Force $outFileName | Out-Null + if (!$?) { + Write-Host "(error) " + exit 1 + } + Write-Host "(OK) " +} + +function GenerateQuantityType($quantities, $outDir) +{ + Write-Host -NoNewline "QuantityType.g.cs: " + $outFileName = "$outDir/QuantityType.g.cs" + + GenerateQuantityTypeSourceCode $quantities | Out-File -Encoding "UTF8" -Force $outFileName | Out-Null + if (!$?) { + Write-Host "(error) " + exit 1 + } + Write-Host "(OK) " +} + +function GenerateStaticQuantity($quantities, $outDir) +{ + Write-Host -NoNewline "Quantity.g.cs: " + $outFileName = "$outDir/Quantity.g.cs" + + GenerateStaticQuantitySourceCode $quantities | Out-File -Encoding "UTF8" -Force $outFileName | Out-Null + if (!$?) { + Write-Host "(error) " + exit 1 + } + Write-Host "(OK) " +} + +function EnsureDirExists([String] $dirPath) { + New-Item -ItemType Directory -Force -Path $dirPath | Out-Null + if (!$?) { + exit 1 + } +} + +function Set-ConversionFunctions +{ + param ([Parameter(Mandatory = $true, ValueFromPipeline=$true)] $quantity) + PROCESS { + foreach ($u in $quantity.Units) { + + # Use decimal for internal calculations if base type is not double, such as for long or int. + if ($quantity.BaseType -eq "decimal") { + $u.FromUnitToBaseFunc = $u.FromUnitToBaseFunc -replace "d", "m" + $u.FromBaseToUnitFunc = $u.FromBaseToUnitFunc -replace "d", "m" + } + + # Convert to/from double for other base types + $u.FromUnitToBaseFunc = "$($u.FromUnitToBaseFunc)" + $u.FromBaseToUnitFunc = "$($u.FromBaseToUnitFunc)" + } + return $quantity + } +} + +function Add-PrefixUnits { + param ([Parameter(Mandatory = $true, ValueFromPipeline=$true)] $quantity) + PROCESS { + $prefixUnits = @() + + foreach ($unit in $quantity.Units) + { + foreach ($localization in $unit.Localization){ + if($localization.AbbreviationsWithPrefixes.Count -gt 0){ + if($unit.Prefixes.Count -ne $localization.AbbreviationsWithPrefixes.Count){ + Write-Error "The prefix count ($($unit.Prefixes.Count)) does not match the abbreviations with prefixes count ($($localization.AbbreviationsWithPrefixes.Count)) for $($quantity.Name).$($unit.SingularName)" -ErrorAction Stop + } + } + } + + $prefixIndex = 0 + foreach ($prefix in $unit.Prefixes) + { + $prefixInfo = switch ($prefix) + { + "Kilo" { "k", "1e3d"; break; } + "Hecto" { "h", "1e2d"; break; } + "Deca" { "da", "1e1d"; break; } + "Deci" { "d", "1e-1d"; break; } + "Centi" { "c", "1e-2d"; break; } + "Milli" { "m", "1e-3d"; break; } + "Micro" { "µ", "1e-6d"; break; } + "Nano" { "n", "1e-9d"; break; } + + # Optimization, move less frequently used prefixes to the end + "Pico" { "p", "1e-12d"; break; } + "Femto" { "f", "1e-15d"; break; } + "Atto" { "a", "1e-18d"; break; } + "Zepto" { "z", "1e-21d"; break; } + "Yocto" { "y", "1e-24d"; break; } + + "Yotta" { "Y", "1e24d"; break; } + "Zetta" { "Z", "1e21d"; break; } + "Exa" { "E", "1e18d"; break; } + "Peta" { "P", "1e15d"; break; } + "Tera" { "T", "1e12d"; break; } + "Giga" { "G", "1e9d"; break; } + "Mega" { "M", "1e6d"; break; } + + # Binary prefixes + "Kibi" { "Ki", "1024d"; break; } + "Mebi" { "Mi", "(1024d * 1024)"; break; } + "Gibi" { "Gi", "(1024d * 1024 * 1024)"; break; } + "Tebi" { "Ti", "(1024d * 1024 * 1024 * 1024)"; break; } + "Pebi" { "Pi", "(1024d * 1024 * 1024 * 1024 * 1024)"; break; } + "Exbi" { "Ei", "(1024d * 1024 * 1024 * 1024 * 1024 * 1024)"; break; } + } + + $prefixAbbreviation = $prefixInfo[0] + $prefixFactor = $prefixInfo[1] + + $prefixUnit = New-Object PsObject -Property @{ + SingularName=$prefix + $(ToCamelCase $unit.SingularName) + PluralName=$prefix + $(ToCamelCase $unit.PluralName) + FromUnitToBaseFunc="("+$unit.FromUnitToBaseFunc+") * $prefixFactor" + FromBaseToUnitFunc="("+$unit.FromBaseToUnitFunc+") / $prefixFactor" + + Localization=$unit.Localization | % { + $abbrev = $prefixAbbreviation + $_.Abbreviations[0] + if ($_.AbbreviationsWithPrefixes) { + $abbrev = $_.AbbreviationsWithPrefixes[$prefixIndex] + } + + New-Object PsObject -Property @{ + Culture=$_.Culture + Abbreviations= $abbrev + }} + } + + # Append prefix unit + $prefixUnits += $prefixUnit + $prefixIndex++; + } # foreach prefixes + } # foreach units + + $quantity.Units += $prefixUnits + return $quantity + } +} + +function Set-UnitsOrderedByName { + param ([Parameter(Mandatory = $true, ValueFromPipeline=$true)] $quantity) + PROCESS { + $quantity.Units = ($quantity.Units | sort SingularName) + return $quantity + } +} + +function Add-InheritedUnits([Quantity]$quantity, $quantities) { + + foreach ($inheritFromQuantityName in $quantity.InheritUnitsFrom) { + $inheritFromQuantity = $quantities | Where { $_.Name -eq $inheritFromQuantityName } | Select -First 1 + $quantity.Units += $inheritFromQuantity.Units + + Write-Host -NoNewline "(inherit $inheritFromQuantityName) " + } +} + +# Load external generator functions with same name as file +. "$PSScriptRoot/Include-GenerateTemplates.ps1" +. "$PSScriptRoot/Include-GenerateUnitSystemDefaultSourceCode.ps1" +. "$PSScriptRoot/Include-GenerateQuantityTypeSourceCode.ps1" +. "$PSScriptRoot/Include-GenerateStaticQuantitySourceCode.ps1" +. "$PSScriptRoot/Include-GenerateQuantitySourceCode.ps1" +. "$PSScriptRoot/Include-GenerateUnitTypeSourceCode.ps1" +. "$PSScriptRoot/Include-GenerateUnitTestBaseClassSourceCode.ps1" +. "$PSScriptRoot/Include-GenerateUnitTestPlaceholderSourceCode.ps1" + +EnsureDirExists ($quantityDir = "$PSScriptRoot/../GeneratedCode/Quantities") +EnsureDirExists ($unitEnumDir = "$PSScriptRoot/../GeneratedCode/Units") +EnsureDirExists ($unitSystemDir = "$PSScriptRoot/../GeneratedCode") +EnsureDirExists ($testsDir = "$PSScriptRoot/../../UnitsNet.Tests/GeneratedCode") +EnsureDirExists ($testsCustomCodeDir = "$PSScriptRoot/../../UnitsNet.Tests/CustomCode") + +$templatesDir = "$PSScriptRoot/../../Common/UnitDefinitions" +$pad = 25 + +# Parse unit definitions from .json files +# TODO Find a way to automap from JSON into Quantity type +$quantities = Get-ChildItem -Path $templatesDir -filter "*.json" ` + | %{(Get-Content $_.FullName -Encoding "UTF8" | Out-String)} ` + | ConvertFrom-Json ` + | %{ + # $_ | fl | out-string | write-host -foreground blue + # New-Object -TypeName Quantity -Verbose -Property @{ + [Quantity]@{ + Name = $_.Name + XmlDocSummary = $_.XmlDoc + XmlDocRemarks = $_.XmlDocRemarks + BaseUnit = $_.BaseUnit + BaseType = ValueOrDefault $_.BaseType "double" + BaseDimensions = @{ + Length = ValueOrDefault $_.BaseDimensions.L 0 + Mass = ValueOrDefault $_.BaseDimensions.M 0 + Time = ValueOrDefault $_.BaseDimensions.T 0 + ElectricCurrent = ValueOrDefault $_.BaseDimensions.I 0 + Temperature = ValueOrDefault $_.BaseDimensions.Θ 0 + AmountOfSubstance = ValueOrDefault $_.BaseDimensions.N 0 + LuminousIntensity = ValueOrDefault $_.BaseDimensions.J 0 + } + GenerateArithmetic = ValueOrDefault $_.GenerateArithmetic $true + Logarithmic = ValueOrDefault $_.Logarithmic $false + LogarithmicScalingFactor = ValueOrDefault $_.LogarithmicScalingFactor 1 + Units = $_.Units | %{ + # $_ | fl | out-string | Write-Host -ForegroundColor blue + [Unit]@{ + SingularName = $_.SingularName + PluralName = $_.PluralName + XmlDocSummary = $_.XmlDocSummary + XmlDocRemarks = $_.XmlDocRemarks + FromUnitToBaseFunc = $_.FromUnitToBaseFunc + FromBaseToUnitFunc = $_.FromBaseToUnitFunc + Prefixes = [string[]](ValueOrDefault $_.Prefixes @()) + Localization = $_.Localization | %{ + # $_ | fl | out-string | Write-Host -ForegroundColor blue + [Localization]@{ + Culture = $_.Culture + Abbreviations = $_.Abbreviations + AbbreviationsWithPrefixes = $_.AbbreviationsWithPrefixes + } + } + } + } + } + } ` + | Add-PrefixUnits ` + | Set-ConversionFunctions ` + | Set-UnitsOrderedByName + +foreach ($quantity in $quantities) { + Write-Host -NoNewline "$($quantity.Name):".PadRight($pad) + + Add-InheritedUnits $quantity $quantities + + GenerateQuantity $quantity $quantityDir + GenerateUnitType $quantity $unitEnumDir + GenerateUnitTestBaseClass $quantity $testsDir + GenerateUnitTestClassIfNotExists $quantity $testsCustomCodeDir + + Write-Host "" +} + +Write-Host "" +GenerateUnitSystemDefault $quantities $unitSystemDir +GenerateQuantityType $quantities $unitSystemDir +GenerateStaticQuantity $quantities $unitSystemDir + +$unitCount = ($quantities | %{$_.Units.Count} | Measure -Sum).Sum + +Write-Host "`n`n" +Write-Host -Foreground Yellow "Summary: $unitCount units in $($quantities.Count) quantities".PadRight($pad) +Write-Host "`n`n" +exit 0 diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 new file mode 100644 index 0000000000..f46760bcf8 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -0,0 +1,1127 @@ +using module ".\Types.psm1" + +class GeneratorArgs +{ + [Quantity]$Quantity + [Unit]$BaseUnit + [string]$UnitEnumName + [boolean]$TargetIsWindowsRuntimeComponent +} + +function GenerateQuantitySourceCode([Quantity]$quantity, [string]$target) +{ + $quantityName = $quantity.Name; + $units = $quantity.Units; + $valueType = $quantity.BaseType; + [Unit]$baseUnit = $units | where { $_.SingularName -eq $quantity.BaseUnit } | Select-Object -First 1 + $baseUnitSingularName = $baseUnit.SingularName + $baseUnitPluralName = $baseUnit.PluralName + $unitEnumName = "$quantityName" + "Unit" + $wrc = $target -eq "WindowsRuntimeComponent" + $privateAccessModifierIfWrc = if ($wrc) { "private" } else { "public" } + $accessModifier = if ($wrc) { "internal" } else { "public" } + $enumOrObject = if ($wrc) { "object" } else { "Enum" } + + $baseDimensions = $quantity.BaseDimensions; + $isDimensionless = $baseDimensions -eq $null -or ( $baseDimensions.Length -eq 0 -and $baseDimensions.Mass -eq 0 -and $baseDimensions.Time -eq 0 -and $baseDimensions.ElectricCurrent -eq 0 -and $baseDimensions.Temperature -eq 0 -and $baseDimensions.AmountOfSubstance -eq 0 -and $baseDimensions.LuminousIntensity -eq 0 ) + + [GeneratorArgs]$genArgs = New-Object GeneratorArgs -Property @{ + Quantity = $quantity; + BaseUnit = $baseUnit; + UnitEnumName = $unitEnumName; + TargetIsWindowsRuntimeComponent = $wrc; + } + # $genArgs | fl | out-string | write-host -foreground yellow +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Globalization; +using System.Linq; +using JetBrains.Annotations; +using UnitsNet.Units; +using UnitsNet.InternalHelpers; + +// ReSharper disable once CheckNamespace + +namespace UnitsNet +{ +"@; +$obsoleteAttribute = GetObsoleteAttribute($quantity); +if ($obsoleteAttribute) +{ + $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this section +}@" + /// + /// $($quantity.XmlDocSummary) + /// +"@; if ($quantity.XmlDocRemarks) {@" + /// + /// $($quantity.XmlDocRemarks) + /// +"@; } + if($wrc) {@" + // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components + // Public structures can't have any members other than public fields, and those fields must be value types or strings. + // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. + public sealed partial class $quantityName : IQuantity +"@; } else {@" + public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible +"@; }@" + { + /// + /// The numeric value this quantity was constructed with. + /// + private readonly $valueType _value; + + /// + /// The unit this quantity was constructed with. + /// + private readonly $($unitEnumName)? _unit; + + static $quantityName() + { +"@; if($isDimensionless) + {@" + BaseDimensions = BaseDimensions.Dimensionless; +"@; } + else + {@" + BaseDimensions = new BaseDimensions($($baseDimensions.Length), $($baseDimensions.Mass), $($baseDimensions.Time), $($baseDimensions.ElectricCurrent), $($baseDimensions.Temperature), $($baseDimensions.AmountOfSubstance), $($baseDimensions.LuminousIntensity)); +"@; } + if ($wrc) {@" + Info = new QuantityInfo(QuantityType.$quantityName, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); +"@; } else {@" + Info = new QuantityInfo<$unitEnumName>(QuantityType.$quantityName, Units, BaseUnit, Zero, BaseDimensions); +"@; }@" + } +"@; # Windows Runtime Component requires a default constructor + if ($wrc) {@" + /// + /// Creates the quantity with a value of 0 in the base unit $baseUnitSingularName. + /// + /// + /// Windows Runtime Component requires a default constructor. + /// + public $quantityName() + { + _value = 0; + _unit = BaseUnit; + } +"@; } @" + + /// + /// Creates the quantity with the given numeric value and unit. + /// + /// The numeric value to contruct this quantity with. + /// The unit representation to contruct this quantity with. + /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. + /// If value is NaN or Infinity. + $privateAccessModifierIfWrc $quantityName($valueType numericValue, $unitEnumName unit) + { + if(unit == $unitEnumName.Undefined) + throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit)); + +"@; if ($quantity.BaseType -eq "double") {@" + _value = Guard.EnsureValidNumber(numericValue, nameof(numericValue)); +"@; } else {@" + _value = numericValue; +"@; }@" + _unit = unit; + } +"@; + GenerateStaticProperties $genArgs + GenerateProperties $genArgs + GenerateConversionProperties $genArgs + GenerateStaticMethods $genArgs + GenerateStaticFactoryMethods $genArgs + GenerateStaticParseMethods $genArgs + GenerateArithmeticOperators $genArgs + GenerateEqualityAndComparison $genArgs + GenerateConversionMethods $genArgs +@" + + #region ToString Methods + + /// + /// Get default string representation of value and unit. + /// + /// String representation. + public override string ToString() + { + return ToString(null); + } + + /// + /// Get string representation of value and unit. Using two significant digits after radix. + /// + /// String representation. +"@; # Windows Runtime Component does not support IFormatProvider type + if ($wrc) {@" + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + public string ToString([CanBeNull] string cultureName) + { + var provider = cultureName; +"@; } else {@" + /// Format to use for localization and number formatting. Defaults to if null. + public string ToString([CanBeNull] IFormatProvider provider) + { +"@; }@" + return ToString(provider, 2); + } + + /// + /// Get string representation of value and unit. + /// + /// The number of significant digits after the radix point. + /// String representation. +"@; # Windows Runtime Component does not support IFormatProvider type + if ($wrc) {@" + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + public string ToString(string cultureName, int significantDigitsAfterRadix) + { + var provider = cultureName; +"@; } else {@" + /// Format to use for localization and number formatting. Defaults to if null. + public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) + { +"@; }@" + var value = Convert.ToDouble(Value); + var format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); + return ToString(provider, format); + } + + /// + /// Get string representation of value and unit. + /// + /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." + /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. + /// String representation. +"@; # Windows Runtime Component does not support IFormatProvider type + if ($wrc) {@" + /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. + public string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args) + { + var provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use for localization and number formatting. Defaults to if null. + public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) + { +"@; }@" + if (format == null) throw new ArgumentNullException(nameof(format)); + if (args == null) throw new ArgumentNullException(nameof(args)); + + provider = provider ?? GlobalConfiguration.DefaultCulture; + + var value = Convert.ToDouble(Value); + var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); + return string.Format(provider, format, formatArgs); + } + + #endregion +"@; if ($wrc) {@" + + private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] string cultureName) + { + return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; + } +"@; }@" + +"@; if (!$wrc) {@" + #region IConvertible Methods + + TypeCode IConvertible.GetTypeCode() + { + return TypeCode.Object; + } + + bool IConvertible.ToBoolean(IFormatProvider provider) + { + throw new InvalidCastException($"Converting {typeof($quantityName)} to bool is not supported."); + } + + byte IConvertible.ToByte(IFormatProvider provider) + { + return Convert.ToByte(_value); + } + + char IConvertible.ToChar(IFormatProvider provider) + { + throw new InvalidCastException($"Converting {typeof($quantityName)} to char is not supported."); + } + + DateTime IConvertible.ToDateTime(IFormatProvider provider) + { + throw new InvalidCastException($"Converting {typeof($quantityName)} to DateTime is not supported."); + } + + decimal IConvertible.ToDecimal(IFormatProvider provider) + { + return Convert.ToDecimal(_value); + } + + double IConvertible.ToDouble(IFormatProvider provider) + { + return Convert.ToDouble(_value); + } + + short IConvertible.ToInt16(IFormatProvider provider) + { + return Convert.ToInt16(_value); + } + + int IConvertible.ToInt32(IFormatProvider provider) + { + return Convert.ToInt32(_value); + } + + long IConvertible.ToInt64(IFormatProvider provider) + { + return Convert.ToInt64(_value); + } + + sbyte IConvertible.ToSByte(IFormatProvider provider) + { + return Convert.ToSByte(_value); + } + + float IConvertible.ToSingle(IFormatProvider provider) + { + return Convert.ToSingle(_value); + } + + string IConvertible.ToString(IFormatProvider provider) + { + return ToString(provider); + } + + object IConvertible.ToType(Type conversionType, IFormatProvider provider) + { + if(conversionType == typeof($quantityName)) + return this; + else if(conversionType == typeof($unitEnumName)) + return Unit; + else if(conversionType == typeof(QuantityType)) + return $quantityName.QuantityType; + else if(conversionType == typeof(BaseDimensions)) + return $quantityName.BaseDimensions; + else + throw new InvalidCastException($"Converting {typeof($quantityName)} to {conversionType} is not supported."); + } + + ushort IConvertible.ToUInt16(IFormatProvider provider) + { + return Convert.ToUInt16(_value); + } + + uint IConvertible.ToUInt32(IFormatProvider provider) + { + return Convert.ToUInt32(_value); + } + + ulong IConvertible.ToUInt64(IFormatProvider provider) + { + return Convert.ToUInt64(_value); + } + + #endregion +"@; }@" + } +} +"@; +} + +function GenerateStaticProperties([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $baseUnitSingularName = $genArgs.BaseUnit.SingularName + $valueType = $genArgs.Quantity.BaseType +@" + + #region Static Properties + + /// +"@; if ($wrc) {@" + internal static QuantityInfo Info { get; } +"@; } else {@" + public static QuantityInfo<$unitEnumName> Info { get; } +"@; }@" + + /// + /// The of this quantity. + /// + public static BaseDimensions BaseDimensions { get; } + + /// + /// The base unit of $quantityName, which is $baseUnitSingularName. All conversions go via this value. + /// + public static $unitEnumName BaseUnit { get; } = $unitEnumName.$baseUnitSingularName; + + /// + /// Represents the largest possible value of $quantityName + /// + public static $quantityName MaxValue { get; } = new $quantityName($valueType.MaxValue, BaseUnit); + + /// + /// Represents the smallest possible value of $quantityName + /// + public static $quantityName MinValue { get; } = new $quantityName($valueType.MinValue, BaseUnit); + + /// + /// The of this quantity. + /// + public static QuantityType QuantityType { get; } = QuantityType.$quantityName; + + /// + /// All units of measurement for the $quantityName quantity. + /// + public static $unitEnumName[] Units { get; } = Enum.GetValues(typeof($unitEnumName)).Cast<$unitEnumName>().Except(new $unitEnumName[]{ $unitEnumName.Undefined }).ToArray(); + + /// + /// Gets an instance of this quantity with a value of 0 in the base unit $baseUnitSingularName. + /// + public static $quantityName Zero { get; } = new $quantityName(0, BaseUnit); + + #endregion +"@; +} + +function GenerateProperties([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $baseUnitSingularName = $genArgs.BaseUnit.SingularName + $valueType = $genArgs.Quantity.BaseType + $wrc = $genArgs.TargetIsWindowsRuntimeComponent +@" + + #region Properties + + /// + /// The numeric value this quantity was constructed with. + /// +"@; # Windows Runtime Component does not support decimal + if ($wrc) {@" + public double Value => Convert.ToDouble(_value); +"@; } else {@" + public $valueType Value => _value; +"@; } +@" + + /// + $enumOrObject IQuantity.Unit => Unit; + + /// + /// The unit this quantity was constructed with -or- if default ctor was used. + /// + public $unitEnumName Unit => _unit.GetValueOrDefault(BaseUnit); + +"@; if ($wrc) {@" + internal QuantityInfo QuantityInfo => Info; +"@; } else {@" + public QuantityInfo<$unitEnumName> QuantityInfo => Info; + + /// + QuantityInfo IQuantity.QuantityInfo => Info; +"@; }@" + + /// + /// The of this quantity. + /// + public QuantityType Type => $quantityName.QuantityType; + + /// + /// The of this quantity. + /// + public BaseDimensions Dimensions => $quantityName.BaseDimensions; + + #endregion +"@; +} + +function GenerateConversionProperties([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $units = $genArgs.Quantity.Units +@" + + #region Conversion Properties +"@; + foreach ($unit in $units) { + $propertyName = $unit.PluralName; + $obsoleteAttribute = GetObsoleteAttribute($unit); + if ($obsoleteAttribute) + { + $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this page + } +@" + + /// + /// Get $quantityName in $propertyName. + /// $($obsoleteAttribute) + public double $propertyName => As($unitEnumName.$($unit.SingularName)); +"@; } +@" + + #endregion +"@; +} + +function GenerateStaticMethods([GeneratorArgs]$genArgs) +{ + $unitEnumName = $genArgs.UnitEnumName +@" + + #region Static Methods + + /// + /// Get unit abbreviation string. + /// + /// Unit to get abbreviation for. + /// Unit abbreviation string. + public static string GetAbbreviation($unitEnumName unit) + { + return GetAbbreviation(unit, null); + } + + /// + /// Get unit abbreviation string. + /// + /// Unit to get abbreviation for. + /// Unit abbreviation string. +"@; # Windows Runtime Component does not support IFormatProvider type +if ($wrc) {@" + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. + public static string GetAbbreviation($unitEnumName unit, [CanBeNull] string cultureName) + { + IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use for localization. Defaults to if null. + public static string GetAbbreviation($unitEnumName unit, [CanBeNull] IFormatProvider provider) + { +"@; }@" + return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); + } + + #endregion +"@; +} + +function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $units = $genArgs.Quantity.Units + $valueType = $genArgs.Quantity.BaseType + $wrc = $genArgs.TargetIsWindowsRuntimeComponent +@" + + #region Static Factory Methods + +"@; foreach ($unit in $units) { + $valueParamName = $unit.PluralName.ToLowerInvariant(); + $obsoleteAttribute = GetObsoleteAttribute($unit); + if ($obsoleteAttribute) + { + $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this page + } + @" + /// + /// Get $quantityName from $($unit.PluralName). + /// $($obsoleteAttribute) + /// If value is NaN or Infinity. +"@; # Windows Runtime Component does not support overloads with same number of parameters + if ($wrc) {@" + [Windows.Foundation.Metadata.DefaultOverload] + public static $quantityName From$($unit.PluralName)(double $valueParamName) +"@; } else {@" + public static $quantityName From$($unit.PluralName)(QuantityValue $valueParamName) +"@; }@" + { + $valueType value = ($valueType) $valueParamName; + return new $quantityName(value, $unitEnumName.$($unit.SingularName)); + } +"@; }@" + + /// + /// Dynamically convert from value and unit enum to . + /// + /// Value to convert from. + /// Unit to convert from. + /// $quantityName unit value. +"@; # Windows Runtime Component does not support parameters named 'value' +if ($wrc) {@" + // Fix name conflict with parameter "value" + [return: System.Runtime.InteropServices.WindowsRuntime.ReturnValueName("returnValue")] + public static $quantityName From(double value, $unitEnumName fromUnit) +"@; } else {@" + public static $quantityName From(QuantityValue value, $unitEnumName fromUnit) +"@; }@" + { + return new $quantityName(($valueType)value, fromUnit); + } + + #endregion +"@; + +} + +function GenerateStaticParseMethods([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $baseUnitPluralName = $genArgs.BaseUnit.PluralName + $units = $genArgs.Quantity.Units + $valueType = $genArgs.Quantity.BaseType + $wrc = $genArgs.TargetIsWindowsRuntimeComponent +@" + + #region Static Parse Methods + + /// + /// Parse a string with one or two quantities of the format "<quantity> <unit>". + /// + /// String to parse. Typically in the form: {number} {unit} + /// + /// Length.Parse("5.5 m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// + /// Expected string to have one or two pairs of quantity and unit in the format + /// "<quantity> <unit>". Eg. "5.5 m" or "1ft 2in" + /// + /// + /// More than one unit is represented by the specified unit abbreviation. + /// Example: Volume.Parse("1 cup") will throw, because it can refer to any of + /// , and . + /// + /// + /// If anything else goes wrong, typically due to a bug or unhandled case. + /// We wrap exceptions in to allow you to distinguish + /// Units.NET exceptions from other exceptions. + /// + public static $quantityName Parse(string str) + { + return Parse(str, null); + } + + /// + /// Parse a string with one or two quantities of the format "<quantity> <unit>". + /// + /// String to parse. Typically in the form: {number} {unit} + /// + /// Length.Parse("5.5 m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// + /// Expected string to have one or two pairs of quantity and unit in the format + /// "<quantity> <unit>". Eg. "5.5 m" or "1ft 2in" + /// + /// + /// More than one unit is represented by the specified unit abbreviation. + /// Example: Volume.Parse("1 cup") will throw, because it can refer to any of + /// , and . + /// + /// + /// If anything else goes wrong, typically due to a bug or unhandled case. + /// We wrap exceptions in to allow you to distinguish + /// Units.NET exceptions from other exceptions. + /// +"@; # Windows Runtime Component does not support IFormatProvider type +if ($wrc) {@" + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. + public static $quantityName Parse(string str, [CanBeNull] string cultureName) + { + IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use when parsing number and unit. Defaults to if null. + public static $quantityName Parse(string str, [CanBeNull] IFormatProvider provider) + { +"@; }@" + return QuantityParser.Default.Parse<$quantityName, $unitEnumName>( + str, + provider, + From); + } + + /// + /// Try to parse a string with one or two quantities of the format "<quantity> <unit>". + /// + /// String to parse. Typically in the form: {number} {unit} + /// Resulting unit quantity if successful. + /// + /// Length.Parse("5.5 m", new CultureInfo("en-US")); + /// + public static bool TryParse([CanBeNull] string str, out $quantityName result) + { + return TryParse(str, null, out result); + } + + /// + /// Try to parse a string with one or two quantities of the format "<quantity> <unit>". + /// + /// String to parse. Typically in the form: {number} {unit} + /// Resulting unit quantity if successful. + /// True if successful, otherwise false. + /// + /// Length.Parse("5.5 m", new CultureInfo("en-US")); + /// +"@; # Windows Runtime Component does not support IFormatProvider type +if ($wrc) {@" + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. + public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureName, out $quantityName result) + { + IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use when parsing number and unit. Defaults to if null. + public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out $quantityName result) + { +"@; }@" + return QuantityParser.Default.TryParse<$quantityName, $unitEnumName>( + str, + provider, + From, + out result); + } + + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static $unitEnumName ParseUnit(string str) + { + return ParseUnit(str, null); + } + + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. +"@; # Windows Runtime Component does not support IFormatProvider type +if ($wrc) {@" + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. + public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) + { + IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use when parsing number and unit. Defaults to if null. + public static $unitEnumName ParseUnit(string str, IFormatProvider provider = null) + { +"@; }@" + return UnitParser.Default.Parse<$unitEnumName>(str, provider); + } + + public static bool TryParseUnit(string str, out $unitEnumName unit) + { + return TryParseUnit(str, null, out unit); + } + + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// The parsed unit if successful. + /// True if successful, otherwise false. + /// + /// Length.TryParseUnit("m", new CultureInfo("en-US")); + /// +"@; # Windows Runtime Component does not support IFormatProvider type +if ($wrc) {@" + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. + public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out $unitEnumName unit) + { + IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); +"@; } else {@" + /// Format to use when parsing number and unit. Defaults to if null. + public static bool TryParseUnit(string str, IFormatProvider provider, out $unitEnumName unit) + { +"@; }@" + return UnitParser.Default.TryParse<$unitEnumName>(str, provider, out unit); + } + + #endregion +"@; +} + +function GenerateLogarithmicArithmeticOperators([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $valueType = $genArgs.Quantity.BaseType + $wrc = $genArgs.TargetIsWindowsRuntimeComponent + $scalingFactor = $genArgs.Quantity.LogarithmicScalingFactor + # Most logarithmic operators need a simple scaling factor of 10. However, certain units such as voltage ratio need to use 20 instead. + $x = 10 * $scalingFactor; + @" + + #region Logarithmic Arithmetic Operators + + public static $quantityName operator -($quantityName right) + { + return new $quantityName(-right.Value, right.Unit); + } + + public static $quantityName operator +($quantityName left, $quantityName right) + { + // Logarithmic addition + // Formula: $x*log10(10^(x/$x) + 10^(y/$x)) + return new $quantityName($x*Math.Log10(Math.Pow(10, left.Value/$x) + Math.Pow(10, right.AsBaseNumericType(left.Unit)/$x)), left.Unit); + } + + public static $quantityName operator -($quantityName left, $quantityName right) + { + // Logarithmic subtraction + // Formula: $x*log10(10^(x/$x) - 10^(y/$x)) + return new $quantityName($x*Math.Log10(Math.Pow(10, left.Value/$x) - Math.Pow(10, right.AsBaseNumericType(left.Unit)/$x)), left.Unit); + } + + public static $quantityName operator *($valueType left, $quantityName right) + { + // Logarithmic multiplication = addition + return new $quantityName(left + right.Value, right.Unit); + } + + public static $quantityName operator *($quantityName left, double right) + { + // Logarithmic multiplication = addition + return new $quantityName(left.Value + ($valueType)right, left.Unit); + } + + public static $quantityName operator /($quantityName left, double right) + { + // Logarithmic division = subtraction + return new $quantityName(left.Value - ($valueType)right, left.Unit); + } + + public static double operator /($quantityName left, $quantityName right) + { + // Logarithmic division = subtraction + return Convert.ToDouble(left.Value - right.AsBaseNumericType(left.Unit)); + } + + #endregion +"@; +} + +function GenerateArithmeticOperators([GeneratorArgs]$genArgs) +{ + # Windows Runtime Component does not support operator overloads + if ($wrc -or (-not $quantity.GenerateArithmetic)) { return } + + # Logarithmic units required different arithmetic + if ($quantity.Logarithmic) { + GenerateLogarithmicArithmeticOperators $genArgs + return + } + + $quantityName = $genArgs.Quantity.Name + $baseUnitPluralName = $genArgs.BaseUnit.PluralName + $valueType = $genArgs.Quantity.BaseType + @" + + #region Arithmetic Operators + + public static $quantityName operator -($quantityName right) + { + return new $quantityName(-right.Value, right.Unit); + } + + public static $quantityName operator +($quantityName left, $quantityName right) + { + return new $quantityName(left.Value + right.AsBaseNumericType(left.Unit), left.Unit); + } + + public static $quantityName operator -($quantityName left, $quantityName right) + { + return new $quantityName(left.Value - right.AsBaseNumericType(left.Unit), left.Unit); + } + + public static $quantityName operator *($valueType left, $quantityName right) + { + return new $quantityName(left * right.Value, right.Unit); + } + + public static $quantityName operator *($quantityName left, $valueType right) + { + return new $quantityName(left.Value * right, left.Unit); + } + + public static $quantityName operator /($quantityName left, $valueType right) + { + return new $quantityName(left.Value / right, left.Unit); + } + + public static double operator /($quantityName left, $quantityName right) + { + return left.$baseUnitPluralName / right.$baseUnitPluralName; + } + + #endregion +"@; +} + +function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $wrc = $genArgs.TargetIsWindowsRuntimeComponent +@" + + #region Equality / IComparable + +"@; # Windows Runtime Component does not support operator overloads + if (-not $wrc) {@" + public static bool operator <=($quantityName left, $quantityName right) + { + return left.Value <= right.AsBaseNumericType(left.Unit); + } + + public static bool operator >=($quantityName left, $quantityName right) + { + return left.Value >= right.AsBaseNumericType(left.Unit); + } + + public static bool operator <($quantityName left, $quantityName right) + { + return left.Value < right.AsBaseNumericType(left.Unit); + } + + public static bool operator >($quantityName left, $quantityName right) + { + return left.Value > right.AsBaseNumericType(left.Unit); + } + + public static bool operator ==($quantityName left, $quantityName right) + { + return left.Equals(right); + } + + public static bool operator !=($quantityName left, $quantityName right) + { + return !(left == right); + } + +"@; }@" + public int CompareTo(object obj) + { + if(obj is null) throw new ArgumentNullException(nameof(obj)); + if(!(obj is $quantityName obj$quantityName)) throw new ArgumentException("Expected type $quantityName.", nameof(obj)); + + return CompareTo(obj$quantityName); + } + + // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods + $accessModifier int CompareTo($quantityName other) + { + return _value.CompareTo(other.AsBaseNumericType(this.Unit)); + } + +"@; + if ($wrc) {@" + [Windows.Foundation.Metadata.DefaultOverload] +"@; }@" + public override bool Equals(object obj) + { + if(obj is null || !(obj is $quantityName obj$quantityName)) + return false; + + return Equals(obj$quantityName); + } + + public bool Equals($quantityName other) + { + return _value.Equals(other.AsBaseNumericType(this.Unit)); + } + + /// + /// + /// Compare equality to another $quantityName within the given absolute or relative tolerance. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// + /// + /// + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// + /// The other quantity to compare to. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. + /// The comparison type: either relative or absolute. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) + { + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); + + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); + + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); + } + + /// + /// Returns the hash code for this instance. + /// + /// A hash code for the current $quantityName. + public override int GetHashCode() + { + return new { QuantityType, Value, Unit }.GetHashCode(); + } + + #endregion +"@; +} + +function GenerateConversionMethods([GeneratorArgs]$genArgs) +{ + $quantityName = $genArgs.Quantity.Name + $unitEnumName = $genArgs.UnitEnumName + $valueType = $genArgs.Quantity.BaseType +@" + + #region Conversion Methods + + double IQuantity.As($enumOrObject unit) => As(($unitEnumName)unit); + + /// + /// Convert to the unit representation . + /// + /// Value converted to the specified unit. + public double As($unitEnumName unit) + { + if(Unit == unit) + return Convert.ToDouble(Value); + + var converted = AsBaseNumericType(unit); + return Convert.ToDouble(converted); + } + +"@; if (-not $wrc) {@" + public double As(Enum unit) => As(($unitEnumName) unit); + +"@; }@" + /// + /// Converts this $quantityName to another $quantityName with the unit representation . + /// + /// A $quantityName with the specified unit. + public $quantityName ToUnit($unitEnumName unit) + { + var convertedValue = AsBaseNumericType(unit); + return new $quantityName(convertedValue, unit); + } + +"@; if (-not $wrc) {@" + IQuantity<$unitEnumName> IQuantity<$unitEnumName>.ToUnit($unitEnumName unit) => ToUnit(unit); + + public IQuantity ToUnit(Enum unit) => ToUnit(($unitEnumName) unit); + +"@; }@" + /// + /// Converts the current value + unit to the base unit. + /// This is typically the first step in converting from one unit to another. + /// + /// The value in the base unit representation. + private $valueType AsBaseUnit() + { + switch(Unit) + { +"@; foreach ($unit in $units) { + $func = $unit.FromUnitToBaseFunc.Replace("x", "_value");@" + case $unitEnumName.$($unit.SingularName): return $func; +"@; }@" + default: + throw new NotImplementedException($"Can not convert {Unit} to base units."); + } + } + + private $valueType AsBaseNumericType($unitEnumName unit) + { + if(Unit == unit) + return _value; + + var baseUnitValue = AsBaseUnit(); + + switch(unit) + { +"@; foreach ($unit in $units) { + $func = $unit.FromBaseToUnitFunc.Replace("x", "baseUnitValue");@" + case $unitEnumName.$($unit.SingularName): return $func; +"@; }@" + default: + throw new NotImplementedException($"Can not convert {Unit} to {unit}."); + } + } + + #endregion +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantityTypeSourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantityTypeSourceCode.ps1 new file mode 100644 index 0000000000..11b0c4933e --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantityTypeSourceCode.ps1 @@ -0,0 +1,61 @@ +function GenerateQuantityTypeSourceCode($quantities) +{ +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace + +namespace UnitsNet +{ + /// + /// Lists all generated quantities with the same name as the quantity struct type, + /// such as Length, Mass, Force etc. + /// This is useful for populating options in the UI, such as creating a generic conversion + /// tool with inputValue, quantityName, fromUnit and toUnit selectors. + /// + public enum QuantityType + { + Undefined = 0, +"@; foreach ($quantity in $quantities) { +@" + $($quantity.Name), +"@; }@" + } +} +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 new file mode 100644 index 0000000000..0539c41fd0 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 @@ -0,0 +1,205 @@ +using module ".\Types.psm1" + +function GenerateStaticQuantitySourceCode([Quantity[]]$quantities, [string]$target) +{ +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Linq; +using JetBrains.Annotations; +using UnitsNet.InternalHelpers; +using UnitsNet.Units; + +#if WINDOWS_UWP +using FromValue = System.Double; +#else +using FromValue = UnitsNet.QuantityValue; +#endif + +namespace UnitsNet +{ + /// + /// Dynamically parse or construct quantities when types are only known at runtime. + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static partial class Quantity + { +#if !WINDOWS_UWP + /// + public static bool TryFrom(double value, Enum unit, out IQuantity quantity) + { + // Implicit cast to FromValue would prevent TryFrom from being called, + // so we need to explicitly check this here for double arguments. + if (double.IsNaN(value) || double.IsInfinity(value)) + { + quantity = default(IQuantity); + return false; + } + + return TryFrom((FromValue) value, unit, out quantity); + } +#endif + + /// + /// Try to dynamically construct a quantity. + /// + /// Numeric value. + /// Unit enum value. + /// The resulting quantity if successful, otherwise default. + /// True if successful with assigned the value, otherwise false. +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + { + switch (unit) + { +"@; foreach ($quantity in $quantities) { + $quantityName = $quantity.Name + $unitTypeName = $quantityName + "Unit" + $unitValue = toCamelCase($unitTypeName);@" + case $unitTypeName $($unitValue): + quantity = $quantityName.From(value, $unitValue); + return true; +"@; }@" + default: + { + quantity = default(IQuantity); + return false; + } + } + } + + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + + /// + /// Dynamically parse a quantity string representation. + /// + /// The format provider to use for lookup. Defaults to if null. + /// Type of quantity, such as . + /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. + /// The parsed quantity. + /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. +#if WINDOWS_UWP + internal +#else + public +#endif + static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + { + if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) + throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); + + if (TryParse(formatProvider, quantityType, quantityString, out IQuantity quantity)) return quantity; + + throw new ArgumentException($"Quantity string could not be parsed to quantity {quantityType}."); + } + + /// +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + TryParse(null, quantityType, quantityString, out quantity); + + /// + /// Try to dynamically parse a quantity string representation. + /// + /// The format provider to use for lookup. Defaults to if null. + /// Type of quantity, such as . + /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. + /// The resulting quantity if successful, otherwise default. + /// The parsed quantity. +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + { + quantity = default(IQuantity); + + if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) + return false; + + var parser = QuantityParser.Default; + +"@; foreach ($quantity in $quantities) { + $quantityName = $quantity.Name;@" + if (quantityType == typeof($quantityName)) + return parser.TryParse<$quantityName, $($quantityName)Unit>(quantityString, formatProvider, $quantityName.From, out quantity); + +"@; }@" + throw new ArgumentException( + $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); + } + +#if !WINDOWS_UWP + /// + /// Get information about the given quantity type. + /// + /// The quantity type enum value. + /// Information about the quantity and its units. + public static QuantityInfo GetInfo(QuantityType quantityType) + { + return Infos.First(qi => qi.QuantityType == quantityType); + } +#endif + } +} +"@; +} + +function toCamelCase([string] $str) { + return [char]::ToLower($str[0]) + $str.Substring(1) +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateTemplates.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateTemplates.ps1 new file mode 100644 index 0000000000..f6b2d15ce7 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateTemplates.ps1 @@ -0,0 +1,13 @@ +<# +.SYNOPSIS +Returns the Obsolete attribute if ObsoleteText has been defined on the JSON input - otherwise returns empty string +It is up to the consumer to wrap any padding/new lines in order to keep to correct indentation formats +#> +function GetObsoleteAttribute($quantityOrUnit) +{ + if ($quantityOrUnit.ObsoleteText) + { + return "[System.Obsolete(""$($quantityOrUnit.ObsoleteText)"")]"; + } + return ""; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitSystemDefaultSourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitSystemDefaultSourceCode.ps1 new file mode 100644 index 0000000000..d2ecda7bad --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitSystemDefaultSourceCode.ps1 @@ -0,0 +1,79 @@ +function GenerateUnitSystemDefaultSourceCode($quantities) +{ +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +// ReSharper disable RedundantCommaInArrayInitializer +// ReSharper disable once CheckNamespace + +namespace UnitsNet +{ + public sealed partial class UnitAbbreviationsCache + { + private static readonly (string CultureName, Type UnitType, int UnitValue, string[] UnitAbbreviations)[] GeneratedLocalizations + = new [] + { +"@; + foreach ($quantity in $quantities) + { + $quantityName = $quantity.Name; + $unitEnumName = "$quantityName" + "Unit"; + + foreach ($unit in $quantity.Units) + { + $enumValue = $unit.SingularName; + + foreach ($localization in $unit.Localization) + { + $cultureName = $localization.Culture; + $abbreviationParams = $localization.Abbreviations -join '", "' +@" + (`"$cultureName`", typeof($unitEnumName), (int)$unitEnumName.$enumValue, new string[]{`"$abbreviationParams`"}), +"@; + } + } + } +@" + }; + } +} +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 new file mode 100644 index 0000000000..2529555d72 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 @@ -0,0 +1,318 @@ +using module ".\Types.psm1" +function GenerateUnitTestBaseClassSourceCode([Quantity]$quantity) +{ + $quantityName = $quantity.Name + $units = $quantity.Units + $valueType = $quantity.BaseType + [Unit]$baseUnit = $units | where { $_.SingularName -eq $quantity.BaseUnit } | Select-Object -First 1 + $baseUnitSingularName = $baseUnit.SingularName + $baseUnitPluralName = $baseUnit.PluralName + $baseUnitVariableName = $baseUnitSingularName.ToLowerInvariant() + $unitEnumName = "$quantityName" + "Unit" + +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Linq; +using UnitsNet.Units; +using Xunit; + +// Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else? +#pragma warning disable 1718 + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Tests +{ + /// + /// Test of $quantityName. + /// +// ReSharper disable once PartialTypeWithSinglePart + public abstract partial class $($quantityName)TestsBase + { +"@; foreach ($unit in $units) {@" + protected abstract double $($unit.PluralName)InOne$($baseUnit.SingularName) { get; } +"@; }@" + +// ReSharper disable VirtualMemberNeverOverriden.Global +"@; foreach ($unit in $units) {@" + protected virtual double $($unit.PluralName)Tolerance { get { return 1e-5; } } +"@; }@" +// ReSharper restore VirtualMemberNeverOverriden.Global + + [Fact] + public void Ctor_WithUndefinedUnit_ThrowsArgumentException() + { + Assert.Throws(() => new $quantityName(($valueType)0.0, $unitEnumName.Undefined)); + } + +"@; if ($quantity.BaseType -eq "double") {@" + [Fact] + public void Ctor_WithInfinityValue_ThrowsArgumentException() + { + Assert.Throws(() => new $quantityName(double.PositiveInfinity, $unitEnumName.$($baseUnit.SingularName))); + Assert.Throws(() => new $quantityName(double.NegativeInfinity, $unitEnumName.$($baseUnit.SingularName))); + } + + [Fact] + public void Ctor_WithNaNValue_ThrowsArgumentException() + { + Assert.Throws(() => new $quantityName(double.NaN, $unitEnumName.$($baseUnit.SingularName))); + } +"@; }@" + + [Fact] + public void $($baseUnit.SingularName)To$($quantityName)Units() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); +"@; foreach ($unit in $units) {@" + AssertEx.EqualTolerance($($unit.PluralName)InOne$($baseUnit.SingularName), $baseUnitVariableName.$($unit.PluralName), $($unit.PluralName)Tolerance); +"@; }@" + } + + [Fact] + public void FromValueAndUnit() + { +"@; foreach ($unit in $units) {@" + AssertEx.EqualTolerance(1, $quantityName.From(1, $unitEnumName.$($unit.SingularName)).$($unit.PluralName), $($unit.PluralName)Tolerance); +"@; }@" + } + +"@; if ($quantity.BaseType -eq "double") {@" + [Fact] + public void From$($baseUnit.PluralName)_WithInfinityValue_ThrowsArgumentException() + { + Assert.Throws(() => $quantityName.From$($baseUnit.PluralName)(double.PositiveInfinity)); + Assert.Throws(() => $quantityName.From$($baseUnit.PluralName)(double.NegativeInfinity)); + } + + [Fact] + public void From$($baseUnit.PluralName)_WithNanValue_ThrowsArgumentException() + { + Assert.Throws(() => $quantityName.From$($baseUnit.PluralName)(double.NaN)); + } +"@; }@" + + [Fact] + public void As() + { + var $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); +"@; foreach ($unit in $units) {@" + AssertEx.EqualTolerance($($unit.PluralName)InOne$($baseUnit.SingularName), $baseUnitVariableName.As($($quantityName)Unit.$($unit.SingularName)), $($unit.PluralName)Tolerance); +"@; }@" + } + + [Fact] + public void ToUnit() + { + var $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); +"@; foreach ($unit in $units) +{ + $asQuantityVariableName = "$($unit.SingularName.ToLowerInvariant())Quantity"; +@" + + var $asQuantityVariableName = $baseUnitVariableName.ToUnit($($quantityName)Unit.$($unit.SingularName)); + AssertEx.EqualTolerance($($unit.PluralName)InOne$($baseUnit.SingularName), (double)$asQuantityVariableName.Value, $($unit.PluralName)Tolerance); + Assert.Equal($($quantityName)Unit.$($unit.SingularName), $asQuantityVariableName.Unit); +"@; }@" + } + + [Fact] + public void ConversionRoundTrip() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); +"@; foreach ($unit in $units) {@" + AssertEx.EqualTolerance(1, $quantityName.From$($unit.PluralName)($baseUnitVariableName.$($unit.PluralName)).$baseUnitPluralName, $($unit.PluralName)Tolerance); +"@; }@" + } + +"@; if ($quantity.Logarithmic -eq $true) {@" + [Fact] + public void LogarithmicArithmeticOperators() + { + $quantityName v = $quantityName.From$baseUnitPluralName(40); + AssertEx.EqualTolerance(-40, -v.$baseUnitPluralName, $($unit.PluralName)Tolerance); + AssertLogarithmicAddition(); + AssertLogarithmicSubtraction(); + AssertEx.EqualTolerance(50, (v*10).$baseUnitPluralName, $($unit.PluralName)Tolerance); + AssertEx.EqualTolerance(50, (10*v).$baseUnitPluralName, $($unit.PluralName)Tolerance); + AssertEx.EqualTolerance(35, (v/5).$baseUnitPluralName, $($unit.PluralName)Tolerance); + AssertEx.EqualTolerance(35, v/$quantityName.From$baseUnitPluralName(5), $($unit.PluralName)Tolerance); + } + + protected abstract void AssertLogarithmicAddition(); + + protected abstract void AssertLogarithmicSubtraction(); + +"@; } + elseif ($quantity.GenerateArithmetic -eq $true) {@" + [Fact] + public void ArithmeticOperators() + { + $quantityName v = $quantityName.From$baseUnitPluralName(1); + AssertEx.EqualTolerance(-1, -v.$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(2, ($quantityName.From$baseUnitPluralName(3)-v).$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(2, (v + v).$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(10, (v*10).$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(10, (10*v).$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(2, ($quantityName.From$baseUnitPluralName(10)/5).$baseUnitPluralName, $($baseUnit.PluralName)Tolerance); + AssertEx.EqualTolerance(2, $quantityName.From$baseUnitPluralName(10)/$quantityName.From$baseUnitPluralName(5), $($baseUnit.PluralName)Tolerance); + } +"@; }@" + + [Fact] + public void ComparisonOperators() + { + $quantityName one$($baseUnit.SingularName) = $quantityName.From$baseUnitPluralName(1); + $quantityName two$baseUnitPluralName = $quantityName.From$baseUnitPluralName(2); + + Assert.True(one$($baseUnit.SingularName) < two$baseUnitPluralName); + Assert.True(one$($baseUnit.SingularName) <= two$baseUnitPluralName); + Assert.True(two$baseUnitPluralName > one$($baseUnit.SingularName)); + Assert.True(two$baseUnitPluralName >= one$($baseUnit.SingularName)); + + Assert.False(one$($baseUnit.SingularName) > two$baseUnitPluralName); + Assert.False(one$($baseUnit.SingularName) >= two$baseUnitPluralName); + Assert.False(two$baseUnitPluralName < one$($baseUnit.SingularName)); + Assert.False(two$baseUnitPluralName <= one$($baseUnit.SingularName)); + } + + [Fact] + public void CompareToIsImplemented() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); + Assert.Equal(0, $baseUnitVariableName.CompareTo($baseUnitVariableName)); + Assert.True($baseUnitVariableName.CompareTo($quantityName.Zero) > 0); + Assert.True($quantityName.Zero.CompareTo($baseUnitVariableName) < 0); + } + + [Fact] + public void CompareToThrowsOnTypeMismatch() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); + Assert.Throws(() => $baseUnitVariableName.CompareTo(new object())); + } + + [Fact] + public void CompareToThrowsOnNull() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); + Assert.Throws(() => $baseUnitVariableName.CompareTo(null)); + } + + [Fact] + public void EqualityOperators() + { + var a = $quantityName.From$baseUnitPluralName(1); + var b = $quantityName.From$baseUnitPluralName(2); + + // ReSharper disable EqualExpressionComparison + + Assert.True(a == a); + Assert.False(a != a); + + Assert.True(a != b); + Assert.False(a == b); + + Assert.False(a == null); + Assert.False(null == a); + +// ReSharper restore EqualExpressionComparison + } + + [Fact] + public void EqualsIsImplemented() + { + var a = $quantityName.From$baseUnitPluralName(1); + var b = $quantityName.From$baseUnitPluralName(2); + + Assert.True(a.Equals(a)); + Assert.False(a.Equals(b)); + Assert.False(a.Equals(null)); + } + + [Fact] + public void EqualsRelativeToleranceIsImplemented() + { + var v = $quantityName.From$baseUnitPluralName(1); + Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); + Assert.False(v.Equals($quantityName.Zero, $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); + } + + [Fact] + public void EqualsReturnsFalseOnTypeMismatch() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); + Assert.False($baseUnitVariableName.Equals(new object())); + } + + [Fact] + public void EqualsReturnsFalseOnNull() + { + $quantityName $baseUnitVariableName = $quantityName.From$baseUnitPluralName(1); + Assert.False($baseUnitVariableName.Equals(null)); + } + + [Fact] + public void UnitsDoesNotContainUndefined() + { + Assert.DoesNotContain($unitEnumName.Undefined, $quantityName.Units); + } + + [Fact] + public void HasAtLeastOneAbbreviationSpecified() + { + var units = Enum.GetValues(typeof($unitEnumName)).Cast<$unitEnumName>(); + foreach(var unit in units) + { + if(unit == $unitEnumName.Undefined) + continue; + + var defaultAbbreviation = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit); + } + } + + [Fact] + public void BaseDimensionsShouldNeverBeNull() + { + Assert.False($quantityName.BaseDimensions is null); + } + } +} +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestPlaceholderSourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestPlaceholderSourceCode.ps1 new file mode 100644 index 0000000000..870714e402 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTestPlaceholderSourceCode.ps1 @@ -0,0 +1,56 @@ +function GenerateUnitTestPlaceholderSourceCode($quantity) +{ + $quantityName = $quantity.Name; +@" +//------------------------------------------------------------------------------ +// +// This code was generated (once) by \generate-code.bat, but will not be +// regenerated when it already exists. The purpose of creating this file is to make +// it easier to remember to implement all the unit conversion test cases. +// +// Whenever a new unit is added to this quantity and \generate-code.bat is run, +// the base test class will get a new abstract property and cause a compile error +// in this derived class, reminding the developer to implement the test case +// for the new unit. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +using System; + +namespace UnitsNet.Tests.CustomCode +{ + public class $($quantityName)Tests : $($quantityName)TestsBase + { + // Override properties in base class here + } +} +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTypeSourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTypeSourceCode.ps1 new file mode 100644 index 0000000000..548b03b6f6 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateUnitTypeSourceCode.ps1 @@ -0,0 +1,74 @@ +function GenerateUnitTypeSourceCode($quantity) { + $quantityName = $quantity.Name; + $units = $quantity.Units; + $unitEnumName = "$($quantityName)Unit"; +@" +//------------------------------------------------------------------------------ +// +// This code was generated by \generate-code.bat. +// +// Changes to this file will be lost when the code is regenerated. +// The build server regenerates the code before each build and a pre-build +// step will regenerate the code on each local build. +// +// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. +// +// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. +// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. +// +// +//------------------------------------------------------------------------------ + +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// ReSharper disable once CheckNamespace +namespace UnitsNet.Units +{ + // Disable missing XML comment warnings for the generated unit enums. + #pragma warning disable 1591 + + public enum $unitEnumName + { + Undefined = 0, +"@; foreach ($unit in $units) { + $obsoleteAttribute = GetObsoleteAttribute($unit); + + if ($unit.XmlDocSummary) {@" + + /// + /// $($unit.XmlDocSummary) + /// +"@; } + if ($unit.XmlDocRemarks) {@" + /// $($unit.XmlDocRemarks) +"@; } + if ($obsoleteAttribute) {@" + $($obsoleteAttribute) +"@; }@" + $($unit.SingularName), +"@; }@" + } + + #pragma warning restore 1591 +} +"@; +} diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 new file mode 100644 index 0000000000..11151b0bd2 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 @@ -0,0 +1,43 @@ +class Quantity +{ + [string]$Name + [string]$XmlDocSummary + [string]$XmlDocRemarks + [string]$BaseUnit + [string]$BaseType # TODO Rename me to ValueType + [BaseDimensions]$BaseDimensions = [BaseDimensions]::new() + [boolean]$GenerateArithmetic = $true + [boolean]$Logarithmic = $false + [int]$LogarithmicScalingFactor = 1 + [Unit[]]$Units = @() +} + +class Unit +{ + [string]$SingularName + [string]$PluralName + [string]$XmlDocSummary + [string]$XmlDocRemarks + [string]$FromUnitToBaseFunc + [string]$FromBaseToUnitFunc + [string[]]$Prefixes = @() + [Localization[]]$Localization = @() +} + +class Localization +{ + [string]$Culture + [string[]]$Abbreviations = @() + [string[]]$AbbreviationsWithPrefixes = @() +} + +class BaseDimensions +{ + [int]$Length = 0 + [int]$Mass = 0 + [int]$Time = 0 + [int]$ElectricCurrent = 0 + [int]$Temperature = 0 + [int]$AmountOfSubstance = 0 + [int]$LuminousIntensity = 0 +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs b/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs new file mode 100644 index 0000000000..817601ddb2 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs @@ -0,0 +1,456 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Globalization; +using System.Linq; +using System.Reflection; +using UnitsNet.InternalHelpers; +using UnitsNet.Units; + +#if WINDOWS_UWP +using Culture = System.String; +using FromValue = System.Double; +#else +using Culture = System.IFormatProvider; +using FromValue = UnitsNet.QuantityValue; +#endif + +namespace UnitsNet +{ + /// + /// Convert between units of a quantity, such as converting from meters to centimeters of a given length. + /// + public static class UnitConverter + { + private static readonly string UnitTypeNamespace = typeof(LengthUnit).Namespace; + private static readonly Assembly UnitsNetAssembly = typeof(Length).Wrap().Assembly; + + private static readonly Type[] QuantityTypes = UnitsNetAssembly.GetTypes() + .Where(typeof(IQuantity).Wrap().IsAssignableFrom) + .Where(x => x.Wrap().IsClass || x.Wrap().IsValueType) // Future-proofing: we are discussing changing quantities from struct to class + .ToArray(); + + private static readonly Type[] UnitTypes = UnitsNetAssembly.GetTypes() + .Where(x => x.Namespace == UnitTypeNamespace && x.Wrap().IsEnum && x.Name.EndsWith("Unit")) + .ToArray(); + + /// + /// Convert between any two quantity units given a numeric value and two unit enum values. + /// + /// Numeric value. + /// From unit enum value. + /// To unit enum value, must be compatible with . + /// The converted value in the new unit representation. +#if WINDOWS_UWP + internal +#else + public +#endif + static double Convert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue) + { + return Quantity + .From(fromValue, fromUnitValue) + .As(toUnitValue); + } + + /// + /// Try to convert between any two quantity units given a numeric value and two unit enum values. + /// + /// Numeric value. + /// From unit enum value. + /// To unit enum value, must be compatible with . + /// The converted value, if successful. Otherwise default. + /// True if successful. +#if WINDOWS_UWP + internal +#else + public +#endif + static bool TryConvert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) + { + convertedValue = 0; + if (!Quantity.TryFrom(fromValue, fromUnitValue, out IQuantity from)) return false; + + try + { + // We're not going to implement TryAs() in all quantities, so let's just try-catch here + convertedValue = from.As(toUnitValue); + return true; + } + catch + { + return false; + } + } + + /// + /// Convert between any two quantity units by their names, such as converting a "Length" of N "Meter" to "Centimeter". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// double centimeters = ConvertByName(5, "Length", "Meter", "Centimeter"); // 500 + /// Output value as the result of converting to . + /// No quantities were found that match . + /// No units match the abbreviation. + /// More than one unit matches the abbreviation. + public static double ConvertByName(FromValue fromValue, string quantityName, string fromUnit, string toUnit) + { + if (!TryGetUnitType(quantityName, out Type unitType)) + throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); + + if (!TryParseUnit(unitType, fromUnit, out Enum fromUnitValue)) // ex: LengthUnit.Meter + { + var e = new UnitNotFoundException($"Unit not found [{fromUnit}]."); + e.Data["unitName"] = fromUnit; + throw e; + } + + if (!TryParseUnit(unitType, toUnit, out Enum toUnitValue)) // ex: LengthUnit.Centimeter + { + var e = new UnitNotFoundException($"Unit not found [{toUnit}]."); + e.Data["unitName"] = toUnit; + throw e; + } + + return Convert(fromValue, fromUnitValue, toUnitValue); + } + + /// + /// Convert between any two quantity units by their names, such as converting a "Length" of N "Meter" to "Centimeter". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// Result if conversion was successful, 0 if not. + /// bool ok = TryConvertByName(5, "Length", "Meter", "Centimeter", out double centimeters); // 500 + /// True if conversion was successful. + public static bool TryConvertByName(FromValue inputValue, string quantityName, string fromUnit, string toUnit, out double result) + { + result = 0d; + + if (!TryGetUnitType(quantityName, out var unitType)) + return false; + + if (!TryParseUnit(unitType, fromUnit, out var fromUnitValue)) // ex: LengthUnit.Meter + return false; + + if (!TryParseUnit(unitType, toUnit, out var toUnitValue)) // ex: LengthUnit.Centimeter + return false; + + result = Convert(inputValue, fromUnitValue, toUnitValue); + return true; + } + + /// + /// Convert between any two quantity units by their abbreviations, such as converting a "Length" of N "m" to "cm". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 + /// Output value as the result of converting to . + public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) + { + // WindowsRuntimeComponent does not support default values on public methods + // ReSharper disable once IntroduceOptionalParameters.Global + return ConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, null); + } + + /// + /// Convert between any two quantity units by their abbreviations, such as converting a "Length" of N "m" to "cm". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// Culture to parse abbreviations with. + /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 + /// Output value as the result of converting to . + /// No quantity types match the . + /// + /// No unit types match the prefix of or no units + /// are mapped to the abbreviation. + /// + /// More than one unit matches the abbreviation. + public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string culture) + { + if (!TryGetQuantityType(quantityName, out var quantityType)) + throw new QuantityNotFoundException($"The given quantity name was not found: {quantityName}"); + + if (!TryGetUnitType(quantityName, out var unitType)) + throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); + + var cultureInfo = string.IsNullOrWhiteSpace(culture) ? GlobalConfiguration.DefaultCulture : new CultureInfo(culture); + + var fromUnitValue = UnitParser.Default.Parse(fromUnitAbbrev, unitType, cultureInfo); // ex: ("m", LengthUnit) => LengthUnit.Meter + var toUnitValue = UnitParser.Default.Parse(toUnitAbbrev, unitType, cultureInfo); // ex:("cm", LengthUnit) => LengthUnit.Centimeter + + var fromMethod = GetStaticFromMethod(quantityType, unitType); // ex: UnitsNet.Length.From(double inputValue, LengthUnit inputUnit) + var fromResult = fromMethod.Invoke(null, new object[] {fromValue, fromUnitValue}); // ex: Length quantity = UnitsNet.Length.From(5, LengthUnit.Meter) + + var asMethod = GetAsMethod(quantityType, unitType); // ex: quantity.As(LengthUnit outputUnit) + var asResult = asMethod.Invoke(fromResult, new object[] {toUnitValue}); // ex: double outputValue = quantity.As(LengthUnit.Centimeter) + + return (double) asResult; + } + + /// + /// Convert between any two quantity units by their abbreviations, such as converting a "Length" of N "m" to "cm". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// Result if conversion was successful, 0 if not. + /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 + /// True if conversion was successful. + public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) + { + return TryConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, out result, null); + } + + /// + /// Convert between any two quantity units by their abbreviations, such as converting a "Length" of N "m" to "cm". + /// This is particularly useful for creating things like a generated unit conversion UI, + /// where you list some selectors: + /// a) Quantity: Length, Mass, Force etc. + /// b) From unit: Meter, Centimeter etc if Length is selected + /// c) To unit: Meter, Centimeter etc if Length is selected + /// + /// + /// Input value, which together with represents the quantity to + /// convert from. + /// + /// + /// Name of quantity, such as "Length" and "Mass". for all + /// values. + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// + /// Name of unit, such as "Meter" or "Centimeter" if "Length" was passed as + /// . + /// + /// Culture to parse abbreviations with. + /// Result if conversion was successful, 0 if not. + /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 + /// True if conversion was successful. + public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, + string culture) + { + result = 0d; + + if (!TryGetQuantityType(quantityName, out var quantityType)) + return false; + + if (!TryGetUnitType(quantityName, out var unitType)) + return false; + + var cultureInfo = string.IsNullOrWhiteSpace(culture) ? GlobalConfiguration.DefaultCulture : new CultureInfo(culture); + + if (!UnitParser.Default.TryParse(fromUnitAbbrev, unitType, cultureInfo, out var fromUnitValue)) // ex: ("m", LengthUnit) => LengthUnit.Meter + return false; + + if (!UnitParser.Default.TryParse(toUnitAbbrev, unitType, cultureInfo, out var toUnitValue)) // ex:("cm", LengthUnit) => LengthUnit.Centimeter + return false; + + var fromMethod = GetStaticFromMethod(quantityType, unitType); // ex: UnitsNet.Length.From(double inputValue, LengthUnit inputUnit) + var fromResult = fromMethod.Invoke(null, new object[] {fromValue, fromUnitValue}); // ex: Length quantity = UnitsNet.Length.From(5, LengthUnit.Meter) + + var asMethod = GetAsMethod(quantityType, unitType); // ex: quantity.As(LengthUnit outputUnit) + var asResult = asMethod.Invoke(fromResult, new object[] {toUnitValue}); // ex: double outputValue = quantity.As(LengthUnit.Centimeter) + + result = (double) asResult; + return true; + } + + private static MethodInfo GetAsMethod(Type quantityType, Type unitType) + { + // Only a single As() method as of this writing, but let's safe-guard a bit for future-proofing + // ex: double result = quantity.As(LengthUnit outputUnit); + return quantityType.Wrap().GetDeclaredMethods() + .Single(m => m.Name == "As" && + !m.IsStatic && + m.IsPublic && + HasParameterTypes(m, unitType) && + m.ReturnType == typeof(double)); + } + + private static MethodInfo GetStaticFromMethod(Type quantityType, Type unitType) + { + // Want to match: Length l = UnitsNet.Length.From(double inputValue, LengthUnit inputUnit) + // Do NOT match : Length? UnitsNet.Length.From(double? inputValue, LengthUnit inputUnit) + return quantityType.Wrap().GetDeclaredMethods() + .Single(m => m.Name == "From" && + m.IsStatic && + m.IsPublic && + HasParameterTypes(m, typeof(FromValue), unitType) && + m.ReturnType == quantityType); + } + + private static bool HasParameterTypes(MethodInfo methodInfo, params Type[] expectedTypes) + { + var parameters = methodInfo.GetParameters(); + if (parameters.Length != expectedTypes.Length) + throw new ArgumentException($"The number of parameters {parameters.Length} did not match the number of types {expectedTypes.Length}."); + + for (var i = 0; i < parameters.Length; i++) + { + var p = parameters[i]; + var t = expectedTypes[i]; + if (p.ParameterType != t) + return false; + } + + return true; + } + + + /// + /// Parse a unit by the unit enum type and a unit enum value > + /// + /// Unit type, such as . + /// Unit name, such as "Meter" corresponding to . + /// The return enum value, such as boxed as an object. + /// True if succeeded, otherwise false. + /// No unit values match the . + private static bool TryParseUnit(Type unitType, string unitName, out Enum unitValue) + { + unitValue = null; + var eNames = Enum.GetNames(unitType); + unitName = eNames.FirstOrDefault(x => x.Equals(unitName, StringComparison.OrdinalIgnoreCase)); + if (unitName == null) + return false; + + unitValue = (Enum) Enum.Parse(unitType, unitName); + return true; + } + + private static bool TryGetUnitType(string quantityName, out Type unitType) + { + var unitTypeName = quantityName + "Unit"; // ex. LengthUnit + + unitType = UnitTypes.FirstOrDefault(x => + x.Name.Equals(unitTypeName, StringComparison.OrdinalIgnoreCase)); + + return unitType != null; + } + + private static bool TryGetQuantityType(string quantityName, out Type quantityType) + { + quantityType = QuantityTypes.FirstOrDefault(x => x.Name.Equals(quantityName, StringComparison.OrdinalIgnoreCase)); + + return quantityType != null; + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitFormatter.cs b/UnitsNet.WindowsRuntimeComponent/UnitFormatter.cs new file mode 100644 index 0000000000..a60e1ac65c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitFormatter.cs @@ -0,0 +1,99 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; + +namespace UnitsNet +{ + /// + /// Utility class for formatting units and values. + /// + internal static class UnitFormatter + { + /// + /// Gets the default ToString format for the specified value. + /// + /// The value to format. + /// + /// The number of digits after the radix point to display in the formatted + /// string. + /// + /// A ToString format for the specified value. + public static string GetFormat(double value, int significantDigitsAfterRadix) + { + double v = Math.Abs(value); + var sigDigitsAfterRadixStr = new string('#', significantDigitsAfterRadix); + string format; + + if (NearlyEqual(v, 0)) + { + format = "{0} {1}"; + } + // Values below 1e-3 are displayed in scientific notation. + else if (v < 1e-3) + { + format = "{0:0." + sigDigitsAfterRadixStr + "e-00} {1}"; + } + // Values from 1e-3 to 1 use fixed point notation. + else if ((v > 1e-4) && (v < 1)) + { + format = "{0:g" + significantDigitsAfterRadix + "} {1}"; + } + // Values between 1 and 1e5 use fixed point notation with digit grouping. + else if ((v >= 1) && (v < 1e6)) + { + // The comma will be automatically replaced with the correct digit separator if a different culture is used. + format = "{0:#,0." + sigDigitsAfterRadixStr + "} {1}"; + } + // Values above 1e5 use scientific notation. + else + { + format = "{0:0." + sigDigitsAfterRadixStr + "e+00} {1}"; + } + + return format; + } + + private static bool NearlyEqual(double a, double b) + { + return Math.Abs(a - b) < 1e-150; + } + + /// + /// Gets ToString format arguments. + /// + /// The type of units to format. + /// The units + /// The unit value to format. + /// The current culture. + /// The list of format arguments. + /// An array of ToString format arguments. + public static object[] GetFormatArgs(TUnitType unit, double value, [CanBeNull] IFormatProvider culture, IEnumerable args) + where TUnitType : Enum + { + string abbreviation = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), culture); + return new object[] {value, abbreviation}.Concat(args).ToArray(); + } + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs b/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs new file mode 100644 index 0000000000..e1f3f8004a --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs @@ -0,0 +1,80 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using UnitsNet.Units; + +namespace UnitsNet +{ + /// + /// Information about the unit, such as its name and value. + /// This is useful to enumerate units and present names with quantities and units + /// chosen dynamically at runtime, such as unit conversion apps or allowing the user to change the + /// unit representation. + /// + /// + /// Typically you obtain this by looking it up via . + /// +#if WINDOWS_UWP + internal +#else + public +#endif + class UnitInfo + { + public UnitInfo(Enum value) + { + Value = value; + Name = value.ToString(); + } + + /// + /// The enum value of the unit, such as [, + /// , , ...]. + /// + public Enum Value; + + /// + /// The name of the unit, such as ["Centimeter", "Decimeter", "Meter", ...]. + /// + public string Name { get; } + } + +#if !WINDOWS_UWP + /// + /// + /// This is a specialization of , for when the unit type is known. + /// Typically you obtain this by looking it up statically from or + /// or dynamically via . + /// + /// The unit enum type, such as . + public class UnitInfo : UnitInfo + where TUnit : Enum + { + public UnitInfo(TUnit value) : base(value) + { + Value = value; + } + + public new TUnit Value { get; } + } +#endif +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs b/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs new file mode 100644 index 0000000000..02d54f051c --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ + /// + /// Unit was not found. This is typically thrown for dynamic conversions, + /// such as . + /// +#if WINDOWS_UWP + internal +#else + public +#endif + class UnitNotFoundException : UnitsNetException + { + public UnitNotFoundException() + { + } + + public UnitNotFoundException(string message) : base(message) + { + } + + public UnitNotFoundException(string message, Exception innerException) : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs b/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs new file mode 100644 index 0000000000..695626b763 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs @@ -0,0 +1,125 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Text; +using UnitsNet.Units; + +namespace UnitsNet +{ +#if !WINDOWS_UWP + public sealed partial class UnitSystem : IEquatable { } +#endif + + public sealed partial class UnitSystem + { + /// + /// Creates an instance of a unit system with the specified base units. + /// + /// The base units for the unit system. + 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) + throw new ArgumentException("A unit system must have all base units defined.", nameof(baseUnits)); + + BaseUnits = baseUnits; + } + + /// + public override bool Equals(object obj) + { + if(obj is null || !(obj is UnitSystem)) + return false; + + return Equals((UnitSystem)obj); + } + +#if WINDOWS_UWP + [Windows.Foundation.Metadata.DefaultOverload] +#endif + public bool Equals(UnitSystem other) + { + if(other is null) + return false; + + return BaseUnits.Equals(other.BaseUnits); + } + +#if !WINDOWS_UWP + + /// + /// Checks if this instance is equal to another. + /// + /// The left instance. + /// The right instance. + /// True if equal, otherwise false. + /// + public static bool operator ==(UnitSystem left, UnitSystem right) + { + return left is null ? right is null : left.Equals(right); + } + + /// + /// Checks if this instance is equal to another. + /// + /// The left instance. + /// The right instance. + /// True if equal, otherwise false. + /// + public static bool operator !=(UnitSystem left, UnitSystem right) + { + return !(left == right); + } + +#endif + + /// + public override int GetHashCode() + { + return new {BaseUnits}.GetHashCode(); + } + + public BaseUnits BaseUnits{ get; } + + private static readonly BaseUnits SIBaseUnits = new BaseUnits(LengthUnit.Meter, MassUnit.Kilogram, DurationUnit.Second, + ElectricCurrentUnit.Ampere, TemperatureUnit.Kelvin, AmountOfSubstanceUnit.Mole, LuminousIntensityUnit.Candela); + + /// + /// Gets the SI unit system. + /// + public static UnitSystem SI{ get; } = new UnitSystem(SIBaseUnits); + } +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj b/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj index e34d1d23a3..289c256d98 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj +++ b/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj @@ -104,21 +104,11 @@ PackageReference - + - - - + + Common\%(RecursiveDir)%(Filename)%(Extension) - - - Common\%(RecursiveDir)%(Filename)%(Extension) - - - UnitsNet\%(RecursiveDir)%(Filename)%(Extension) - - - UnitsNet\Scripts\%(RecursiveDir)%(Filename)%(Extension) diff --git a/UnitsNet.WindowsRuntimeComponent/UnitsNet.csproj b/UnitsNet.WindowsRuntimeComponent/UnitsNet.csproj new file mode 100644 index 0000000000..21a2e21417 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitsNet.csproj @@ -0,0 +1,61 @@ + + + + UnitsNet + 4.7.0 + Andreas Gullberg Larsen + Units.NET + Get all the common units of measurement and the conversions between them. It is light-weight and thoroughly tested. + Copyright (c) 2013 Andreas Gullberg Larsen + true + https://github.com/angularsen/UnitsNet + https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png + https://github.com/angularsen/UnitsNet + https://github.com/angularsen/UnitsNet/blob/master/LICENSE + false + unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable + + + + + 4.0.0.0 + 7.3 + CS1701;CS1702;CS1705;CS0618;CS0809;CS1591 + UnitsNet + netstandard2.0;net40 + + + + + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + + + ../UnitsNet.snk + false + true + UnitsNet + + + + + + + + + + + + + Common\%(RecursiveDir)%(Filename)%(Extension) + + + + + + + + diff --git a/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs b/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs new file mode 100644 index 0000000000..44d47ba6e0 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ +#if WINDOWS_UWP + internal +#else + public +#endif + class UnitsNetException : Exception + { + public UnitsNetException() + { + HResult = 1; + } + + public UnitsNetException(string message) : base(message) + { + HResult = 1; + } + + public UnitsNetException(string message, Exception innerException) : base(message, innerException) + { + HResult = 1; + } + } +} \ No newline at end of file From aca2a3d9b49f9a7ad9dcd70e260b6f167478c750 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Tue, 12 Feb 2019 22:35:23 +0100 Subject: [PATCH 02/10] Simplify WRC scripts --- .../Acceleration.WindowsRuntimeComponent.g.cs | 6 +- ...ntOfSubstance.WindowsRuntimeComponent.g.cs | 6 +- ...mplitudeRatio.WindowsRuntimeComponent.g.cs | 6 +- .../Angle.WindowsRuntimeComponent.g.cs | 6 +- ...pparentEnergy.WindowsRuntimeComponent.g.cs | 6 +- ...ApparentPower.WindowsRuntimeComponent.g.cs | 6 +- .../Area.WindowsRuntimeComponent.g.cs | 6 +- .../AreaDensity.WindowsRuntimeComponent.g.cs | 6 +- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 6 +- .../BitRate.WindowsRuntimeComponent.g.cs | 6 +- ...elConsumption.WindowsRuntimeComponent.g.cs | 6 +- .../Capacitance.WindowsRuntimeComponent.g.cs | 6 +- ...rmalExpansion.WindowsRuntimeComponent.g.cs | 6 +- .../Density.WindowsRuntimeComponent.g.cs | 6 +- .../Duration.WindowsRuntimeComponent.g.cs | 6 +- ...amicViscosity.WindowsRuntimeComponent.g.cs | 6 +- ...ricAdmittance.WindowsRuntimeComponent.g.cs | 6 +- ...lectricCharge.WindowsRuntimeComponent.g.cs | 6 +- ...ChargeDensity.WindowsRuntimeComponent.g.cs | 6 +- ...icConductance.WindowsRuntimeComponent.g.cs | 6 +- ...cConductivity.WindowsRuntimeComponent.g.cs | 6 +- ...ectricCurrent.WindowsRuntimeComponent.g.cs | 6 +- ...urrentDensity.WindowsRuntimeComponent.g.cs | 6 +- ...rrentGradient.WindowsRuntimeComponent.g.cs | 6 +- ...ElectricField.WindowsRuntimeComponent.g.cs | 6 +- ...ricInductance.WindowsRuntimeComponent.g.cs | 6 +- ...tricPotential.WindowsRuntimeComponent.g.cs | 6 +- ...icPotentialAc.WindowsRuntimeComponent.g.cs | 6 +- ...icPotentialDc.WindowsRuntimeComponent.g.cs | 6 +- ...ricResistance.WindowsRuntimeComponent.g.cs | 6 +- ...icResistivity.WindowsRuntimeComponent.g.cs | 6 +- .../Energy.WindowsRuntimeComponent.g.cs | 6 +- .../Entropy.WindowsRuntimeComponent.g.cs | 6 +- .../Force.WindowsRuntimeComponent.g.cs | 6 +- ...rceChangeRate.WindowsRuntimeComponent.g.cs | 6 +- ...orcePerLength.WindowsRuntimeComponent.g.cs | 6 +- .../Frequency.WindowsRuntimeComponent.g.cs | 6 +- .../HeatFlux.WindowsRuntimeComponent.g.cs | 6 +- ...erCoefficient.WindowsRuntimeComponent.g.cs | 6 +- .../Illuminance.WindowsRuntimeComponent.g.cs | 6 +- .../Information.WindowsRuntimeComponent.g.cs | 6 +- .../Irradiance.WindowsRuntimeComponent.g.cs | 6 +- .../Irradiation.WindowsRuntimeComponent.g.cs | 6 +- ...aticViscosity.WindowsRuntimeComponent.g.cs | 6 +- .../LapseRate.WindowsRuntimeComponent.g.cs | 6 +- .../Length.WindowsRuntimeComponent.g.cs | 6 +- .../Level.WindowsRuntimeComponent.g.cs | 6 +- ...LinearDensity.WindowsRuntimeComponent.g.cs | 6 +- .../LuminousFlux.WindowsRuntimeComponent.g.cs | 6 +- ...nousIntensity.WindowsRuntimeComponent.g.cs | 6 +- ...MagneticField.WindowsRuntimeComponent.g.cs | 6 +- .../MagneticFlux.WindowsRuntimeComponent.g.cs | 6 +- ...Magnetization.WindowsRuntimeComponent.g.cs | 6 +- .../Mass.WindowsRuntimeComponent.g.cs | 6 +- .../MassFlow.WindowsRuntimeComponent.g.cs | 6 +- .../MassFlux.WindowsRuntimeComponent.g.cs | 6 +- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 6 +- .../MolarEnergy.WindowsRuntimeComponent.g.cs | 6 +- .../MolarEntropy.WindowsRuntimeComponent.g.cs | 6 +- .../MolarMass.WindowsRuntimeComponent.g.cs | 6 +- .../Molarity.WindowsRuntimeComponent.g.cs | 6 +- .../Permeability.WindowsRuntimeComponent.g.cs | 6 +- .../Permittivity.WindowsRuntimeComponent.g.cs | 6 +- .../Power.WindowsRuntimeComponent.g.cs | 6 +- .../PowerDensity.WindowsRuntimeComponent.g.cs | 6 +- .../PowerRatio.WindowsRuntimeComponent.g.cs | 6 +- .../Pressure.WindowsRuntimeComponent.g.cs | 6 +- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 6 +- .../Ratio.WindowsRuntimeComponent.g.cs | 6 +- ...eactiveEnergy.WindowsRuntimeComponent.g.cs | 6 +- ...ReactivePower.WindowsRuntimeComponent.g.cs | 6 +- ...lAcceleration.WindowsRuntimeComponent.g.cs | 6 +- ...tationalSpeed.WindowsRuntimeComponent.g.cs | 6 +- ...onalStiffness.WindowsRuntimeComponent.g.cs | 6 +- ...nessPerLength.WindowsRuntimeComponent.g.cs | 6 +- .../SolidAngle.WindowsRuntimeComponent.g.cs | 6 +- ...pecificEnergy.WindowsRuntimeComponent.g.cs | 6 +- ...ecificEntropy.WindowsRuntimeComponent.g.cs | 6 +- ...pecificVolume.WindowsRuntimeComponent.g.cs | 6 +- ...pecificWeight.WindowsRuntimeComponent.g.cs | 6 +- .../Speed.WindowsRuntimeComponent.g.cs | 6 +- .../Temperature.WindowsRuntimeComponent.g.cs | 6 +- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 6 +- ...peratureDelta.WindowsRuntimeComponent.g.cs | 6 +- ...lConductivity.WindowsRuntimeComponent.g.cs | 6 +- ...malResistance.WindowsRuntimeComponent.g.cs | 6 +- .../Torque.WindowsRuntimeComponent.g.cs | 6 +- .../VitaminA.WindowsRuntimeComponent.g.cs | 6 +- .../Volume.WindowsRuntimeComponent.g.cs | 6 +- .../VolumeFlow.WindowsRuntimeComponent.g.cs | 6 +- .../GeneratedCode/Quantity.g.cs | 76 +--- .../Scripts/GenerateUnits.ps1 | 11 +- .../Include-GenerateQuantitySourceCode.ps1 | 420 +----------------- ...clude-GenerateStaticQuantitySourceCode.ps1 | 76 +--- .../Scripts/Types.psm1 | 7 + 95 files changed, 401 insertions(+), 729 deletions(-) diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs index 0b48b82a64..5a24b4703d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Acceleration() BaseDimensions = new BaseDimensions(1, 0, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Acceleration, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit MeterPerSecondSquared. /// @@ -99,7 +100,9 @@ private Acceleration(double numericValue, AccelerationUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -795,6 +798,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs index eb9aa4a03a..74eaf49233 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static AmountOfSubstance() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 1, 0); Info = new QuantityInfo(QuantityType.AmountOfSubstance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Mole. /// @@ -99,7 +100,9 @@ private AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -829,6 +832,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs index 4396eb6ed2..6fedad2667 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static AmplitudeRatio() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.AmplitudeRatio, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit DecibelVolt. /// @@ -99,7 +100,9 @@ private AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -642,6 +645,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs index 2a5fede07e..0a7b132b6a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Angle() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.Angle, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Degree. /// @@ -99,7 +100,9 @@ private Angle(double numericValue, AngleUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -812,6 +815,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs index 0a663cc9c7..02491d430c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ApparentEnergy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ApparentEnergy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltampereHour. /// @@ -99,7 +100,9 @@ private ApparentEnergy(double numericValue, ApparentEnergyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs index 5b2fd06362..736c4a799a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ApparentPower() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ApparentPower, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Voltampere. /// @@ -99,7 +100,9 @@ private ApparentPower(double numericValue, ApparentPowerUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -642,6 +645,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs index 01d9877599..5ea87fb206 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Area() BaseDimensions = new BaseDimensions(2, 0, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Area, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit SquareMeter. /// @@ -99,7 +100,9 @@ private Area(double numericValue, AreaUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -795,6 +798,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs index 72377de386..3614a5d136 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static AreaDensity() BaseDimensions = new BaseDimensions(-2, 1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.AreaDensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerSquareMeter. /// @@ -99,7 +100,9 @@ private AreaDensity(double numericValue, AreaDensityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -591,6 +594,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs index 7cc39c406e..88d37ff555 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static AreaMomentOfInertia() BaseDimensions = new BaseDimensions(4, 0, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.AreaMomentOfInertia, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit MeterToTheFourth. /// @@ -99,7 +100,9 @@ private AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -676,6 +679,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs index 9e067b1b77..34257f37d1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static BitRate() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.BitRate, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit BitPerSecond. /// @@ -102,7 +103,9 @@ private BitRate(decimal numericValue, BitRateUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1019,6 +1022,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs index 09376e7a3f..3dbfb0e34f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static BrakeSpecificFuelConsumption() BaseDimensions = new BaseDimensions(-2, 0, 2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.BrakeSpecificFuelConsumption, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerJoule. /// @@ -99,7 +100,9 @@ private BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsu #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs index 19350ebd21..6117f22269 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Capacitance() BaseDimensions = new BaseDimensions(-2, -1, 4, 2, 0, 0, 0); Info = new QuantityInfo(QuantityType.Capacitance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Farad. /// @@ -102,7 +103,9 @@ private Capacitance(double numericValue, CapacitanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -696,6 +699,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs index 1fbb4153a8..1c20fbc596 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static CoefficientOfThermalExpansion() BaseDimensions = new BaseDimensions(0, 0, 0, 0, -1, 0, 0); Info = new QuantityInfo(QuantityType.CoefficientOfThermalExpansion, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit InverseKelvin. /// @@ -99,7 +100,9 @@ private CoefficientOfThermalExpansion(double numericValue, CoefficientOfThermalE #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs index 8ba926ec29..77734f6274 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Density() BaseDimensions = new BaseDimensions(-3, 1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Density, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerCubicMeter. /// @@ -102,7 +103,9 @@ private Density(double numericValue, DensityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1240,6 +1243,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs index eb5bad33ee..8a314fcdaa 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Duration() BaseDimensions = new BaseDimensions(0, 0, 1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Duration, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Second. /// @@ -99,7 +100,9 @@ private Duration(double numericValue, DurationUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -744,6 +747,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs index 5b89ed3274..a1c3056e66 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static DynamicViscosity() BaseDimensions = new BaseDimensions(-1, 1, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.DynamicViscosity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonSecondPerMeterSquared. /// @@ -102,7 +103,9 @@ private DynamicViscosity(double numericValue, DynamicViscosityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -679,6 +682,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs index af5658697e..d9450f3c66 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricAdmittance() BaseDimensions = new BaseDimensions(-2, -1, 3, 2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricAdmittance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Siemens. /// @@ -99,7 +100,9 @@ private ElectricAdmittance(double numericValue, ElectricAdmittanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -642,6 +645,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs index 3f7522be08..dac584fb59 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricCharge() BaseDimensions = new BaseDimensions(0, 0, 1, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricCharge, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Coulomb. /// @@ -102,7 +103,9 @@ private ElectricCharge(double numericValue, ElectricChargeUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs index 677e7b5793..8ec2b6148b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricChargeDensity() BaseDimensions = new BaseDimensions(-3, 0, 1, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricChargeDensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit CoulombPerCubicMeter. /// @@ -102,7 +103,9 @@ private ElectricChargeDensity(double numericValue, ElectricChargeDensityUnit uni #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs index 393f74ca49..3b7cb40c27 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricConductance() BaseDimensions = new BaseDimensions(-2, -1, 3, 2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricConductance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Siemens. /// @@ -102,7 +103,9 @@ private ElectricConductance(double numericValue, ElectricConductanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -628,6 +631,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs index 6a81fc4ff6..cb1b3d25c0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricConductivity() BaseDimensions = new BaseDimensions(-3, -1, 3, 2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricConductivity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit SiemensPerMeter. /// @@ -102,7 +103,9 @@ private ElectricConductivity(double numericValue, ElectricConductivityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs index 83f4fae91b..81a13b19de 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricCurrent() BaseDimensions = new BaseDimensions(0, 0, 0, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricCurrent, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Ampere. /// @@ -99,7 +100,9 @@ private ElectricCurrent(double numericValue, ElectricCurrentUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -710,6 +713,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs index 277d4171ea..29294a8f7d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricCurrentDensity() BaseDimensions = new BaseDimensions(-2, 0, 0, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricCurrentDensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit AmperePerSquareMeter. /// @@ -102,7 +103,9 @@ private ElectricCurrentDensity(double numericValue, ElectricCurrentDensityUnit u #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs index 35a55382d1..1c3272bf3e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricCurrentGradient() BaseDimensions = new BaseDimensions(0, 0, -1, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricCurrentGradient, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit AmperePerSecond. /// @@ -99,7 +100,9 @@ private ElectricCurrentGradient(double numericValue, ElectricCurrentGradientUnit #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -591,6 +594,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs index 4db1c0c461..e9ab0ab2d3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricField() BaseDimensions = new BaseDimensions(1, 1, -3, -1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricField, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltPerMeter. /// @@ -102,7 +103,9 @@ private ElectricField(double numericValue, ElectricFieldUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs index b8cefc2351..54098c0ef0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricInductance() BaseDimensions = new BaseDimensions(2, 1, -2, -2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricInductance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Henry. /// @@ -102,7 +103,9 @@ private ElectricInductance(double numericValue, ElectricInductanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -645,6 +648,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs index 0412078540..415273724a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricPotential() BaseDimensions = new BaseDimensions(2, 1, -3, -1, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricPotential, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Volt. /// @@ -99,7 +100,9 @@ private ElectricPotential(double numericValue, ElectricPotentialUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -659,6 +662,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs index f901f1a3b6..752a911dde 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricPotentialAc() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.ElectricPotentialAc, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltAc. /// @@ -99,7 +100,9 @@ private ElectricPotentialAc(double numericValue, ElectricPotentialAcUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -659,6 +662,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs index ec8d625a26..4d65a756af 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricPotentialDc() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.ElectricPotentialDc, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltDc. /// @@ -99,7 +100,9 @@ private ElectricPotentialDc(double numericValue, ElectricPotentialDcUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -659,6 +662,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs index 1c965c6e3a..50cabb6dc6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ElectricResistance() BaseDimensions = new BaseDimensions(2, 1, -3, -2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricResistance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Ohm. /// @@ -99,7 +100,9 @@ private ElectricResistance(double numericValue, ElectricResistanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -659,6 +662,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs index b69f75ca5c..3f0fe305d9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ElectricResistivity() BaseDimensions = new BaseDimensions(3, 1, -3, -2, 0, 0, 0); Info = new QuantityInfo(QuantityType.ElectricResistivity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit OhmMeter. /// @@ -102,7 +103,9 @@ private ElectricResistivity(double numericValue, ElectricResistivityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -815,6 +818,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs index 852a460b2c..d38f87ac85 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Energy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Energy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Joule. /// @@ -99,7 +100,9 @@ private Energy(double numericValue, EnergyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -948,6 +951,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs index 4fd99c5cf8..e8dd884929 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Entropy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, -1, 0, 0); Info = new QuantityInfo(QuantityType.Entropy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerKelvin. /// @@ -99,7 +100,9 @@ private Entropy(double numericValue, EntropyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -693,6 +696,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs index 4773b8cd0c..5d50e9b6a2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Force() BaseDimensions = new BaseDimensions(1, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Force, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Newton. /// @@ -99,7 +100,9 @@ private Force(double numericValue, ForceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -795,6 +798,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs index 2cc261c606..5e12e1bceb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ForceChangeRate() BaseDimensions = new BaseDimensions(1, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ForceChangeRate, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonPerSecond. /// @@ -99,7 +100,9 @@ private ForceChangeRate(double numericValue, ForceChangeRateUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -761,6 +764,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs index 7bebb1665d..7034620f92 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ForcePerLength() BaseDimensions = new BaseDimensions(0, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ForcePerLength, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonPerMeter. /// @@ -99,7 +100,9 @@ private ForcePerLength(double numericValue, ForcePerLengthUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -727,6 +730,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs index 16ca9af971..7e3dfa3d5d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Frequency() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Frequency, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Hertz. /// @@ -99,7 +100,9 @@ private Frequency(double numericValue, FrequencyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -710,6 +713,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs index 7e640396ee..1ba40d0a98 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static HeatFlux() BaseDimensions = new BaseDimensions(0, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.HeatFlux, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit WattPerSquareMeter. /// @@ -99,7 +100,9 @@ private HeatFlux(double numericValue, HeatFluxUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -880,6 +883,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs index c1ca7f2a0c..ce2d7b1062 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static HeatTransferCoefficient() BaseDimensions = new BaseDimensions(0, 1, -3, 0, -1, 0, 0); Info = new QuantityInfo(QuantityType.HeatTransferCoefficient, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit WattPerSquareMeterKelvin. /// @@ -99,7 +100,9 @@ private HeatTransferCoefficient(double numericValue, HeatTransferCoefficientUnit #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -608,6 +611,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs index 44efaf6512..2d348c5a85 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Illuminance() BaseDimensions = new BaseDimensions(-2, 0, 0, 0, 0, 0, 1); Info = new QuantityInfo(QuantityType.Illuminance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Lux. /// @@ -102,7 +103,9 @@ private Illuminance(double numericValue, IlluminanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -645,6 +648,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs index 3c7d98c725..b126d0a891 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Information() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.Information, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Bit. /// @@ -99,7 +100,9 @@ private Information(decimal numericValue, InformationUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1016,6 +1019,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs index 2f290af815..7979bab277 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Irradiance() BaseDimensions = new BaseDimensions(0, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Irradiance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit WattPerSquareMeter. /// @@ -99,7 +100,9 @@ private Irradiance(double numericValue, IrradianceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -812,6 +815,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs index 166bfbc21f..3b6ed5fc78 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Irradiation() BaseDimensions = new BaseDimensions(0, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Irradiation, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerSquareMeter. /// @@ -102,7 +103,9 @@ private Irradiation(double numericValue, IrradiationUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -645,6 +648,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs index e153941180..47eb862708 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static KinematicViscosity() BaseDimensions = new BaseDimensions(2, 0, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.KinematicViscosity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit SquareMeterPerSecond. /// @@ -102,7 +103,9 @@ private KinematicViscosity(double numericValue, KinematicViscosityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -713,6 +716,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs index 64078ae75f..e648c2f4b9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static LapseRate() BaseDimensions = new BaseDimensions(-1, 0, 0, 0, 1, 0, 0); Info = new QuantityInfo(QuantityType.LapseRate, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit DegreeCelsiusPerKilometer. /// @@ -99,7 +100,9 @@ private LapseRate(double numericValue, LapseRateUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -591,6 +594,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs index ef1a78d95e..bbd0efe6d5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Length() BaseDimensions = new BaseDimensions(1, 0, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Length, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Meter. /// @@ -99,7 +100,9 @@ private Length(double numericValue, LengthUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -948,6 +951,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs index fa5c031591..9a40f7bd34 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Level() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.Level, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Decibel. /// @@ -99,7 +100,9 @@ private Level(double numericValue, LevelUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -608,6 +611,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs index eb637e4b78..370733f4d1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static LinearDensity() BaseDimensions = new BaseDimensions(-1, 1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.LinearDensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerMeter. /// @@ -102,7 +103,9 @@ private LinearDensity(double numericValue, LinearDensityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -628,6 +631,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs index 8257d8eb6b..551ebd8d77 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static LuminousFlux() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 0, 1); Info = new QuantityInfo(QuantityType.LuminousFlux, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Lumen. /// @@ -102,7 +103,9 @@ private LuminousFlux(double numericValue, LuminousFluxUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs index 18bae845cb..d19b219fd6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static LuminousIntensity() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 0, 1); Info = new QuantityInfo(QuantityType.LuminousIntensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Candela. /// @@ -102,7 +103,9 @@ private LuminousIntensity(double numericValue, LuminousIntensityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs index ea3b10d430..09052e2e29 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static MagneticField() BaseDimensions = new BaseDimensions(0, 1, -2, -1, 0, 0, 0); Info = new QuantityInfo(QuantityType.MagneticField, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Tesla. /// @@ -102,7 +103,9 @@ private MagneticField(double numericValue, MagneticFieldUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -645,6 +648,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs index 22743be9fb..4372595051 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static MagneticFlux() BaseDimensions = new BaseDimensions(2, 1, -2, -1, 0, 0, 0); Info = new QuantityInfo(QuantityType.MagneticFlux, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Weber. /// @@ -102,7 +103,9 @@ private MagneticFlux(double numericValue, MagneticFluxUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs index b85d884124..078e302592 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Magnetization() BaseDimensions = new BaseDimensions(-1, 0, 0, 1, 0, 0, 0); Info = new QuantityInfo(QuantityType.Magnetization, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit AmperePerMeter. /// @@ -102,7 +103,9 @@ private Magnetization(double numericValue, MagnetizationUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs index 80a859b5ee..8e295f87b6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Mass() BaseDimensions = new BaseDimensions(0, 1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Mass, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Kilogram. /// @@ -99,7 +100,9 @@ private Mass(double numericValue, MassUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -965,6 +968,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs index 4b87aef143..3b48009c6a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MassFlow() BaseDimensions = new BaseDimensions(0, 1, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.MassFlow, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit GramPerSecond. /// @@ -99,7 +100,9 @@ private MassFlow(double numericValue, MassFlowUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1101,6 +1104,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs index a2fb3037f9..1caa1bc475 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MassFlux() BaseDimensions = new BaseDimensions(-2, 1, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.MassFlux, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerSecondPerSquareMeter. /// @@ -99,7 +100,9 @@ private MassFlux(double numericValue, MassFluxUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -608,6 +611,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs index 7decc8e3d7..7ec0e91b52 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MassMomentOfInertia() BaseDimensions = new BaseDimensions(2, 1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.MassMomentOfInertia, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramSquareMeter. /// @@ -99,7 +100,9 @@ private MassMomentOfInertia(double numericValue, MassMomentOfInertiaUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1050,6 +1053,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs index ee197564ca..8641fcb30d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MolarEnergy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, -1, 0); Info = new QuantityInfo(QuantityType.MolarEnergy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerMole. /// @@ -99,7 +100,9 @@ private MolarEnergy(double numericValue, MolarEnergyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs index 134825c7dc..434a0e5a3b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MolarEntropy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, -1, -1, 0); Info = new QuantityInfo(QuantityType.MolarEntropy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerMoleKelvin. /// @@ -99,7 +100,9 @@ private MolarEntropy(double numericValue, MolarEntropyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs index 69026880c9..5cc8d75f8c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static MolarMass() BaseDimensions = new BaseDimensions(0, 1, 0, 0, 0, -1, 0); Info = new QuantityInfo(QuantityType.MolarMass, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit KilogramPerMole. /// @@ -99,7 +100,9 @@ private MolarMass(double numericValue, MolarMassUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -778,6 +781,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs index a039ebcbb6..108a8baa44 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Molarity() BaseDimensions = new BaseDimensions(-3, 0, 0, 0, 0, 1, 0); Info = new QuantityInfo(QuantityType.Molarity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit MolesPerCubicMeter. /// @@ -102,7 +103,9 @@ private Molarity(double numericValue, MolarityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -713,6 +716,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs index d26f45e3e6..56507756de 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Permeability() BaseDimensions = new BaseDimensions(1, 1, -2, -2, 0, 0, 0); Info = new QuantityInfo(QuantityType.Permeability, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit HenryPerMeter. /// @@ -102,7 +103,9 @@ private Permeability(double numericValue, PermeabilityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs index d88072a559..2e361a2ad3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static Permittivity() BaseDimensions = new BaseDimensions(-3, -1, 4, 2, 0, 0, 0); Info = new QuantityInfo(QuantityType.Permittivity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit FaradPerMeter. /// @@ -102,7 +103,9 @@ private Permittivity(double numericValue, PermittivityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs index 76dba7d04c..50313b5782 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Power() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Power, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Watt. /// @@ -99,7 +100,9 @@ private Power(decimal numericValue, PowerUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -914,6 +917,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs index c2640cd503..358deae752 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static PowerDensity() BaseDimensions = new BaseDimensions(-1, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.PowerDensity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit WattPerCubicMeter. /// @@ -99,7 +100,9 @@ private PowerDensity(double numericValue, PowerDensityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1322,6 +1325,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs index 5a30339e20..ed0be5510a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static PowerRatio() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.PowerRatio, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit DecibelWatt. /// @@ -99,7 +100,9 @@ private PowerRatio(double numericValue, PowerRatioUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -608,6 +611,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs index 84585b4ed7..6dbddf414a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Pressure() BaseDimensions = new BaseDimensions(-1, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Pressure, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Pascal. /// @@ -99,7 +100,9 @@ private Pressure(double numericValue, PressureUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1288,6 +1291,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs index 91e75ee189..9c4fba55e7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static PressureChangeRate() BaseDimensions = new BaseDimensions(-1, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.PressureChangeRate, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit PascalPerSecond. /// @@ -99,7 +100,9 @@ private PressureChangeRate(double numericValue, PressureChangeRateUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -693,6 +696,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs index 77e7cea74e..480a34149a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Ratio() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.Ratio, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit DecimalFraction. /// @@ -99,7 +100,9 @@ private Ratio(double numericValue, RatioUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -676,6 +679,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs index 7896f79761..efcfef5915 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ReactiveEnergy() BaseDimensions = new BaseDimensions(2, 1, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ReactiveEnergy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltampereReactiveHour. /// @@ -99,7 +100,9 @@ private ReactiveEnergy(double numericValue, ReactiveEnergyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs index 5162418ae7..803808fa59 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ReactivePower() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.ReactivePower, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit VoltampereReactive. /// @@ -99,7 +100,9 @@ private ReactivePower(double numericValue, ReactivePowerUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -642,6 +645,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs index 021bd61e94..bb92fc4740 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static RotationalAcceleration() BaseDimensions = new BaseDimensions(0, 0, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.RotationalAcceleration, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit RadianPerSecondSquared. /// @@ -99,7 +100,9 @@ private RotationalAcceleration(double numericValue, RotationalAccelerationUnit u #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs index c33960d549..0865dfdc24 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static RotationalSpeed() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.RotationalSpeed, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit RadianPerSecond. /// @@ -99,7 +100,9 @@ private RotationalSpeed(double numericValue, RotationalSpeedUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -795,6 +798,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs index e400d96e5a..cc66f37871 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static RotationalStiffness() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.RotationalStiffness, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonMeterPerRadian. /// @@ -99,7 +100,9 @@ private RotationalStiffness(double numericValue, RotationalStiffnessUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs index e7529cbe73..d4aaa2b1e4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static RotationalStiffnessPerLength() BaseDimensions = new BaseDimensions(1, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.RotationalStiffnessPerLength, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonMeterPerRadianPerMeter. /// @@ -99,7 +100,9 @@ private RotationalStiffnessPerLength(double numericValue, RotationalStiffnessPer #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs index fd58f9f553..c51d3bbcdb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static SolidAngle() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.SolidAngle, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Steradian. /// @@ -102,7 +103,9 @@ private SolidAngle(double numericValue, SolidAngleUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -594,6 +597,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs index c5226d4c0a..81f010a799 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static SpecificEnergy() BaseDimensions = new BaseDimensions(2, 0, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.SpecificEnergy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerKilogram. /// @@ -102,7 +103,9 @@ private SpecificEnergy(double numericValue, SpecificEnergyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -730,6 +733,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs index cb3d8e99f5..2205433759 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static SpecificEntropy() BaseDimensions = new BaseDimensions(2, 0, -2, 0, -1, 0, 0); Info = new QuantityInfo(QuantityType.SpecificEntropy, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit JoulePerKilogramKelvin. /// @@ -99,7 +100,9 @@ private SpecificEntropy(double numericValue, SpecificEntropyUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -710,6 +713,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs index 5f2eb15de4..c85bffa702 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static SpecificVolume() BaseDimensions = new BaseDimensions(3, -1, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.SpecificVolume, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit CubicMeterPerKilogram. /// @@ -99,7 +100,9 @@ private SpecificVolume(double numericValue, SpecificVolumeUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -625,6 +628,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs index 6286f64b06..9b57b4fbb3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static SpecificWeight() BaseDimensions = new BaseDimensions(-2, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.SpecificWeight, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonPerCubicMeter. /// @@ -102,7 +103,9 @@ private SpecificWeight(double numericValue, SpecificWeightUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -866,6 +869,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs index 2e2ce86e8d..8c898e219a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Speed() BaseDimensions = new BaseDimensions(1, 0, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Speed, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit MeterPerSecond. /// @@ -99,7 +100,9 @@ private Speed(double numericValue, SpeedUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1118,6 +1121,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs index fd897ebd46..5440295b68 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Temperature() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 1, 0, 0); Info = new QuantityInfo(QuantityType.Temperature, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Kelvin. /// @@ -99,7 +100,9 @@ private Temperature(double numericValue, TemperatureUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -710,6 +713,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs index 7dcc4b1697..ce7658ea09 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static TemperatureChangeRate() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 1, 0, 0); Info = new QuantityInfo(QuantityType.TemperatureChangeRate, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit DegreeCelsiusPerSecond. /// @@ -99,7 +100,9 @@ private TemperatureChangeRate(double numericValue, TemperatureChangeRateUnit uni #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -744,6 +747,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs index 1b411e8fd8..edee17d7c2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static TemperatureDelta() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.TemperatureDelta, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit Kelvin. /// @@ -99,7 +100,9 @@ private TemperatureDelta(double numericValue, TemperatureDeltaUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -710,6 +713,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs index 4d62726a59..4c48dd1fba 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs @@ -72,6 +72,7 @@ static ThermalConductivity() BaseDimensions = new BaseDimensions(1, 1, -3, 0, -1, 0, 0); Info = new QuantityInfo(QuantityType.ThermalConductivity, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit WattPerMeterKelvin. /// @@ -102,7 +103,9 @@ private ThermalConductivity(double numericValue, ThermalConductivityUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -611,6 +614,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs index d228c1d3b4..899966dbf7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static ThermalResistance() BaseDimensions = new BaseDimensions(0, -1, 3, 0, 1, 0, 0); Info = new QuantityInfo(QuantityType.ThermalResistance, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit SquareMeterKelvinPerKilowatt. /// @@ -99,7 +100,9 @@ private ThermalResistance(double numericValue, ThermalResistanceUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -659,6 +662,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs index f5b92a8353..5aeab4ed37 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Torque() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Torque, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit NewtonMeter. /// @@ -99,7 +100,9 @@ private Torque(double numericValue, TorqueUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -931,6 +934,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs index 9180239736..7bedea0e13 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static VitaminA() BaseDimensions = BaseDimensions.Dimensionless; Info = new QuantityInfo(QuantityType.VitaminA, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit InternationalUnit. /// @@ -99,7 +100,9 @@ private VitaminA(double numericValue, VitaminAUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -591,6 +594,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs index 94301a8c88..3ddd7240cc 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static Volume() BaseDimensions = new BaseDimensions(3, 0, 0, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.Volume, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit CubicMeter. /// @@ -99,7 +100,9 @@ private Volume(double numericValue, VolumeUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1339,6 +1342,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs index 8a54351818..e8192ec645 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs @@ -69,6 +69,7 @@ static VolumeFlow() BaseDimensions = new BaseDimensions(3, 0, -1, 0, 0, 0, 0); Info = new QuantityInfo(QuantityType.VolumeFlow, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } + /// /// Creates the quantity with a value of 0 in the base unit CubicMeterPerSecond. /// @@ -99,7 +100,9 @@ private VolumeFlow(double numericValue, VolumeFlowUnit unit) #region Static Properties - /// + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } /// @@ -1390,6 +1393,5 @@ private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] stri { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } - } } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs index 932a5b6975..dccbd7cc22 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantity.g.cs @@ -41,40 +41,13 @@ using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using FromValue = System.Double; -#else -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Dynamically parse or construct quantities when types are only known at runtime. /// -#if WINDOWS_UWP - internal -#else - public -#endif - static partial class Quantity + internal static partial class Quantity { -#if !WINDOWS_UWP - /// - public static bool TryFrom(double value, Enum unit, out IQuantity quantity) - { - // Implicit cast to FromValue would prevent TryFrom from being called, - // so we need to explicitly check this here for double arguments. - if (double.IsNaN(value) || double.IsInfinity(value)) - { - quantity = default(IQuantity); - return false; - } - - return TryFrom((FromValue) value, unit, out quantity); - } -#endif - /// /// Try to dynamically construct a quantity. /// @@ -82,12 +55,7 @@ public static bool TryFrom(double value, Enum unit, out IQuantity quantity) /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + internal static bool TryFrom(double value, Enum unit, out IQuantity quantity) { switch (unit) { @@ -370,12 +338,7 @@ static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + internal static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); /// /// Dynamically parse a quantity string representation. @@ -385,12 +348,7 @@ static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + internal static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) { if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); @@ -401,12 +359,7 @@ static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantity } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + internal static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => TryParse(null, quantityType, quantityString, out quantity); /// @@ -417,12 +370,7 @@ static bool TryParse(Type quantityType, string quantityString, out IQuantity qua /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. /// The parsed quantity. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + internal static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) { quantity = default(IQuantity); @@ -704,17 +652,5 @@ static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityTy throw new ArgumentException( $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); } - -#if !WINDOWS_UWP - /// - /// Get information about the given quantity type. - /// - /// The quantity type enum value. - /// Information about the quantity and its units. - public static QuantityInfo GetInfo(QuantityType quantityType) - { - return Infos.First(qi => qi.QuantityType == quantityType); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 index 56191e7025..d4531df071 100644 --- a/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/GenerateUnits.ps1 @@ -18,15 +18,10 @@ function ValueOrDefault($value, $defaultValue){ function GenerateQuantity([Quantity]$quantity, $outDir) { - $outFileName = "$outDir/$($quantity.Name).NetFramework.g.cs" - GenerateQuantitySourceCode $quantity "NetFramework" | Out-File -Encoding "UTF8" $outFileName | Out-Null + $outFileName = "$outDir/$($quantity.Name).WindowsRuntimeComponent.g.cs" + GenerateQuantitySourceCode $quantity | Out-File -Encoding "UTF8" $outFileName | Out-Null if (!$?) { exit 1 } - Write-Host -NoNewline "quantity .NET(OK) " - - $outFileName = "$outDir/../../../UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/$($quantity.Name).WindowsRuntimeComponent.g.cs" - GenerateQuantitySourceCode $quantity "WindowsRuntimeComponent" | Out-File -Encoding "UTF8" $outFileName | Out-Null - if (!$?) { exit 1 } - Write-Host -NoNewline "quantity WRC(OK) " + Write-Host -NoNewline "quantity(OK) " } function GenerateUnitTestBaseClass([Quantity]$quantity, $outDir) diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 index f46760bcf8..7a89c6fb71 100644 --- a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -1,35 +1,21 @@ using module ".\Types.psm1" -class GeneratorArgs -{ - [Quantity]$Quantity - [Unit]$BaseUnit - [string]$UnitEnumName - [boolean]$TargetIsWindowsRuntimeComponent -} - -function GenerateQuantitySourceCode([Quantity]$quantity, [string]$target) +function GenerateQuantitySourceCode([Quantity]$quantity) { $quantityName = $quantity.Name; $units = $quantity.Units; $valueType = $quantity.BaseType; [Unit]$baseUnit = $units | where { $_.SingularName -eq $quantity.BaseUnit } | Select-Object -First 1 $baseUnitSingularName = $baseUnit.SingularName - $baseUnitPluralName = $baseUnit.PluralName $unitEnumName = "$quantityName" + "Unit" - $wrc = $target -eq "WindowsRuntimeComponent" - $privateAccessModifierIfWrc = if ($wrc) { "private" } else { "public" } - $accessModifier = if ($wrc) { "internal" } else { "public" } - $enumOrObject = if ($wrc) { "object" } else { "Enum" } $baseDimensions = $quantity.BaseDimensions; - $isDimensionless = $baseDimensions -eq $null -or ( $baseDimensions.Length -eq 0 -and $baseDimensions.Mass -eq 0 -and $baseDimensions.Time -eq 0 -and $baseDimensions.ElectricCurrent -eq 0 -and $baseDimensions.Temperature -eq 0 -and $baseDimensions.AmountOfSubstance -eq 0 -and $baseDimensions.LuminousIntensity -eq 0 ) + $isDimensionless = $null -eq $baseDimensions -or ( $baseDimensions.Length -eq 0 -and $baseDimensions.Mass -eq 0 -and $baseDimensions.Time -eq 0 -and $baseDimensions.ElectricCurrent -eq 0 -and $baseDimensions.Temperature -eq 0 -and $baseDimensions.AmountOfSubstance -eq 0 -and $baseDimensions.LuminousIntensity -eq 0 ) [GeneratorArgs]$genArgs = New-Object GeneratorArgs -Property @{ Quantity = $quantity; BaseUnit = $baseUnit; UnitEnumName = $unitEnumName; - TargetIsWindowsRuntimeComponent = $wrc; } # $genArgs | fl | out-string | write-host -foreground yellow @" @@ -82,11 +68,11 @@ using UnitsNet.InternalHelpers; namespace UnitsNet { "@; -$obsoleteAttribute = GetObsoleteAttribute($quantity); -if ($obsoleteAttribute) -{ - $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this section -}@" + $obsoleteAttribute = GetObsoleteAttribute($quantity); + if ($obsoleteAttribute) + { + $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this section + }@" /// /// $($quantity.XmlDocSummary) /// @@ -94,15 +80,11 @@ if ($obsoleteAttribute) /// /// $($quantity.XmlDocRemarks) /// -"@; } - if($wrc) {@" +"@; }@" // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. public sealed partial class $quantityName : IQuantity -"@; } else {@" - public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible -"@; }@" { /// /// The numeric value this quantity was constructed with. @@ -116,22 +98,14 @@ if ($obsoleteAttribute) static $quantityName() { -"@; if($isDimensionless) - {@" +"@; if($isDimensionless) {@" BaseDimensions = BaseDimensions.Dimensionless; -"@; } - else - {@" - BaseDimensions = new BaseDimensions($($baseDimensions.Length), $($baseDimensions.Mass), $($baseDimensions.Time), $($baseDimensions.ElectricCurrent), $($baseDimensions.Temperature), $($baseDimensions.AmountOfSubstance), $($baseDimensions.LuminousIntensity)); -"@; } - if ($wrc) {@" - Info = new QuantityInfo(QuantityType.$quantityName, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); "@; } else {@" - Info = new QuantityInfo<$unitEnumName>(QuantityType.$quantityName, Units, BaseUnit, Zero, BaseDimensions); + BaseDimensions = new BaseDimensions($($baseDimensions.Length), $($baseDimensions.Mass), $($baseDimensions.Time), $($baseDimensions.ElectricCurrent), $($baseDimensions.Temperature), $($baseDimensions.AmountOfSubstance), $($baseDimensions.LuminousIntensity)); "@; }@" + Info = new QuantityInfo(QuantityType.$quantityName, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); } -"@; # Windows Runtime Component requires a default constructor - if ($wrc) {@" + /// /// Creates the quantity with a value of 0 in the base unit $baseUnitSingularName. /// @@ -143,7 +117,6 @@ if ($obsoleteAttribute) _value = 0; _unit = BaseUnit; } -"@; } @" /// /// Creates the quantity with the given numeric value and unit. @@ -152,7 +125,7 @@ if ($obsoleteAttribute) /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. - $privateAccessModifierIfWrc $quantityName($valueType numericValue, $unitEnumName unit) + private $quantityName($valueType numericValue, $unitEnumName unit) { if(unit == $unitEnumName.Undefined) throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit)); @@ -171,7 +144,6 @@ if ($obsoleteAttribute) GenerateStaticMethods $genArgs GenerateStaticFactoryMethods $genArgs GenerateStaticParseMethods $genArgs - GenerateArithmeticOperators $genArgs GenerateEqualityAndComparison $genArgs GenerateConversionMethods $genArgs @" @@ -191,17 +163,10 @@ if ($obsoleteAttribute) /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] string cultureName) { var provider = cultureName; -"@; } else {@" - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString([CanBeNull] IFormatProvider provider) - { -"@; }@" return ToString(provider, 2); } @@ -210,17 +175,10 @@ if ($obsoleteAttribute) /// /// The number of significant digits after the radix point. /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. public string ToString(string cultureName, int significantDigitsAfterRadix) { var provider = cultureName; -"@; } else {@" - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) - { -"@; }@" var value = Convert.ToDouble(Value); var format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); return ToString(provider, format); @@ -232,17 +190,10 @@ if ($obsoleteAttribute) /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args) { var provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use for localization and number formatting. Defaults to if null. - public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) - { -"@; }@" if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); @@ -254,113 +205,11 @@ if ($obsoleteAttribute) } #endregion -"@; if ($wrc) {@" private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] string cultureName) { return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; } -"@; }@" - -"@; if (!$wrc) {@" - #region IConvertible Methods - - TypeCode IConvertible.GetTypeCode() - { - return TypeCode.Object; - } - - bool IConvertible.ToBoolean(IFormatProvider provider) - { - throw new InvalidCastException($"Converting {typeof($quantityName)} to bool is not supported."); - } - - byte IConvertible.ToByte(IFormatProvider provider) - { - return Convert.ToByte(_value); - } - - char IConvertible.ToChar(IFormatProvider provider) - { - throw new InvalidCastException($"Converting {typeof($quantityName)} to char is not supported."); - } - - DateTime IConvertible.ToDateTime(IFormatProvider provider) - { - throw new InvalidCastException($"Converting {typeof($quantityName)} to DateTime is not supported."); - } - - decimal IConvertible.ToDecimal(IFormatProvider provider) - { - return Convert.ToDecimal(_value); - } - - double IConvertible.ToDouble(IFormatProvider provider) - { - return Convert.ToDouble(_value); - } - - short IConvertible.ToInt16(IFormatProvider provider) - { - return Convert.ToInt16(_value); - } - - int IConvertible.ToInt32(IFormatProvider provider) - { - return Convert.ToInt32(_value); - } - - long IConvertible.ToInt64(IFormatProvider provider) - { - return Convert.ToInt64(_value); - } - - sbyte IConvertible.ToSByte(IFormatProvider provider) - { - return Convert.ToSByte(_value); - } - - float IConvertible.ToSingle(IFormatProvider provider) - { - return Convert.ToSingle(_value); - } - - string IConvertible.ToString(IFormatProvider provider) - { - return ToString(provider); - } - - object IConvertible.ToType(Type conversionType, IFormatProvider provider) - { - if(conversionType == typeof($quantityName)) - return this; - else if(conversionType == typeof($unitEnumName)) - return Unit; - else if(conversionType == typeof(QuantityType)) - return $quantityName.QuantityType; - else if(conversionType == typeof(BaseDimensions)) - return $quantityName.BaseDimensions; - else - throw new InvalidCastException($"Converting {typeof($quantityName)} to {conversionType} is not supported."); - } - - ushort IConvertible.ToUInt16(IFormatProvider provider) - { - return Convert.ToUInt16(_value); - } - - uint IConvertible.ToUInt32(IFormatProvider provider) - { - return Convert.ToUInt32(_value); - } - - ulong IConvertible.ToUInt64(IFormatProvider provider) - { - return Convert.ToUInt64(_value); - } - - #endregion -"@; }@" } } "@; @@ -376,12 +225,10 @@ function GenerateStaticProperties([GeneratorArgs]$genArgs) #region Static Properties - /// -"@; if ($wrc) {@" + /// + /// Information about the quantity type, such as unit values and names. + /// internal static QuantityInfo Info { get; } -"@; } else {@" - public static QuantityInfo<$unitEnumName> Info { get; } -"@; }@" /// /// The of this quantity. @@ -426,9 +273,6 @@ function GenerateProperties([GeneratorArgs]$genArgs) { $quantityName = $genArgs.Quantity.Name $unitEnumName = $genArgs.UnitEnumName - $baseUnitSingularName = $genArgs.BaseUnit.SingularName - $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Properties @@ -436,30 +280,17 @@ function GenerateProperties([GeneratorArgs]$genArgs) /// /// The numeric value this quantity was constructed with. /// -"@; # Windows Runtime Component does not support decimal - if ($wrc) {@" public double Value => Convert.ToDouble(_value); -"@; } else {@" - public $valueType Value => _value; -"@; } -@" /// - $enumOrObject IQuantity.Unit => Unit; + object IQuantity.Unit => Unit; /// /// The unit this quantity was constructed with -or- if default ctor was used. /// public $unitEnumName Unit => _unit.GetValueOrDefault(BaseUnit); -"@; if ($wrc) {@" internal QuantityInfo QuantityInfo => Info; -"@; } else {@" - public QuantityInfo<$unitEnumName> QuantityInfo => Info; - - /// - QuantityInfo IQuantity.QuantityInfo => Info; -"@; }@" /// /// The of this quantity. @@ -526,17 +357,10 @@ function GenerateStaticMethods([GeneratorArgs]$genArgs) /// /// Unit to get abbreviation for. /// Unit abbreviation string. -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. public static string GetAbbreviation($unitEnumName unit, [CanBeNull] string cultureName) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use for localization. Defaults to if null. - public static string GetAbbreviation($unitEnumName unit, [CanBeNull] IFormatProvider provider) - { -"@; }@" return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); } @@ -550,7 +374,6 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) $unitEnumName = $genArgs.UnitEnumName $units = $genArgs.Quantity.Units $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Static Factory Methods @@ -567,13 +390,8 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) /// Get $quantityName from $($unit.PluralName). /// $($obsoleteAttribute) /// If value is NaN or Infinity. -"@; # Windows Runtime Component does not support overloads with same number of parameters - if ($wrc) {@" [Windows.Foundation.Metadata.DefaultOverload] public static $quantityName From$($unit.PluralName)(double $valueParamName) -"@; } else {@" - public static $quantityName From$($unit.PluralName)(QuantityValue $valueParamName) -"@; }@" { $valueType value = ($valueType) $valueParamName; return new $quantityName(value, $unitEnumName.$($unit.SingularName)); @@ -586,14 +404,9 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) /// Value to convert from. /// Unit to convert from. /// $quantityName unit value. -"@; # Windows Runtime Component does not support parameters named 'value' -if ($wrc) {@" // Fix name conflict with parameter "value" [return: System.Runtime.InteropServices.WindowsRuntime.ReturnValueName("returnValue")] public static $quantityName From(double value, $unitEnumName fromUnit) -"@; } else {@" - public static $quantityName From(QuantityValue value, $unitEnumName fromUnit) -"@; }@" { return new $quantityName(($valueType)value, fromUnit); } @@ -607,10 +420,6 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) { $quantityName = $genArgs.Quantity.Name $unitEnumName = $genArgs.UnitEnumName - $baseUnitPluralName = $genArgs.BaseUnit.PluralName - $units = $genArgs.Quantity.Units - $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Static Parse Methods @@ -664,17 +473,10 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. public static $quantityName Parse(string str, [CanBeNull] string cultureName) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use when parsing number and unit. Defaults to if null. - public static $quantityName Parse(string str, [CanBeNull] IFormatProvider provider) - { -"@; }@" return QuantityParser.Default.Parse<$quantityName, $unitEnumName>( str, provider, @@ -703,17 +505,10 @@ if ($wrc) {@" /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureName, out $quantityName result) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use when parsing number and unit. Defaults to if null. - public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out $quantityName result) - { -"@; }@" return QuantityParser.Default.TryParse<$quantityName, $unitEnumName>( str, provider, @@ -744,17 +539,10 @@ if ($wrc) {@" /// /// The value of 'str' cannot be null. /// Error parsing string. -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use when parsing number and unit. Defaults to if null. - public static $unitEnumName ParseUnit(string str, IFormatProvider provider = null) - { -"@; }@" return UnitParser.Default.Parse<$unitEnumName>(str, provider); } @@ -772,17 +560,10 @@ if ($wrc) {@" /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out $unitEnumName unit) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" - /// Format to use when parsing number and unit. Defaults to if null. - public static bool TryParseUnit(string str, IFormatProvider provider, out $unitEnumName unit) - { -"@; }@" return UnitParser.Default.TryParse<$unitEnumName>(str, provider, out unit); } @@ -790,163 +571,13 @@ if ($wrc) {@" "@; } -function GenerateLogarithmicArithmeticOperators([GeneratorArgs]$genArgs) -{ - $quantityName = $genArgs.Quantity.Name - $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent - $scalingFactor = $genArgs.Quantity.LogarithmicScalingFactor - # Most logarithmic operators need a simple scaling factor of 10. However, certain units such as voltage ratio need to use 20 instead. - $x = 10 * $scalingFactor; - @" - - #region Logarithmic Arithmetic Operators - - public static $quantityName operator -($quantityName right) - { - return new $quantityName(-right.Value, right.Unit); - } - - public static $quantityName operator +($quantityName left, $quantityName right) - { - // Logarithmic addition - // Formula: $x*log10(10^(x/$x) + 10^(y/$x)) - return new $quantityName($x*Math.Log10(Math.Pow(10, left.Value/$x) + Math.Pow(10, right.AsBaseNumericType(left.Unit)/$x)), left.Unit); - } - - public static $quantityName operator -($quantityName left, $quantityName right) - { - // Logarithmic subtraction - // Formula: $x*log10(10^(x/$x) - 10^(y/$x)) - return new $quantityName($x*Math.Log10(Math.Pow(10, left.Value/$x) - Math.Pow(10, right.AsBaseNumericType(left.Unit)/$x)), left.Unit); - } - - public static $quantityName operator *($valueType left, $quantityName right) - { - // Logarithmic multiplication = addition - return new $quantityName(left + right.Value, right.Unit); - } - - public static $quantityName operator *($quantityName left, double right) - { - // Logarithmic multiplication = addition - return new $quantityName(left.Value + ($valueType)right, left.Unit); - } - - public static $quantityName operator /($quantityName left, double right) - { - // Logarithmic division = subtraction - return new $quantityName(left.Value - ($valueType)right, left.Unit); - } - - public static double operator /($quantityName left, $quantityName right) - { - // Logarithmic division = subtraction - return Convert.ToDouble(left.Value - right.AsBaseNumericType(left.Unit)); - } - - #endregion -"@; -} - -function GenerateArithmeticOperators([GeneratorArgs]$genArgs) -{ - # Windows Runtime Component does not support operator overloads - if ($wrc -or (-not $quantity.GenerateArithmetic)) { return } - - # Logarithmic units required different arithmetic - if ($quantity.Logarithmic) { - GenerateLogarithmicArithmeticOperators $genArgs - return - } - - $quantityName = $genArgs.Quantity.Name - $baseUnitPluralName = $genArgs.BaseUnit.PluralName - $valueType = $genArgs.Quantity.BaseType - @" - - #region Arithmetic Operators - - public static $quantityName operator -($quantityName right) - { - return new $quantityName(-right.Value, right.Unit); - } - - public static $quantityName operator +($quantityName left, $quantityName right) - { - return new $quantityName(left.Value + right.AsBaseNumericType(left.Unit), left.Unit); - } - - public static $quantityName operator -($quantityName left, $quantityName right) - { - return new $quantityName(left.Value - right.AsBaseNumericType(left.Unit), left.Unit); - } - - public static $quantityName operator *($valueType left, $quantityName right) - { - return new $quantityName(left * right.Value, right.Unit); - } - - public static $quantityName operator *($quantityName left, $valueType right) - { - return new $quantityName(left.Value * right, left.Unit); - } - - public static $quantityName operator /($quantityName left, $valueType right) - { - return new $quantityName(left.Value / right, left.Unit); - } - - public static double operator /($quantityName left, $quantityName right) - { - return left.$baseUnitPluralName / right.$baseUnitPluralName; - } - - #endregion -"@; -} - function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) { $quantityName = $genArgs.Quantity.Name - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Equality / IComparable -"@; # Windows Runtime Component does not support operator overloads - if (-not $wrc) {@" - public static bool operator <=($quantityName left, $quantityName right) - { - return left.Value <= right.AsBaseNumericType(left.Unit); - } - - public static bool operator >=($quantityName left, $quantityName right) - { - return left.Value >= right.AsBaseNumericType(left.Unit); - } - - public static bool operator <($quantityName left, $quantityName right) - { - return left.Value < right.AsBaseNumericType(left.Unit); - } - - public static bool operator >($quantityName left, $quantityName right) - { - return left.Value > right.AsBaseNumericType(left.Unit); - } - - public static bool operator ==($quantityName left, $quantityName right) - { - return left.Equals(right); - } - - public static bool operator !=($quantityName left, $quantityName right) - { - return !(left == right); - } - -"@; }@" public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); @@ -956,15 +587,12 @@ function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) } // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods - $accessModifier int CompareTo($quantityName other) + internal int CompareTo($quantityName other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } -"@; - if ($wrc) {@" [Windows.Foundation.Metadata.DefaultOverload] -"@; }@" public override bool Equals(object obj) { if(obj is null || !(obj is $quantityName obj$quantityName)) @@ -1051,7 +679,7 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) #region Conversion Methods - double IQuantity.As($enumOrObject unit) => As(($unitEnumName)unit); + double IQuantity.As(object unit) => As(($unitEnumName)unit); /// /// Convert to the unit representation . @@ -1066,10 +694,6 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return Convert.ToDouble(converted); } -"@; if (-not $wrc) {@" - public double As(Enum unit) => As(($unitEnumName) unit); - -"@; }@" /// /// Converts this $quantityName to another $quantityName with the unit representation . /// @@ -1080,12 +704,6 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return new $quantityName(convertedValue, unit); } -"@; if (-not $wrc) {@" - IQuantity<$unitEnumName> IQuantity<$unitEnumName>.ToUnit($unitEnumName unit) => ToUnit(unit); - - public IQuantity ToUnit(Enum unit) => ToUnit(($unitEnumName) unit); - -"@; }@" /// /// 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.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 index 0539c41fd0..2fd09f5eea 100644 --- a/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 @@ -46,40 +46,13 @@ using JetBrains.Annotations; using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using FromValue = System.Double; -#else -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Dynamically parse or construct quantities when types are only known at runtime. /// -#if WINDOWS_UWP - internal -#else - public -#endif - static partial class Quantity + internal static partial class Quantity { -#if !WINDOWS_UWP - /// - public static bool TryFrom(double value, Enum unit, out IQuantity quantity) - { - // Implicit cast to FromValue would prevent TryFrom from being called, - // so we need to explicitly check this here for double arguments. - if (double.IsNaN(value) || double.IsInfinity(value)) - { - quantity = default(IQuantity); - return false; - } - - return TryFrom((FromValue) value, unit, out quantity); - } -#endif - /// /// Try to dynamically construct a quantity. /// @@ -87,12 +60,7 @@ namespace UnitsNet /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + internal static bool TryFrom(double value, Enum unit, out IQuantity quantity) { switch (unit) { @@ -113,12 +81,7 @@ namespace UnitsNet } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + internal static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); /// /// Dynamically parse a quantity string representation. @@ -128,12 +91,7 @@ namespace UnitsNet /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + internal static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) { if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); @@ -144,12 +102,7 @@ namespace UnitsNet } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + internal static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => TryParse(null, quantityType, quantityString, out quantity); /// @@ -160,12 +113,7 @@ namespace UnitsNet /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. /// The parsed quantity. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + internal static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) { quantity = default(IQuantity); @@ -183,18 +131,6 @@ namespace UnitsNet throw new ArgumentException( $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); } - -#if !WINDOWS_UWP - /// - /// Get information about the given quantity type. - /// - /// The quantity type enum value. - /// Information about the quantity and its units. - public static QuantityInfo GetInfo(QuantityType quantityType) - { - return Infos.First(qi => qi.QuantityType == quantityType); - } -#endif } } "@; diff --git a/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 b/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 index 11151b0bd2..8badec4b31 100644 --- a/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 +++ b/UnitsNet.WindowsRuntimeComponent/Scripts/Types.psm1 @@ -41,3 +41,10 @@ class BaseDimensions [int]$AmountOfSubstance = 0 [int]$LuminousIntensity = 0 } + +class GeneratorArgs +{ + [Quantity]$Quantity + [Unit]$BaseUnit + [string]$UnitEnumName +} From 2e55b7ea2f9610ad7508eaab24bf40a9314b5148 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Tue, 12 Feb 2019 23:08:16 +0100 Subject: [PATCH 03/10] Remove WINDOWS_UWP regions and dead files --- .../AmbiguousUnitParseException.cs | 7 +- .../BaseDimensions.cs | 64 +------ UnitsNet.WindowsRuntimeComponent/BaseUnits.cs | 37 +--- .../CustomCode/GlobalConfiguration.cs | 7 +- .../Quantities/Acceleration.extra.cs | 49 ------ .../Quantities/AmplitudeRatio.extra.cs | 11 +- .../CustomCode/Quantities/Angle.extra.cs | 49 ------ .../CustomCode/Quantities/Area.extra.cs | 26 --- .../BrakeSpecificFuelConsumption.extra.cs | 52 ------ .../CustomCode/Quantities/Density.extra.cs | 33 ---- .../CustomCode/Quantities/Duration.extra.cs | 72 -------- .../Quantities/DynamicViscosity.extra.cs | 43 ----- .../Quantities/ElectricPotential.extra.cs | 7 +- .../CustomCode/Quantities/Force.extra.cs | 37 ---- .../Quantities/ForcePerLength.extra.cs | 52 ------ .../CustomCode/Quantities/HeatFlux.extra.cs | 42 ----- .../Quantities/KinematicViscosity.extra.cs | 69 -------- .../CustomCode/Quantities/LapseRate.extra.cs | 49 ------ .../CustomCode/Quantities/Length.extra.cs | 136 +-------------- .../CustomCode/Quantities/Level.extra.cs | 59 ------- .../CustomCode/Quantities/Mass.extra.cs | 53 +----- .../CustomCode/Quantities/MassFlow.extra.cs | 93 ---------- .../CustomCode/Quantities/MassFlux.extra.cs | 49 ------ .../CustomCode/Quantities/Molarity.extra.cs | 40 +++-- .../CustomCode/Quantities/Power.extra.cs | 69 -------- .../CustomCode/Quantities/PowerRatio.extra.cs | 11 +- .../CustomCode/Quantities/Pressure.extra.cs | 57 ------ .../Quantities/RotationalSpeed.extra.cs | 59 ------- .../Quantities/RotationalStiffness.extra.cs | 52 ------ .../RotationalStiffnessPerLength.extra.cs | 42 ----- .../Quantities/SpecificEnergy.extra.cs | 62 ------- .../Quantities/SpecificVolume.extra.cs | 48 ------ .../Quantities/SpecificWeight.extra.cs | 52 ------ .../CustomCode/Quantities/Speed.extra.cs | 89 ---------- .../Quantities/Temperature.extra.cs | 47 ----- .../Quantities/TemperatureDelta.extra.cs | 52 ------ .../CustomCode/Quantities/Torque.extra.cs | 57 ------ .../CustomCode/Quantities/Volume.extra.cs | 64 ------- .../CustomCode/Quantities/VolumeFlow.extra.cs | 69 -------- .../CustomCode/Quantity.cs | 51 +----- .../CustomCode/QuantityParser.cs | 6 - .../CustomCode/UnitAbbreviationsCache.cs | 163 +----------------- .../CustomCode/UnitParser.cs | 48 +----- UnitsNet.WindowsRuntimeComponent/IQuantity.cs | 87 +--------- .../AssemblyInfo.WindowsRuntimeComponent.cs | 5 +- .../QuantityInfo.cs | 52 +----- .../QuantityNotFoundException.cs | 11 +- .../QuantityValue.cs | 113 ------------ .../UnitConverter.cs | 38 ++-- UnitsNet.WindowsRuntimeComponent/UnitInfo.cs | 27 +-- .../UnitNotFoundException.cs | 11 +- .../UnitSystem.cs | 37 +--- .../UnitsNetException.cs | 9 +- 53 files changed, 76 insertions(+), 2548 deletions(-) delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/QuantityValue.cs diff --git a/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs b/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs index c59a5a5e12..54e57e122c 100644 --- a/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs +++ b/UnitsNet.WindowsRuntimeComponent/AmbiguousUnitParseException.cs @@ -30,12 +30,7 @@ namespace UnitsNet /// and /// have "pt" as their abbreviation. /// -#if WINDOWS_UWP - internal -#else - public -#endif - class AmbiguousUnitParseException : UnitsNetException + internal class AmbiguousUnitParseException : UnitsNetException { /// public AmbiguousUnitParseException(string message) : base(message) diff --git a/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs b/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs index 6ce00d968b..fa99fdfba1 100644 --- a/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs +++ b/UnitsNet.WindowsRuntimeComponent/BaseDimensions.cs @@ -48,7 +48,7 @@ public BaseDimensions(int length, int mass, int time, int current, int temperatu /// True if the dimensions represent a base quantity, otherwise false. public bool IsBaseQuantity() { - var dimensionsArray = new int[]{Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}; + var dimensionsArray = new[]{Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}; bool onlyOneEqualsOne = dimensionsArray.Where(dimension => dimension == 1).Take(2).Count() == 1; return onlyOneEqualsOne; } @@ -68,13 +68,13 @@ public bool IsDerivedQuantity() /// True if this object represents a dimensionless quantity, otherwise false. public bool IsDimensionless() { - return this == Dimensionless; + return Equals(this, Dimensionless); } /// public override bool Equals(object obj) { - if(obj is null || !(obj is BaseDimensions)) + if(!(obj is BaseDimensions)) return false; var other = (BaseDimensions)obj; @@ -134,64 +134,6 @@ public BaseDimensions Divide(BaseDimensions right) LuminousIntensity - right.LuminousIntensity); } -#if !WINDOWS_UWP - - /// - /// Check if two dimensions are equal. - /// - /// Left. - /// Right. - /// True if equal. - public static bool operator ==(BaseDimensions left, BaseDimensions right) - { - return left is null ? right is null : left.Equals(right); - } - - /// - /// Check if two dimensions are unequal. - /// - /// Left. - /// Right. - /// True if not equal. - public static bool operator !=(BaseDimensions left, BaseDimensions right) - { - return !(left == right); - } - - /// - /// Multiply two dimensions. - /// - /// Left. - /// Right. - /// Resulting dimensions. - public static BaseDimensions operator *(BaseDimensions left, BaseDimensions right) - { - if(left is null) - throw new ArgumentNullException(nameof(left)); - else if(right is null) - throw new ArgumentNullException(nameof(right)); - - return left.Multiply(right); - } - - /// - /// Divide two dimensions. - /// - /// Left. - /// Right. - /// Resulting dimensions. - public static BaseDimensions operator /(BaseDimensions left, BaseDimensions right) - { - if(left is null) - throw new ArgumentNullException(nameof(left)); - else if(right is null) - throw new ArgumentNullException(nameof(right)); - - return left.Divide(right); - } - -#endif - /// public override string ToString() { diff --git a/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs b/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs index 16949c0ff6..e50564d2a5 100644 --- a/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs +++ b/UnitsNet.WindowsRuntimeComponent/BaseUnits.cs @@ -19,21 +19,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; using System.Text; using UnitsNet.Units; namespace UnitsNet { -#if !WINDOWS_UWP - public sealed partial class BaseUnits : IEquatable { } -#endif - /// /// Represents the base units for a quantity. All quantities, both base and derived, can be /// represented by a combination of these seven base units. /// - public sealed partial class BaseUnits + public sealed class BaseUnits { /// /// Creates an instance of if the base units class that represents the base units for a quantity. @@ -72,9 +67,7 @@ public override bool Equals(object obj) /// /// The other instance to check if equal to. /// True if equal, otherwise false. -#if WINDOWS_UWP [Windows.Foundation.Metadata.DefaultOverload] -#endif public bool Equals(BaseUnits other) { if(other is null) @@ -95,34 +88,6 @@ public override int GetHashCode() return new {Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}.GetHashCode(); } -#if !WINDOWS_UWP - - /// - /// Checks if this instance is equal to another. - /// - /// The left instance. - /// The right instance. - /// True if equal, otherwise false. - /// - public static bool operator ==(BaseUnits left, BaseUnits right) - { - return left is null ? right is null : left.Equals(right); - } - - /// - /// Checks if this instance is not equal to another. - /// - /// The left instance. - /// The right instance. - /// True if not equal, otherwise false. - /// - public static bool operator !=(BaseUnits left, BaseUnits right) - { - return !(left == right); - } - -#endif - /// public override string ToString() { diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs index 396eb0ca07..fdee9fa8b3 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/GlobalConfiguration.cs @@ -31,12 +31,7 @@ public sealed class GlobalConfiguration /// Defaults to when creating an instance with no culture provided. /// Can be overridden, but note that this is static and will affect all subsequent usages. /// -#if WINDOWS_UWP // Windows Runtime Component does not support exposing the IFormatProvider type in public API - internal -#else - public -#endif - static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; + internal static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs deleted file mode 100644 index d4f20f0030..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Acceleration.extra.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace - -using System; -using UnitsNet.Units; - -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Acceleration -#else - public partial struct Acceleration -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - /// - /// Multiply and to get . - /// - public static SpecificWeight operator *(Acceleration acceleration, Density density) - { - return new SpecificWeight(acceleration.MetersPerSecondSquared * density.KilogramsPerCubicMeter, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs index 0e68fb595b..19949a9f62 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/AmplitudeRatio.extra.cs @@ -28,11 +28,7 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class AmplitudeRatio -#else - public partial struct AmplitudeRatio -#endif { /// /// Initializes a new instance of the struct from the specified electric potential @@ -43,12 +39,7 @@ public partial struct AmplitudeRatio /// The electric potential referenced to one volt. // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - AmplitudeRatio(ElectricPotential voltage) + private AmplitudeRatio(ElectricPotential voltage) : this() { if (voltage.Volts <= 0) diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs deleted file mode 100644 index 68676d7e50..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Angle.extra.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Angle -#else - public partial struct Angle -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static RotationalSpeed operator /(Angle angle, TimeSpan timeSpan) - { - return RotationalSpeed.FromRadiansPerSecond(angle.Radians / timeSpan.TotalSeconds); - } - - public static RotationalSpeed operator /(Angle angle, Duration duration) - { - return RotationalSpeed.FromRadiansPerSecond(angle.Radians / duration.Seconds); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs index f6fc2770c4..b8fd455d37 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Area.extra.cs @@ -27,14 +27,8 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Area -#else - public partial struct Area -#endif { - #region Static Methods - public static Area FromCircleDiameter(Length diameter) { var radius = Length.FromMeters(diameter.Meters / 2d); @@ -45,25 +39,5 @@ public static Area FromCircleRadius(Length radius) { return FromSquareMeters(Math.PI * radius.Meters * radius.Meters); } - - #endregion - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Length operator /(Area area, Length length) - { - return Length.FromMeters(area.SquareMeters / length.Meters); - } - - public static MassFlow operator *(Area area, MassFlux massFlux) - { - return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); - } - - public static VolumeFlow operator *(Area area, Speed speed) - { - return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs deleted file mode 100644 index 2a9e9a437e..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class BrakeSpecificFuelConsumption -#else - public partial struct BrakeSpecificFuelConsumption -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static MassFlow operator *(BrakeSpecificFuelConsumption bsfc, Power power) - { - return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule*power.Watts); - } - - public static SpecificEnergy operator /(double value, BrakeSpecificFuelConsumption bsfc) - { - return SpecificEnergy.FromJoulesPerKilogram(value/bsfc.KilogramsPerJoule); - } - - public static double operator *(BrakeSpecificFuelConsumption bsfc, SpecificEnergy specificEnergy) - { - return specificEnergy.JoulesPerKilogram*bsfc.KilogramsPerJoule; - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs index 6fd11240ff..6d79afb3cc 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Density.extra.cs @@ -26,12 +26,7 @@ namespace UnitsNet { // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Density -#else - public partial struct Density -#endif { /// /// Gets from this . @@ -55,33 +50,5 @@ public static Density FromMolarity(Molarity molarity, Mass molecularWeight) } #endregion - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Mass operator *(Density density, Volume volume) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - public static Mass operator *(Volume volume, Density density) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) - { - return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); - } - - public static MassFlux operator *(Density density, Speed speed) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(density.KilogramsPerCubicMeter * speed.MetersPerSecond); - } - - public static SpecificWeight operator *(Density density, Acceleration acceleration) - { - return new SpecificWeight(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared, SpecificWeightUnit.NewtonPerCubicMeter); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs index 5748f67250..fe990b46e2 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Duration.extra.cs @@ -27,11 +27,7 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Duration -#else - public partial struct Duration -#endif { /// /// Convert a Duration to a TimeSpan. @@ -45,73 +41,5 @@ public TimeSpan ToTimeSpan() throw new ArgumentOutOfRangeException( nameof( Duration ), "The duration is too large or small to fit in a TimeSpan" ); return TimeSpan.FromSeconds( Seconds ); } - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static DateTime operator +(DateTime time, Duration duration) - { - return time.AddSeconds(duration.Seconds); - } - - public static DateTime operator -(DateTime time, Duration duration) - { - return time.AddSeconds(-duration.Seconds); - } - - public static explicit operator TimeSpan(Duration duration) - { - return duration.ToTimeSpan(); - } - - public static explicit operator Duration(TimeSpan duration) - { - return FromSeconds(duration.TotalSeconds); - } - - public static bool operator <(Duration duration, TimeSpan timeSpan) - { - return duration.Seconds < timeSpan.TotalSeconds; - } - - public static bool operator >(Duration duration, TimeSpan timeSpan) - { - return duration.Seconds > timeSpan.TotalSeconds; - } - - public static bool operator <=(Duration duration, TimeSpan timeSpan) - { - return duration.Seconds <= timeSpan.TotalSeconds; - } - - public static bool operator >=(Duration duration, TimeSpan timeSpan) - { - return duration.Seconds >= timeSpan.TotalSeconds; - } - - public static bool operator <(TimeSpan timeSpan, Duration duration) - { - return timeSpan.TotalSeconds < duration.Seconds; - } - - public static bool operator >(TimeSpan timeSpan, Duration duration) - { - return timeSpan.TotalSeconds > duration.Seconds; - } - - public static bool operator <=(TimeSpan timeSpan, Duration duration) - { - return timeSpan.TotalSeconds <= duration.Seconds; - } - - public static bool operator >=(TimeSpan timeSpan, Duration duration) - { - return timeSpan.TotalSeconds >= duration.Seconds; - } - - public static Volume operator *(Duration duration, VolumeFlow volumeFlow) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs deleted file mode 100644 index 33286fd870..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/DynamicViscosity.extra.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class DynamicViscosity -#else - public partial struct DynamicViscosity -#endif - { -// Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - - public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) - { - return KinematicViscosity.FromSquareMetersPerSecond(dynamicViscosity.NewtonSecondsPerMeterSquared / density.KilogramsPerCubicMeter); - } -#endif - } -} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs index 6f1fc43ea7..9f729c775c 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ElectricPotential.extra.cs @@ -19,8 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; -using UnitsNet.Units; + // ReSharper disable once CheckNamespace namespace UnitsNet @@ -28,11 +27,7 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class ElectricPotential -#else - public partial struct ElectricPotential -#endif { /// /// Gets an in decibels (dB) relative to 1 volt RMS from this . diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs index f13fd8cbcd..d0d2a71931 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Force.extra.cs @@ -27,11 +27,7 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Force -#else - public partial struct Force -#endif { public static Force FromPressureByArea(Pressure p, Area area) { @@ -43,38 +39,5 @@ public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) { return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared, ForceUnit.Newton); } - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Power operator *(Force force, Speed speed) - { - return Power.FromWatts(force.Newtons * speed.MetersPerSecond); - } - - public static Power operator *(Speed speed, Force force) - { - return Power.FromWatts(force.Newtons * speed.MetersPerSecond); - } - - public static Acceleration operator /(Force force, Mass mass) - { - return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); - } - - public static Mass operator /(Force force, Acceleration mass) - { - return Mass.FromKilograms(force.Newtons / mass.MetersPerSecondSquared); - } - - public static Pressure operator /(Force force, Area area) - { - return Pressure.FromPascals(force.Newtons / area.SquareMeters); - } - - public static ForcePerLength operator /(Force force, Length length) - { - return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs deleted file mode 100644 index 86d9642e54..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/ForcePerLength.extra.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class ForcePerLength -#else - public partial struct ForcePerLength -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Force operator *(ForcePerLength forcePerLength, Length length) - { - return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); - } - - public static Length operator /(Force force, ForcePerLength forcePerLength) - { - return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); - } - - public static Pressure operator /(ForcePerLength forcePerLength, Length length) - { - return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); - } -#endif - } -} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs deleted file mode 100644 index 2e8910ba43..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/HeatFlux.extra.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class HeatFlux -#else - public partial struct HeatFlux -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Power operator *(HeatFlux heatFlux, Area area) - { - return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs deleted file mode 100644 index 72dbd14940..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/KinematicViscosity.extra.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class KinematicViscosity -#else - public partial struct KinematicViscosity -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) - { - return Speed.FromMetersPerSecond(kinematicViscosity.SquareMetersPerSecond / length.Meters); - } - - public static Area operator *(KinematicViscosity kinematicViscosity, TimeSpan timeSpan) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); - } - - public static Area operator *(TimeSpan timeSpan, KinematicViscosity kinematicViscosity) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); - } - - public static Area operator *(KinematicViscosity kinematicViscosity, Duration duration) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); - } - - public static Area operator *(Duration duration, KinematicViscosity kinematicViscosity) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); - } - - public static DynamicViscosity operator *(KinematicViscosity kinematicViscosity, Density density) - { - return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs deleted file mode 100644 index ba34a2e828..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/LapseRate.extra.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class LapseRate -#else - public partial struct LapseRate -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Length operator /(TemperatureDelta left, LapseRate right) - { - return Length.FromKilometers(left.Kelvins / right.DegreesCelciusPerKilometer); - } - - public static TemperatureDelta operator *(Length left, LapseRate right) => right * left; - - public static TemperatureDelta operator *(LapseRate left, Length right) - { - return TemperatureDelta.FromDegreesCelsius(left.DegreesCelciusPerKilometer * right.Kilometers); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs index 7d9ba655d8..1462bd4d66 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Length.extra.cs @@ -20,27 +20,16 @@ // THE SOFTWARE. using System; -using System.Text.RegularExpressions; using JetBrains.Annotations; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture=System.String; -#else -using Culture=System.IFormatProvider; -#endif - // ReSharper disable once CheckNamespace namespace UnitsNet { // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Length -#else - public partial struct Length -#endif { private const double InchesInOneFoot = 12; @@ -66,129 +55,6 @@ public static Length FromFeetInches(double feet, double inches) { return FromInches(InchesInOneFoot*feet + inches); } - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - - /// - /// Special parsing of feet/inches strings, commonly used. - /// 2 feet 4 inches is sometimes denoted as 2′−4″, 2′ 4″, 2′4″, 2 ft 4 in. - /// The apostrophe can be ′ and '. - /// The double prime can be ″ and ". - /// https://en.wikipedia.org/wiki/Foot_(unit) - /// - /// - /// Optionally specify the culture format numbers and localize unit abbreviations. Defaults to thread's culture. - /// Parsed length. - public static Length ParseFeetInches([NotNull] string str, IFormatProvider formatProvider = null) - { - if (str == null) throw new ArgumentNullException(nameof(str)); - if (!TryParseFeetInches(str, out Length result, formatProvider)) - { - // A bit lazy, but I didn't want to duplicate this edge case implementation just to get more narrow exception descriptions. - throw new FormatException("Unable to parse feet and inches. Expected format \"2' 4\"\" or \"2 ft 4 in\". Whitespace is optional."); - } - - return result; - } - - /// - /// Special parsing of feet/inches strings, commonly used. - /// 2 feet 4 inches is sometimes denoted as 2′−4″, 2′ 4″, 2′4″, 2 ft 4 in. - /// The apostrophe can be ′ and '. - /// The double prime can be ″ and ". - /// https://en.wikipedia.org/wiki/Foot_(unit) - /// - /// - /// Parsed length. - /// Optionally specify the culture format numbers and localize unit abbreviations. Defaults to thread's culture. - public static bool TryParseFeetInches([CanBeNull] string str, out Length result, IFormatProvider formatProvider = null) - { - if (str == null) - { - result = default; - return false; - } - - str = str.Trim(); - - // This succeeds if only feet or inches are given, not both - if (TryParse(str, formatProvider, out result)) - return true; - - var quantityParser = QuantityParser.Default; - string footRegex = quantityParser.CreateRegexPatternForUnit(LengthUnit.Foot, formatProvider, matchEntireString: false); - string inchRegex = quantityParser.CreateRegexPatternForUnit(LengthUnit.Inch, formatProvider, matchEntireString: false); - - // Match entire string exactly - string pattern = $@"^(?{footRegex})\s?(?{inchRegex})$"; - - var match = new Regex(pattern, RegexOptions.Singleline).Match(str); - if (!match.Success) return false; - - var feetGroup = match.Groups["feet"]; - var inchesGroup = match.Groups["inches"]; - if (TryParse(feetGroup.Value, formatProvider, out Length feet) && - TryParse(inchesGroup.Value, formatProvider, out Length inches)) - { - result = feet + inches; - return true; - } - - result = default; - return false; - } - - public static Speed operator /(Length length, TimeSpan timeSpan) - { - return Speed.FromMetersPerSecond(length.Meters/timeSpan.TotalSeconds); - } - - public static Speed operator /(Length length, Duration duration) - { - return Speed.FromMetersPerSecond(length.Meters/duration.Seconds); - } - - public static Duration operator /(Length length, Speed speed) - { - return Duration.FromSeconds(length.Meters/speed.MetersPerSecond); - } - - public static Area operator *(Length length1, Length length2) - { - return Area.FromSquareMeters(length1.Meters*length2.Meters); - } - - public static Volume operator *(Area area, Length length) - { - return Volume.FromCubicMeters(area.SquareMeters*length.Meters); - } - - public static Volume operator *(Length length, Area area) - { - return Volume.FromCubicMeters(area.SquareMeters*length.Meters); - } - - public static Torque operator *(Force force, Length length) - { - return Torque.FromNewtonMeters(force.Newtons*length.Meters); - } - - public static Torque operator *(Length length, Force force) - { - return Torque.FromNewtonMeters(force.Newtons*length.Meters); - } - - public static KinematicViscosity operator *(Length length, Speed speed) - { - return KinematicViscosity.FromSquareMetersPerSecond(length.Meters*speed.MetersPerSecond); - } - - public static Pressure operator *(Length length, SpecificWeight specificWeight) - { - return new Pressure(length.Meters * specificWeight.NewtonsPerCubicMeter, PressureUnit.Pascal); - } -#endif } public sealed class FeetInches @@ -207,7 +73,7 @@ public override string ToString() return ToString(null); } - public string ToString([CanBeNull] Culture cultureInfo) + public string ToString([CanBeNull] string cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 5 feet and 4.5 inches". // So inches are rounded when converting from base units to feet/inches. diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs deleted file mode 100644 index b222bbcaf6..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Level.extra.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using UnitsNet.Units; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. - // Cannot have methods with same name and same number of parameters. -#if !WINDOWS_UWP - public partial struct Level - { - /// - /// Initializes a new instance of the logarithmic struct which is the ratio of a quantity Q to a - /// reference value of that quantity Q0. - /// - /// The quantity. - /// The reference value that is compared to. - public Level(double quantity, double reference) - : this() - { - string errorMessage = - $"The base-10 logarithm of a number ≤ 0 is undefined ({quantity}/{reference})."; - - // ReSharper disable CompareOfFloatsByEqualityOperator - if (quantity == 0 || quantity < 0 && reference > 0) - throw new ArgumentOutOfRangeException(nameof(quantity), errorMessage); - if (reference == 0 || quantity > 0 && reference < 0) - throw new ArgumentOutOfRangeException(nameof(reference), errorMessage); - // ReSharper restore CompareOfFloatsByEqualityOperator - - _value = 10*Math.Log10(quantity/reference); - _unit = LevelUnit.Decibel; - } - } -#endif -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs index 11fb195c63..2e8666dd5a 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Mass.extra.cs @@ -20,26 +20,17 @@ // THE SOFTWARE. using System; +using System.Globalization; using JetBrains.Annotations; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture = System.String; -#else -using Culture = System.IFormatProvider; -#endif - // ReSharper disable once CheckNamespace namespace UnitsNet { // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Mass -#else - public partial struct Mass -#endif { public static Mass FromGravitationalForce(Force f) { @@ -75,39 +66,6 @@ public static Mass FromStonePounds(double stone, double pounds) { return FromPounds(StonesInOnePound*stone + pounds); } - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static MassFlow operator /(Mass mass, TimeSpan timeSpan) - { - return MassFlow.FromKilogramsPerSecond(mass.Kilograms/timeSpan.TotalSeconds); - } - - public static MassFlow operator /(Mass mass, Duration duration) - { - return MassFlow.FromKilogramsPerSecond(mass.Kilograms/duration.Seconds); - } - - public static Density operator /(Mass mass, Volume volume) - { - return Density.FromKilogramsPerCubicMeter(mass.Kilograms/volume.CubicMeters); - } - - public static Volume operator /(Mass mass, Density density) - { - return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter); - } - - public static Force operator *(Mass mass, Acceleration acceleration) - { - return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); - } - - public static Force operator *(Acceleration acceleration, Mass mass) - { - return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); - } -#endif } public sealed class StonePounds @@ -126,15 +84,16 @@ public override string ToString() return ToString(null); } - public string ToString([CanBeNull] Culture cultureInfo) + public string ToString([CanBeNull] string cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 11 stone and 4.5 pounds". // So pounds are rounded here. - var stoneUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Stone); - var poundUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Pound); + var culture = cultureInfo != null ? new CultureInfo(cultureInfo) : GlobalConfiguration.DefaultCulture; + var stoneUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Stone, culture); + var poundUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Pound, culture); - return string.Format(GlobalConfiguration.DefaultCulture, "{0:n0} {1} {2:n0} {3}", + return string.Format(culture, "{0:n0} {1} {2:n0} {3}", Stone, stoneUnit, Math.Round(Pounds), poundUnit); } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs deleted file mode 100644 index 49288cfe60..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlow.extra.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class MassFlow -#else - public partial struct MassFlow -#endif - { -#if !WINDOWS_UWP - public static Mass operator *(MassFlow massFlow, TimeSpan time) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); - } - - public static Mass operator *(TimeSpan time, MassFlow massFlow) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); - } - - public static Mass operator *(MassFlow massFlow, Duration duration) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); - } - - public static Mass operator *(Duration duration, MassFlow massFlow) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); - } - - public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption bsfc) - { - return Power.FromWatts(massFlow.KilogramsPerSecond / bsfc.KilogramsPerJoule); - } - - public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) - { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / power.Watts); - } - - public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) - { - return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); - } - - public static MassFlux operator /(MassFlow massFlow, Area area) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); - } - - public static Area operator /(MassFlow massFlow, MassFlux massFlux) - { - return Area.FromSquareMeters(massFlow.KilogramsPerSecond / massFlux.KilogramsPerSecondPerSquareMeter); - } - - public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) - { - return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); - } - - public static VolumeFlow operator /(MassFlow massFlow, Density density) - { - return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs deleted file mode 100644 index 31062c283c..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/MassFlux.extra.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class MassFlux -#else - public partial struct MassFlux -#endif - { -#if !WINDOWS_UWP - public static Density operator /(MassFlux massFlux, Speed speed) - { - return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); - } - public static Speed operator /(MassFlux massFlux, Density density) - { - return Speed.FromMetersPerSecond(massFlux.KilogramsPerSecondPerSquareMeter / density.KilogramsPerCubicMeter); - } - public static MassFlow operator *(MassFlux massFlux, Area area) - { - return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs index 9226caed22..c6f9ef0fdc 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Molarity.extra.cs @@ -1,4 +1,23 @@ -using UnitsNet.Units; +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. // ReSharper disable once CheckNamespace namespace UnitsNet @@ -6,25 +25,8 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Molarity -#else - public partial struct Molarity -#endif { - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - Molarity(Density density, Mass molecularWeight) - : this() - { - _value = density.KilogramsPerCubicMeter / molecularWeight.Kilograms; - _unit = MolarityUnit.MolesPerCubicMeter; - } - /// /// Get a from this . /// @@ -43,7 +45,7 @@ public Density ToDensity(Mass molecularWeight) /// public static Molarity FromDensity(Density density, Mass molecularWeight) { - return new Molarity(density, molecularWeight); + return FromMolesPerCubicMeter(density.KilogramsPerCubicMeter / molecularWeight.Kilograms); } #endregion diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs index 77b1616860..ed178f85bd 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Power.extra.cs @@ -19,19 +19,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; - // ReSharper disable once CheckNamespace namespace UnitsNet { // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Power -#else - public partial struct Power -#endif { /// /// Gets a from this relative to one watt. @@ -46,68 +40,5 @@ public PowerRatio ToPowerRatio() { return PowerRatio.FromPower(this); } - - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Energy operator *(Power power, TimeSpan time) - { - return Energy.FromJoules(power.Watts * time.TotalSeconds); - } - - public static Energy operator *(TimeSpan time, Power power) - { - return Energy.FromJoules(power.Watts * time.TotalSeconds); - } - - public static Energy operator *(Power power, Duration duration) - { - return Energy.FromJoules(power.Watts * duration.Seconds); - } - - public static Energy operator *(Duration duration, Power power) - { - return Energy.FromJoules(power.Watts * duration.Seconds); - } - - public static Force operator /(Power power, Speed speed) - { - return Force.FromNewtons(power.Watts / speed.MetersPerSecond); - } - - public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) - { - return Torque.FromNewtonMeters(power.Watts / rotationalSpeed.RadiansPerSecond); - } - - public static RotationalSpeed operator /(Power power, Torque torque) - { - return RotationalSpeed.FromRadiansPerSecond(power.Watts / torque.NewtonMeters); - } - - public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption bsfc) - { - return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule * power.Watts); - } - - public static SpecificEnergy operator /(Power power, MassFlow massFlow) - { - return SpecificEnergy.FromJoulesPerKilogram(power.Watts / massFlow.KilogramsPerSecond); - } - - public static MassFlow operator /(Power power, SpecificEnergy specificEnergy) - { - return MassFlow.FromKilogramsPerSecond(power.Watts / specificEnergy.JoulesPerKilogram); - } - - public static HeatFlux operator /(Power power, Area area) - { - return HeatFlux.FromWattsPerSquareMeter(power.Watts / area.SquareMeters); - } - - public static Area operator /(Power power, HeatFlux heatFlux) - { - return Area.FromSquareMeters( power.Watts / heatFlux.WattsPerSquareMeter ); - } -#endif } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs index 4180da4d89..21163b51bb 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/PowerRatio.extra.cs @@ -28,11 +28,7 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class PowerRatio -#else - public partial struct PowerRatio -#endif { /// /// Initializes a new instance of the struct from the specified power referenced to one watt. @@ -40,12 +36,7 @@ public partial struct PowerRatio /// The power relative to one watt. // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - PowerRatio(Power power) + private PowerRatio(Power power) : this() { if (power.Watts <= 0) diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs deleted file mode 100644 index e85acc8212..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Pressure.extra.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Pressure -#else - public partial struct Pressure -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Force operator *(Pressure pressure, Area area) - { - return Force.FromNewtons(pressure.Pascals * area.SquareMeters); - } - - public static Force operator *(Area area, Pressure pressure) - { - return Force.FromNewtons(pressure.Pascals * area.SquareMeters); - } - - public static Length operator /(Pressure pressure, SpecificWeight specificWeight) - { - return new Length(pressure.Pascals / specificWeight.NewtonsPerCubicMeter, UnitsNet.Units.LengthUnit.Meter); - } - - public static SpecificWeight operator /(Pressure pressure, Length length) - { - return new SpecificWeight(pressure.Pascals / length.Meters, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs deleted file mode 100644 index 0afa95479d..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalSpeed.extra.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalSpeed -#else - public partial struct RotationalSpeed -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); - } - - public static Angle operator *(TimeSpan timeSpan, RotationalSpeed rotationalSpeed) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); - } - - public static Angle operator *(RotationalSpeed rotationalSpeed, Duration duration) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); - } - - public static Angle operator *(Duration duration, RotationalSpeed rotationalSpeed) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs deleted file mode 100644 index 300276c10e..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffness.extra.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalStiffness -#else - public partial struct RotationalStiffness -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) - { - return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); - } - - public static RotationalStiffnessPerLength operator /(RotationalStiffness rotationalStiffness, Length length) - { - return RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(rotationalStiffness.NewtonMetersPerRadian / length.Meters); - } - - public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) - { - return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs deleted file mode 100644 index b4028483ed..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalStiffnessPerLength -#else - public partial struct RotationalStiffnessPerLength -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static RotationalStiffness operator *(RotationalStiffnessPerLength rotationalStiffness, Length length) - { - return RotationalStiffness.FromNewtonMetersPerRadian(rotationalStiffness.NewtonMetersPerRadianPerMeter * length.Meters); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs deleted file mode 100644 index a17a8a4fd4..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificEnergy.extra.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificEnergy -#else - public partial struct SpecificEnergy -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Energy operator *(SpecificEnergy specificEnergy, Mass mass) - { - return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); - } - - public static Energy operator *(Mass mass, SpecificEnergy specificEnergy) - { - return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); - } - - public static BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) - { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); - } - - public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption bsfc) - { - return specificEnergy.JoulesPerKilogram * bsfc.KilogramsPerJoule; - } - - public static Power operator *(SpecificEnergy specificEnergy, MassFlow massFlow) - { - return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); - } -#endif - } -} \ No newline at end of file diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs deleted file mode 100644 index 3df2036e99..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificVolume.extra.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificVolume -#else - public partial struct SpecificVolume -#endif - { - -#if !WINDOWS_UWP - public static Density operator /(double constant, SpecificVolume volume) - { - return Density.FromKilogramsPerCubicMeter(constant / volume.CubicMetersPerKilogram); - } - - public static Volume operator *(SpecificVolume volume, Mass mass) - { - return Volume.FromCubicMeters(volume.CubicMetersPerKilogram * mass.Kilograms); - } - -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs deleted file mode 100644 index b9403d2107..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/SpecificWeight.extra.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificWeight -#else - public partial struct SpecificWeight -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Pressure operator *(SpecificWeight specificWeight, Length length) - { - return new Pressure(specificWeight.NewtonsPerCubicMeter * length.Meters, UnitsNet.Units.PressureUnit.Pascal); - } - - public static Acceleration operator /(SpecificWeight specificWeight, Density density) - { - return new Acceleration(specificWeight.NewtonsPerCubicMeter / density.KilogramsPerCubicMeter, UnitsNet.Units.AccelerationUnit.MeterPerSecondSquared); - } - - public static Density operator /(SpecificWeight specific, Acceleration acceleration) - { - return new Density(specific.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared, UnitsNet.Units.DensityUnit.KilogramPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs deleted file mode 100644 index 8e5eaab04d..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Speed.extra.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Speed -#else - public partial struct Speed -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Acceleration operator /(Speed speed, TimeSpan timeSpan) - { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); - } - - public static Length operator *(Speed speed, TimeSpan timeSpan) - { - return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); - } - - public static Length operator *(TimeSpan timeSpan, Speed speed) - { - return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); - } - - public static Acceleration operator /(Speed speed, Duration duration) - { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / duration.Seconds); - } - - public static Length operator *(Speed speed, Duration duration) - { - return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); - } - - public static Length operator *(Duration duration, Speed speed) - { - return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); - } - - public static KinematicViscosity operator *(Speed speed, Length length) - { - return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); - } - - public static SpecificEnergy operator *(Speed left, Speed right) - { - return SpecificEnergy.FromJoulesPerKilogram(left.MetersPerSecond * right.MetersPerSecond); - } - - public static MassFlux operator *(Speed speed, Density density) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(speed.MetersPerSecond * density.KilogramsPerCubicMeter); - } - - public static VolumeFlow operator *(Speed speed, Area area) - { - return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs index fed00fd718..709aab269c 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Temperature.extra.cs @@ -27,55 +27,8 @@ namespace UnitsNet // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components // Public structures can't have any members other than public fields, and those fields must be value types or strings. // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP public sealed partial class Temperature -#else - public partial struct Temperature -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - /// - /// Add a and a . - /// - /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. - /// The new temperature. - public static Temperature operator +(Temperature left, TemperatureDelta right) - { - return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); - } - - /// - /// Add a and a . - /// - /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. - /// The new temperature. - public static Temperature operator +(TemperatureDelta left, Temperature right) - { - return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); - } - - /// - /// Subtract a by a . - /// - /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. - /// The new temperature. - public static Temperature operator -(Temperature left, TemperatureDelta right) - { - return new Temperature(left.Kelvins - right.Kelvins, TemperatureUnit.Kelvin); - } - - /// - /// Subtract a by a . - /// - /// Due to temperature units having different scales, the arithmetic must be performed on the same scale. - /// The delta temperature (difference). - public static TemperatureDelta operator -(Temperature left, Temperature right) - { - return new TemperatureDelta(left.Kelvins - right.Kelvins, TemperatureDeltaUnit.Kelvin); - } -#endif - /// /// Multiply temperature with a in a given . /// diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs deleted file mode 100644 index 4ec7201483..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/TemperatureDelta.extra.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class TemperatureDelta -#else - public partial struct TemperatureDelta -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static LapseRate operator /(TemperatureDelta left, Length right) - { - return LapseRate.FromDegreesCelciusPerKilometer(left.DegreesCelsius / right.Kilometers); - } - - public static SpecificEnergy operator *(SpecificEntropy specificEntropy, TemperatureDelta temperatureDelta) - { - return SpecificEnergy.FromJoulesPerKilogram(specificEntropy.JoulesPerKilogramKelvin * temperatureDelta.Kelvins); - } - - public static SpecificEnergy operator *(TemperatureDelta temperatureDelta, SpecificEntropy specificEntropy) - { - return specificEntropy * temperatureDelta; - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs deleted file mode 100644 index ded64d2ec5..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Torque.extra.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Torque -#else - public partial struct Torque -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Force operator /(Torque torque, Length length) - { - return Force.FromNewtons(torque.NewtonMeters / length.Meters); - } - - public static Length operator /(Torque torque, Force force) - { - return Length.FromMeters(torque.NewtonMeters / force.Newtons); - } - - public static RotationalStiffness operator /(Torque torque, Angle angle) - { - return RotationalStiffness.FromNewtonMetersPerRadian(torque.NewtonMeters / angle.Radians); - } - - public static Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) - { - return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs deleted file mode 100644 index 8792faf783..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/Volume.extra.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Volume -#else - public partial struct Volume -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Area operator /(Volume volume, Length length) - { - return Area.FromSquareMeters(volume.CubicMeters / length.Meters); - } - - public static Length operator /(Volume volume, Area area) - { - return Length.FromMeters(volume.CubicMeters / area.SquareMeters); - } - - public static VolumeFlow operator /(Volume volume, Duration duration) - { - return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / duration.Seconds); - } - - public static VolumeFlow operator /(Volume volume, TimeSpan timeSpan) - { - return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / timeSpan.TotalSeconds); - } - - public static TimeSpan operator /(Volume volume, VolumeFlow volumeFlow) - { - return TimeSpan.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs deleted file mode 100644 index 2d31a4785e..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantities/VolumeFlow.extra.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class VolumeFlow -#else - public partial struct VolumeFlow -#endif - { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static Volume operator *(VolumeFlow volumeFlow, TimeSpan timeSpan) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * timeSpan.TotalSeconds); - } - - public static Volume operator *(VolumeFlow volumeFlow, Duration duration) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); - } - - public static Speed operator /(VolumeFlow volumeFlow, Area area) - { - return Speed.FromMetersPerSecond(volumeFlow.CubicMetersPerSecond / area.SquareMeters); - } - - public static Area operator /(VolumeFlow volumeFlow, Speed speed) - { - return Area.FromSquareMeters(volumeFlow.CubicMetersPerSecond / speed.MetersPerSecond); - } - - public static MassFlow operator *(VolumeFlow volumeFlow, Density density) - { - return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); - } - - public static MassFlow operator *(Density density, VolumeFlow volumeFlow) - { - return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); - } -#endif - } -} diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs index 20002b116a..bcd047a4f0 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/Quantity.cs @@ -1,46 +1,15 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Reflection; -using UnitsNet.InternalHelpers; - -#if WINDOWS_UWP - using FromValue = System.Double; -#else - using FromValue = UnitsNet.QuantityValue; -#endif namespace UnitsNet { -#if WINDOWS_UWP - internal -#else - public -#endif - partial class Quantity + internal partial class Quantity { - private static readonly Lazy InfosLazy; - static Quantity() { var quantityTypes = Enum.GetValues(typeof(QuantityType)).Cast().Except(new[] {QuantityType.Undefined}).ToArray(); Types = quantityTypes; Names = quantityTypes.Select(qt => qt.ToString()).ToArray(); - -#if !WINDOWS_UWP - // A bunch of reflection to enumerate quantity types, instantiate with the default constructor and return its QuantityInfo property - InfosLazy = new Lazy(() => typeof(Length) - .Wrap() - .Assembly - .GetExportedTypes() - .Where(typeof(IQuantity).IsAssignableFrom) - .Where(t => t.Wrap().IsClass || t.Wrap().IsValueType) // Future-proofing: Considering changing quantities from struct to class - .Select(Activator.CreateInstance) - .Cast() - .Select(q => q.QuantityInfo) - .OrderBy(q => q.Name) - .ToArray()); -#endif } /// @@ -53,13 +22,6 @@ static Quantity() /// public static string[] Names { get; } -#if !WINDOWS_UWP - /// - /// All quantity information objects, such as and . - /// - public static QuantityInfo[] Infos => InfosLazy.Value; -#endif - /// /// Dynamically construct a quantity. /// @@ -67,11 +29,7 @@ static Quantity() /// Unit enum value. /// An object. /// Unit value is not a know unit enum type. -#if WINDOWS_UWP - internal static IQuantity From(FromValue value, Enum unit) -#else - public static IQuantity From(FromValue value, Enum unit) -#endif + internal static IQuantity From(double value, Enum unit) { if (TryFrom(value, unit, out IQuantity quantity)) return quantity; @@ -79,10 +37,5 @@ public static IQuantity From(FromValue value, Enum unit) throw new ArgumentException( $"Unit value {unit} of type {unit.GetType()} is not a known unit enum type. Expected types like UnitsNet.Units.LengthUnit. Did you pass in a third-party enum type defined outside UnitsNet library?"); } - - public static IEnumerable GetQuantitiesWithBaseDimensions(BaseDimensions baseDimensions) - { - return InfosLazy.Value.Where(info => info.BaseDimensions.Equals(baseDimensions)); - } } } diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs index d58df984a1..b6b1c12c94 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/QuantityParser.cs @@ -31,15 +31,9 @@ namespace UnitsNet { -#if !WINDOWS_UWP - internal delegate TQuantity QuantityFromDelegate(QuantityValue value, TUnitType fromUnit) - where TQuantity : IQuantity - where TUnitType : Enum; -#else internal delegate TQuantity QuantityFromDelegate(double value, TUnitType fromUnit) where TQuantity : IQuantity where TUnitType : Enum; -#endif internal class QuantityParser { diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs index 6e2ab49532..43ee5d46bb 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitAbbreviationsCache.cs @@ -70,100 +70,6 @@ private void LoadGeneratedAbbreviations() } } - /// - /// Adds one or more unit abbreviation for the given unit enum value. - /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums - /// in order to or on them later. - /// - /// The unit enum value. - /// Unit abbreviations to add. - /// The type of unit enum. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviations) where TUnitType : Enum - { - MapUnitToAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviations); - } - - /// - /// Adds a unit abbreviation for the given unit enum value and sets it as the default. - /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums - /// in order to or on them later. - /// - /// The unit enum value. - /// Unit abbreviations to add as default. - /// The type of unit enum. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation) where TUnitType : Enum - { - MapUnitToDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviation); - } - - /// - /// Adds one or more unit abbreviation for the given unit enum value. - /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums - /// in order to or on them later. - /// - /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. - /// Unit abbreviations to add. - /// The type of unit enum. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(TUnitType unit, IFormatProvider formatProvider, params string[] abbreviations) where TUnitType : Enum - { - // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. - // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer - // http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum - var unitValue = Convert.ToInt32(unit); - var unitType = typeof(TUnitType); - - MapUnitToAbbreviation(unitType, unitValue, formatProvider, abbreviations); - } - - /// - /// Adds a unit abbreviation for the given unit enum value and sets it as the default. - /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums - /// in order to or on them later. - /// - /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. - /// Unit abbreviation to add as default. - /// The type of unit enum. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider, string abbreviation) where TUnitType : Enum - { - // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. - // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer - // http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum - var unitValue = Convert.ToInt32(unit); - var unitType = typeof(TUnitType); - - MapUnitToDefaultAbbreviation(unitType, unitValue, formatProvider, abbreviation); - } - /// /// Adds one or more unit abbreviation for the given unit enum value. /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums @@ -173,39 +79,12 @@ void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider for /// The unit enum value. /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations to add. - [PublicAPI] // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) + private void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) { PerformAbbreviationMapping(unitType, unitValue, formatProvider, false, abbreviations); } - /// - /// Adds a unit abbreviation for the given unit enum value and sets it as the default. - /// This is used to dynamically add abbreviations for existing unit enums such as or to extend with third-party unit enums - /// in order to or on them later. - /// - /// The unit enum type. - /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. - /// Unit abbreviation to add as default. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] string abbreviation) - { - PerformAbbreviationMapping(unitType, unitValue, formatProvider, true, abbreviation); - } - private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatProvider formatProvider, bool setAsDefault, [NotNull] params string[] abbreviations) { if (!unitType.Wrap().IsEnum) @@ -236,14 +115,8 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro /// The format provider to use for lookup. Defaults to if null. /// The type of unit enum. /// The default unit abbreviation string. - [PublicAPI] // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + internal string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum { var unitType = typeof(TUnitType); @@ -276,13 +149,7 @@ string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatP /// The unit enum value. /// The format provider to use for lookup. Defaults to if null. /// The default unit abbreviation string. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) + internal string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) { if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) { @@ -311,14 +178,8 @@ string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider form /// Enum value for unit. /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. - [PublicAPI] // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + internal string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum { return GetUnitAbbreviations(typeof(TUnitType), Convert.ToInt32(unit), formatProvider); } @@ -330,13 +191,7 @@ string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatP /// Enum value for unit. /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) + private string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; @@ -356,13 +211,7 @@ string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider form /// Enum type for unit. /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) + internal string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; diff --git a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs index 7e1d3e093f..77f280310c 100644 --- a/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs +++ b/UnitsNet.WindowsRuntimeComponent/CustomCode/UnitParser.cs @@ -51,13 +51,7 @@ static UnitParser() /// The format provider to use for lookup. Defaults to if null. /// /// - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider = null) where TUnitType : Enum + internal TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider = null) where TUnitType : Enum { return (TUnitType)Parse(unitAbbreviation, typeof(TUnitType)); } @@ -75,13 +69,7 @@ TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider /// Unit enum value, such as . /// No units match the abbreviation. /// More than one unit matches the abbreviation. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider = null) + internal Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider = null) { if (unitAbbreviation == null) throw new ArgumentNullException(nameof(unitAbbreviation)); unitAbbreviation = unitAbbreviation.Trim(); @@ -115,14 +103,8 @@ Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormat /// The unit enum value as out result. /// Type of unit enum. /// True if successful. - [PublicAPI] // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, out TUnitType unit) where TUnitType : Enum + internal bool TryParse(string unitAbbreviation, out TUnitType unit) where TUnitType : Enum { return TryParse(unitAbbreviation, null, out unit); } @@ -135,14 +117,8 @@ bool TryParse(string unitAbbreviation, out TUnitType unit) where TUni /// The unit enum value as out result. /// Type of unit enum. /// True if successful. - [PublicAPI] // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider, out TUnitType unit) where TUnitType : Enum + internal bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider, out TUnitType unit) where TUnitType : Enum { unit = default; @@ -160,13 +136,7 @@ bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider fo /// Type of unit enum. /// The unit enum value as out result. /// True if successful. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) + internal bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) { return TryParse(unitAbbreviation, unitType, null, out unit); } @@ -179,13 +149,7 @@ bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) /// The format provider to use for lookup. Defaults to if null. /// The unit enum value as out result. /// True if successful. - [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider, out Enum unit) + internal bool TryParse(string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider, out Enum unit) { if (unitAbbreviation == null) { diff --git a/UnitsNet.WindowsRuntimeComponent/IQuantity.cs b/UnitsNet.WindowsRuntimeComponent/IQuantity.cs index dcb6cdf144..9b2de86e65 100644 --- a/UnitsNet.WindowsRuntimeComponent/IQuantity.cs +++ b/UnitsNet.WindowsRuntimeComponent/IQuantity.cs @@ -28,7 +28,7 @@ namespace UnitsNet /// /// Represents a quantity. /// - public partial interface IQuantity + public interface IQuantity { /// /// The of this quantity. @@ -40,78 +40,19 @@ public partial interface IQuantity /// BaseDimensions Dimensions { get; } -#if !WINDOWS_UWP - /// - /// Information about the quantity type, such as unit values and names. - /// - QuantityInfo QuantityInfo { get; } -#endif - /// /// Dynamically convert to another unit representation. /// /// The unit enum value. The unit must be compatible, so for you should provide a value. /// Value converted to the specified unit. /// Wrong unit enum type was given. -#if WINDOWS_UWP double As(object unit); -#else - double As(Enum unit); -#endif /// /// The unit this quantity was constructed with or the BaseUnit if the default constructor was used. /// - -#if WINDOWS_UWP object Unit { get; } -#else - Enum Unit { get; } -#endif - -#if !WINDOWS_UWP - /// - /// 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. - IQuantity ToUnit(Enum unit); -#endif - } - -#if !WINDOWS_UWP - - public partial interface IQuantity - { - /// - /// Get string representation of value and unit. Using two significant digits after radix. - /// - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - string ToString([CanBeNull] IFormatProvider provider); - - /// - /// Get string representation of value and unit. - /// - /// The number of significant digits after the radix point. - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix); - /// - /// Get string representation of value and unit. - /// - /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." - /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. - /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. - string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args); - } - -#else - - public partial interface IQuantity - { /// /// Get string representation of value and unit. Using two significant digits after radix. /// @@ -136,30 +77,4 @@ public partial interface IQuantity /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args); } - -#endif - -#if !WINDOWS_UWP - public interface IQuantity : IQuantity where TUnitType : Enum - { - /// - /// Convert to a unit representation . - /// - /// Value converted to the specified unit. - double As(TUnitType unit); - - /// - new TUnitType Unit { get; } - - /// - new QuantityInfo QuantityInfo { get; } - - /// - /// Change the default unit representation of the quantity, which affects things like . - /// - /// - /// - IQuantity ToUnit(TUnitType unit); - } -#endif } diff --git a/UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs b/UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs index 299572c99b..4865a20621 100644 --- a/UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs +++ b/UnitsNet.WindowsRuntimeComponent/Properties/AssemblyInfo.WindowsRuntimeComponent.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -19,15 +19,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; -#if WINDOWS_UWP using System.Runtime.InteropServices; [assembly: ComVisible(false)] -#endif [assembly: AssemblyTitle("Units.NET")] [assembly: AssemblyDescription("Units.NET gives you all the common units of measurement and the conversions between them. It is light-weight, unit tested and supports PCL.")] diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs b/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs index 6eabf7ddbe..eac293d5fd 100644 --- a/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs +++ b/UnitsNet.WindowsRuntimeComponent/QuantityInfo.cs @@ -35,14 +35,9 @@ namespace UnitsNet /// unit representation. /// /// - /// Typically you obtain this by looking it up via . + /// Typically you obtain this by looking it up via quantities, like or . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class QuantityInfo + internal class QuantityInfo { private static readonly string UnitEnumNamespace = typeof(LengthUnit).Namespace; @@ -127,47 +122,4 @@ public QuantityInfo(QuantityType quantityType, [NotNull] Enum[] units, [NotNull] /// public BaseDimensions BaseDimensions { get; } } - -#if !WINDOWS_UWP - /// - /// - /// This is a specialization of , for when the unit type is known. - /// Typically you obtain this by looking it up statically from or - /// , or dynamically via . - /// - /// The unit enum type, such as . - public class QuantityInfo : QuantityInfo - where TUnit : Enum - { - public QuantityInfo(QuantityType quantityType, TUnit[] units, TUnit baseUnit, IQuantity zero, BaseDimensions baseDimensions) - : base(quantityType, units.Cast().ToArray(), baseUnit, zero, baseDimensions) - { - Zero = zero; - UnitInfos = units.Select(unit => new UnitInfo(unit)).ToArray(); - Units = units; - BaseUnitInfo = new UnitInfo(baseUnit); - BaseUnit = BaseUnitInfo.Value; - } - - /// - public new UnitInfo[] UnitInfos { get; } - - /// - [Obsolete("This property is deprecated and will be removed at a future release. Please use the UnitInfos property.")] - public new TUnit[] Units { get; } - - /// - public new UnitInfo BaseUnitInfo { get; } - - /// - [Obsolete("This property is deprecated and will be removed at a future release. Please use the BaseUnitInfo property.")] - public new TUnit BaseUnit { get; } - - /// - public new IQuantity Zero { get; } - - /// - public new TUnit UnitType { get; } - } -#endif } diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs b/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs index d7e6be736b..8ca4c034dc 100644 --- a/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs +++ b/UnitsNet.WindowsRuntimeComponent/QuantityNotFoundException.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -27,12 +27,7 @@ namespace UnitsNet /// Quantity type was not found. This is typically thrown for dynamic conversions, /// such as . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class QuantityNotFoundException : UnitsNetException + internal class QuantityNotFoundException : UnitsNetException { public QuantityNotFoundException() { @@ -46,4 +41,4 @@ public QuantityNotFoundException(string message, Exception innerException) : bas { } } -} \ No newline at end of file +} diff --git a/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs b/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs deleted file mode 100644 index e1385fa68e..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/QuantityValue.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// Operator overloads not supported in Windows Runtime Components, we use 'double' type instead - -using UnitsNet.InternalHelpers; - -#if !WINDOWS_UWP -namespace UnitsNet -{ - /// - /// A type that supports implicit cast from all .NET numeric types, in order to avoid a large number of overloads - /// and binary size for all From(value, unit) factory methods, for each of the 700+ units in the library. - /// stores the value internally with the proper type to preserve the range or precision of the original value: - /// - /// for [byte, short, int, long, float, double] - /// for [decimal] to preserve the 128-bit precision - /// - /// - /// - /// At the time of this writing, this reduces the number of From(value, unit) overloads to 1/4th: - /// From 8 (int, long, double, decimal + each nullable) down to 2 (QuantityValue and QuantityValue?). - /// This also adds more numeric types with no extra overhead, such as float, short and byte. - /// - public struct QuantityValue - { - /// - /// Value assigned when implicitly casting from all numeric types except , since - /// has the greatest range and is 64 bits versus 128 bits for . - /// - private readonly double? _value; - - /// - /// Value assigned when implicitly casting from type, since it has a greater precision than - /// and we want to preserve that when constructing quantities that use - /// as their value type. - /// - private readonly decimal? _valueDecimal; - - private QuantityValue(double val) - { - _value = Guard.EnsureValidNumber(val, nameof(val)); - _valueDecimal = null; - } - - private QuantityValue(decimal val) - { - _valueDecimal = val; - _value = null; - } - - #region To QuantityValue - -#pragma warning disable 618 - // Prefer double for integer types, since most quantities use that type as of now and - // that avoids unnecessary casts back and forth. - // If we later change to use decimal more, we should revisit this. - public static implicit operator QuantityValue(byte val) => new QuantityValue((double) val); - public static implicit operator QuantityValue(short val) => new QuantityValue((double) val); - public static implicit operator QuantityValue(int val) => new QuantityValue((double) val); - public static implicit operator QuantityValue(long val) => new QuantityValue((double) val); - public static implicit operator QuantityValue(float val) => new QuantityValue(val); // double - public static implicit operator QuantityValue(double val) => new QuantityValue(val); // double - public static implicit operator QuantityValue(decimal val) => new QuantityValue(val); // decimal -#pragma warning restore 618 - - #endregion - - #region To double - - public static explicit operator double(QuantityValue number) - { - // double -> decimal -> zero (since we can't implement the default struct ctor) - return number._value ?? (double) number._valueDecimal.GetValueOrDefault(); - } - - #endregion - - #region To decimal - - public static explicit operator decimal(QuantityValue number) - { - // decimal -> double -> zero (since we can't implement the default struct ctor) - return number._valueDecimal ?? (decimal) number._value.GetValueOrDefault(); - } - - #endregion - - public override string ToString() - { - return _value.HasValue ? _value.ToString() : _valueDecimal.ToString(); - } - } -} -#endif diff --git a/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs b/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs index 817601ddb2..158e0ee056 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs +++ b/UnitsNet.WindowsRuntimeComponent/UnitConverter.cs @@ -23,22 +23,16 @@ using System.Globalization; using System.Linq; using System.Reflection; +using JetBrains.Annotations; using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture = System.String; -using FromValue = System.Double; -#else -using Culture = System.IFormatProvider; -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Convert between units of a quantity, such as converting from meters to centimeters of a given length. /// + [PublicAPI] public static class UnitConverter { private static readonly string UnitTypeNamespace = typeof(LengthUnit).Namespace; @@ -60,12 +54,7 @@ public static class UnitConverter /// From unit enum value. /// To unit enum value, must be compatible with . /// The converted value in the new unit representation. -#if WINDOWS_UWP - internal -#else - public -#endif - static double Convert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue) + internal static double Convert(double fromValue, Enum fromUnitValue, Enum toUnitValue) { return Quantity .From(fromValue, fromUnitValue) @@ -80,12 +69,7 @@ static double Convert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue) /// To unit enum value, must be compatible with . /// The converted value, if successful. Otherwise default. /// True if successful. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryConvert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) + internal static bool TryConvert(double fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) { convertedValue = 0; if (!Quantity.TryFrom(fromValue, fromUnitValue, out IQuantity from)) return false; @@ -131,7 +115,7 @@ static bool TryConvert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue /// No quantities were found that match . /// No units match the abbreviation. /// More than one unit matches the abbreviation. - public static double ConvertByName(FromValue fromValue, string quantityName, string fromUnit, string toUnit) + public static double ConvertByName(double fromValue, string quantityName, string fromUnit, string toUnit) { if (!TryGetUnitType(quantityName, out Type unitType)) throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); @@ -180,7 +164,7 @@ public static double ConvertByName(FromValue fromValue, string quantityName, str /// Result if conversion was successful, 0 if not. /// bool ok = TryConvertByName(5, "Length", "Meter", "Centimeter", out double centimeters); // 500 /// True if conversion was successful. - public static bool TryConvertByName(FromValue inputValue, string quantityName, string fromUnit, string toUnit, out double result) + public static bool TryConvertByName(double inputValue, string quantityName, string fromUnit, string toUnit, out double result) { result = 0d; @@ -223,7 +207,7 @@ public static bool TryConvertByName(FromValue inputValue, string quantityName, s /// /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// Output value as the result of converting to . - public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) + public static double ConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) { // WindowsRuntimeComponent does not support default values on public methods // ReSharper disable once IntroduceOptionalParameters.Global @@ -263,7 +247,7 @@ public static double ConvertByAbbreviation(FromValue fromValue, string quantityN /// are mapped to the abbreviation. /// /// More than one unit matches the abbreviation. - public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string culture) + public static double ConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string culture) { if (!TryGetQuantityType(quantityName, out var quantityType)) throw new QuantityNotFoundException($"The given quantity name was not found: {quantityName}"); @@ -312,7 +296,7 @@ public static double ConvertByAbbreviation(FromValue fromValue, string quantityN /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) + public static bool TryConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) { return TryConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, out result, null); } @@ -345,7 +329,7 @@ public static bool TryConvertByAbbreviation(FromValue fromValue, string quantity /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, + public static bool TryConvertByAbbreviation(double fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, string culture) { result = 0d; @@ -394,7 +378,7 @@ private static MethodInfo GetStaticFromMethod(Type quantityType, Type unitType) .Single(m => m.Name == "From" && m.IsStatic && m.IsPublic && - HasParameterTypes(m, typeof(FromValue), unitType) && + HasParameterTypes(m, typeof(double), unitType) && m.ReturnType == quantityType); } diff --git a/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs b/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs index e1f3f8004a..94f16441ab 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs +++ b/UnitsNet.WindowsRuntimeComponent/UnitInfo.cs @@ -33,12 +33,7 @@ namespace UnitsNet /// /// Typically you obtain this by looking it up via . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitInfo + internal class UnitInfo { public UnitInfo(Enum value) { @@ -57,24 +52,4 @@ public UnitInfo(Enum value) /// public string Name { get; } } - -#if !WINDOWS_UWP - /// - /// - /// This is a specialization of , for when the unit type is known. - /// Typically you obtain this by looking it up statically from or - /// or dynamically via . - /// - /// The unit enum type, such as . - public class UnitInfo : UnitInfo - where TUnit : Enum - { - public UnitInfo(TUnit value) : base(value) - { - Value = value; - } - - public new TUnit Value { get; } - } -#endif } diff --git a/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs b/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs index 02d54f051c..17351536e9 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs +++ b/UnitsNet.WindowsRuntimeComponent/UnitNotFoundException.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -27,12 +27,7 @@ namespace UnitsNet /// Unit was not found. This is typically thrown for dynamic conversions, /// such as . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitNotFoundException : UnitsNetException + internal class UnitNotFoundException : UnitsNetException { public UnitNotFoundException() { @@ -46,4 +41,4 @@ public UnitNotFoundException(string message, Exception innerException) : base(me { } } -} \ No newline at end of file +} diff --git a/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs b/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs index 695626b763..983539d343 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs +++ b/UnitsNet.WindowsRuntimeComponent/UnitSystem.cs @@ -20,16 +20,11 @@ // THE SOFTWARE. using System; -using System.Text; using UnitsNet.Units; namespace UnitsNet { -#if !WINDOWS_UWP - public sealed partial class UnitSystem : IEquatable { } -#endif - - public sealed partial class UnitSystem + public sealed class UnitSystem { /// /// Creates an instance of a unit system with the specified base units. @@ -67,9 +62,7 @@ public override bool Equals(object obj) return Equals((UnitSystem)obj); } -#if WINDOWS_UWP [Windows.Foundation.Metadata.DefaultOverload] -#endif public bool Equals(UnitSystem other) { if(other is null) @@ -78,34 +71,6 @@ public bool Equals(UnitSystem other) return BaseUnits.Equals(other.BaseUnits); } -#if !WINDOWS_UWP - - /// - /// Checks if this instance is equal to another. - /// - /// The left instance. - /// The right instance. - /// True if equal, otherwise false. - /// - public static bool operator ==(UnitSystem left, UnitSystem right) - { - return left is null ? right is null : left.Equals(right); - } - - /// - /// Checks if this instance is equal to another. - /// - /// The left instance. - /// The right instance. - /// True if equal, otherwise false. - /// - public static bool operator !=(UnitSystem left, UnitSystem right) - { - return !(left == right); - } - -#endif - /// public override int GetHashCode() { diff --git a/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs b/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs index 44d47ba6e0..fadfbce6f4 100644 --- a/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs +++ b/UnitsNet.WindowsRuntimeComponent/UnitsNetException.cs @@ -23,12 +23,7 @@ namespace UnitsNet { -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitsNetException : Exception + internal class UnitsNetException : Exception { public UnitsNetException() { @@ -45,4 +40,4 @@ public UnitsNetException(string message, Exception innerException) : base(messag HResult = 1; } } -} \ No newline at end of file +} From e3d356a412ccbdcc828bee8597947fe9aa4d0e03 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Tue, 12 Feb 2019 23:41:27 +0100 Subject: [PATCH 04/10] R#: Ignore namespace in CustomCode folder --- .../UnitsNet.WindowsRuntimeComponent.csproj.DotSettings | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj.DotSettings diff --git a/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj.DotSettings b/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj.DotSettings new file mode 100644 index 0000000000..0b0edaecd0 --- /dev/null +++ b/UnitsNet.WindowsRuntimeComponent/UnitsNet.WindowsRuntimeComponent.csproj.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file From 9982831e9a69383941d17d990b503c7c222a4be8 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Tue, 12 Feb 2019 23:59:22 +0100 Subject: [PATCH 05/10] Change build script to opt-in to WRC --- Build/build-functions.psm1 | 23 +++++++++++++++++------ Build/build.ps1 | 4 ++-- build-skip-uwp.bat => build-with-wrc.bat | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) rename build-skip-uwp.bat => build-with-wrc.bat (63%) diff --git a/Build/build-functions.psm1 b/Build/build-functions.psm1 index 549b9adca0..1a60be8fdc 100644 --- a/Build/build-functions.psm1 +++ b/Build/build-functions.psm1 @@ -11,7 +11,7 @@ if ($msbuild) { function Remove-ArtifactsDir { write-host -foreground blue "Clean up...`n" - rm $artifactsDir -Recurse -ErrorAction Ignore + rm $artifactsDir -Recurse -Force -ErrorAction Stop write-host -foreground blue "Clean up...END`n" } @@ -23,10 +23,17 @@ function Update-GeneratedCode { & "$root\UnitsNet\Scripts\GenerateUnits.ps1" if ($lastexitcode -ne 0) { exit 1 } + if (-not $IncludeWindowsRuntimeComponent) { + write-host -foreground yellow "Skipping WindowsRuntimeComponent code regen." + } else { + & "$root\UnitsNet.WindowsRuntimeComponent\Scripts\GenerateUnits.ps1" + if ($lastexitcode -ne 0) { exit 1 } + } + write-host -foreground blue "Generate code...END`n" } -function Start-Build([boolean] $skipUWP = $false) { +function Start-Build([boolean] $IncludeWindowsRuntimeComponent = $false) { write-host -foreground blue "Start-Build...`n---" $fileLoggerArg = "/logger:FileLogger,Microsoft.Build;logfile=$testReportDir\UnitsNet.msbuild.log" @@ -38,9 +45,9 @@ function Start-Build([boolean] $skipUWP = $false) { dotnet build --configuration Release "$root\UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg if ($lastexitcode -ne 0) { exit 1 } - if ($skipUWP -eq $true) + if (-not $IncludeWindowsRuntimeComponent) { - write-host -foreground yellow "Skipping WindowsRuntimeComponent build by user-specified flag." + write-host -foreground yellow "Skipping WindowsRuntimeComponent build." } else { @@ -98,8 +105,12 @@ function Start-PackNugets { if ($lastexitcode -ne 0) { exit 1 } } - write-host -foreground yellow "WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead" - & $nuget pack "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir" + if (-not $IncludeWindowsRuntimeComponent) { + write-host -foreground yellow "Skipping WindowsRuntimeComponent nuget pack." + } else { + write-host -foreground yellow "WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead" + & $nuget pack "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir" + } write-host -foreground blue "Pack nugets...END`n" } diff --git a/Build/build.ps1 b/Build/build.ps1 index 6a647d95da..70d00deec0 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -20,7 +20,7 @@ #> [CmdletBinding()] Param( - [switch] $skipUWP + [switch] $IncludeWindowsRuntimeComponent ) remove-module build-functions -ErrorAction SilentlyContinue @@ -29,7 +29,7 @@ import-module $PSScriptRoot\build-functions.psm1 try { Remove-ArtifactsDir Update-GeneratedCode - Start-Build $skipUWP + Start-Build -IncludeWindowsRuntimeComponent $IncludeWindowsRuntimeComponent Start-Tests Start-PackNugets Compress-ArtifactsAsZip diff --git a/build-skip-uwp.bat b/build-with-wrc.bat similarity index 63% rename from build-skip-uwp.bat rename to build-with-wrc.bat index 25db2e1fee..4d21c3e362 100644 --- a/build-skip-uwp.bat +++ b/build-with-wrc.bat @@ -1,2 +1,2 @@ @echo off -powershell -ExecutionPolicy Bypass -NoProfile -File %~dp0\Build\build.ps1 -skipUWP +powershell -ExecutionPolicy Bypass -NoProfile -File %~dp0\Build\build.ps1 -IncludeWindowsRuntimeComponent From 98eb2576259643836108b174c09b5de343d322d4 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Wed, 13 Feb 2019 00:11:11 +0100 Subject: [PATCH 06/10] Simplify NetFramework scripts --- .../Quantities/Acceleration.NetFramework.g.cs | 2 - .../AmountOfSubstance.NetFramework.g.cs | 2 - .../AmplitudeRatio.NetFramework.g.cs | 2 - .../Quantities/Angle.NetFramework.g.cs | 2 - .../ApparentEnergy.NetFramework.g.cs | 2 - .../ApparentPower.NetFramework.g.cs | 2 - .../Quantities/Area.NetFramework.g.cs | 2 - .../Quantities/AreaDensity.NetFramework.g.cs | 2 - .../AreaMomentOfInertia.NetFramework.g.cs | 2 - .../Quantities/BitRate.NetFramework.g.cs | 2 - ...eSpecificFuelConsumption.NetFramework.g.cs | 2 - .../Quantities/Capacitance.NetFramework.g.cs | 2 - ...icientOfThermalExpansion.NetFramework.g.cs | 2 - .../Quantities/Density.NetFramework.g.cs | 2 - .../Quantities/Duration.NetFramework.g.cs | 2 - .../DynamicViscosity.NetFramework.g.cs | 2 - .../ElectricAdmittance.NetFramework.g.cs | 2 - .../ElectricCharge.NetFramework.g.cs | 2 - .../ElectricChargeDensity.NetFramework.g.cs | 2 - .../ElectricConductance.NetFramework.g.cs | 2 - .../ElectricConductivity.NetFramework.g.cs | 2 - .../ElectricCurrent.NetFramework.g.cs | 2 - .../ElectricCurrentDensity.NetFramework.g.cs | 2 - .../ElectricCurrentGradient.NetFramework.g.cs | 2 - .../ElectricField.NetFramework.g.cs | 2 - .../ElectricInductance.NetFramework.g.cs | 2 - .../ElectricPotential.NetFramework.g.cs | 2 - .../ElectricPotentialAc.NetFramework.g.cs | 2 - .../ElectricPotentialDc.NetFramework.g.cs | 2 - .../ElectricResistance.NetFramework.g.cs | 2 - .../ElectricResistivity.NetFramework.g.cs | 2 - .../Quantities/Energy.NetFramework.g.cs | 2 - .../Quantities/Entropy.NetFramework.g.cs | 2 - .../Quantities/Force.NetFramework.g.cs | 2 - .../ForceChangeRate.NetFramework.g.cs | 2 - .../ForcePerLength.NetFramework.g.cs | 2 - .../Quantities/Frequency.NetFramework.g.cs | 2 - .../Quantities/HeatFlux.NetFramework.g.cs | 2 - .../HeatTransferCoefficient.NetFramework.g.cs | 2 - .../Quantities/Illuminance.NetFramework.g.cs | 2 - .../Quantities/Information.NetFramework.g.cs | 2 - .../Quantities/Irradiance.NetFramework.g.cs | 2 - .../Quantities/Irradiation.NetFramework.g.cs | 2 - .../KinematicViscosity.NetFramework.g.cs | 2 - .../Quantities/LapseRate.NetFramework.g.cs | 2 - .../Quantities/Length.NetFramework.g.cs | 2 - .../Quantities/Level.NetFramework.g.cs | 2 - .../LinearDensity.NetFramework.g.cs | 2 - .../Quantities/LuminousFlux.NetFramework.g.cs | 2 - .../LuminousIntensity.NetFramework.g.cs | 2 - .../MagneticField.NetFramework.g.cs | 2 - .../Quantities/MagneticFlux.NetFramework.g.cs | 2 - .../Magnetization.NetFramework.g.cs | 2 - .../Quantities/Mass.NetFramework.g.cs | 2 - .../Quantities/MassFlow.NetFramework.g.cs | 2 - .../Quantities/MassFlux.NetFramework.g.cs | 2 - .../MassMomentOfInertia.NetFramework.g.cs | 2 - .../Quantities/MolarEnergy.NetFramework.g.cs | 2 - .../Quantities/MolarEntropy.NetFramework.g.cs | 2 - .../Quantities/MolarMass.NetFramework.g.cs | 2 - .../Quantities/Molarity.NetFramework.g.cs | 2 - .../Quantities/Permeability.NetFramework.g.cs | 2 - .../Quantities/Permittivity.NetFramework.g.cs | 2 - .../Quantities/Power.NetFramework.g.cs | 2 - .../Quantities/PowerDensity.NetFramework.g.cs | 2 - .../Quantities/PowerRatio.NetFramework.g.cs | 2 - .../Quantities/Pressure.NetFramework.g.cs | 2 - .../PressureChangeRate.NetFramework.g.cs | 2 - .../Quantities/Ratio.NetFramework.g.cs | 2 - .../ReactiveEnergy.NetFramework.g.cs | 2 - .../ReactivePower.NetFramework.g.cs | 2 - .../RotationalAcceleration.NetFramework.g.cs | 2 - .../RotationalSpeed.NetFramework.g.cs | 2 - .../RotationalStiffness.NetFramework.g.cs | 2 - ...tionalStiffnessPerLength.NetFramework.g.cs | 2 - .../Quantities/SolidAngle.NetFramework.g.cs | 2 - .../SpecificEnergy.NetFramework.g.cs | 2 - .../SpecificEntropy.NetFramework.g.cs | 2 - .../SpecificVolume.NetFramework.g.cs | 2 - .../SpecificWeight.NetFramework.g.cs | 2 - .../Quantities/Speed.NetFramework.g.cs | 2 - .../Quantities/Temperature.NetFramework.g.cs | 2 - .../TemperatureChangeRate.NetFramework.g.cs | 2 - .../TemperatureDelta.NetFramework.g.cs | 2 - .../ThermalConductivity.NetFramework.g.cs | 2 - .../ThermalResistance.NetFramework.g.cs | 2 - .../Quantities/Torque.NetFramework.g.cs | 2 - .../Quantities/VitaminA.NetFramework.g.cs | 2 - .../Quantities/Volume.NetFramework.g.cs | 2 - .../Quantities/VolumeFlow.NetFramework.g.cs | 2 - UnitsNet/GeneratedCode/Quantity.g.cs | 58 +----- UnitsNet/Scripts/GenerateUnits.ps1 | 11 +- .../Include-GenerateQuantitySourceCode.ps1 | 183 ++---------------- ...clude-GenerateStaticQuantitySourceCode.ps1 | 58 +----- UnitsNet/Scripts/Types.psm1 | 7 + 95 files changed, 40 insertions(+), 457 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 08c74e0f64..83b820ca4f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -72,7 +72,6 @@ static Acceleration() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Acceleration(double numericValue, AccelerationUnit unit) { @@ -606,7 +605,6 @@ public int CompareTo(object obj) return CompareTo(objAcceleration); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Acceleration other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 7c762297c0..a4dbb5a462 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -72,7 +72,6 @@ static AmountOfSubstance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit) { @@ -634,7 +633,6 @@ public int CompareTo(object obj) return CompareTo(objAmountOfSubstance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(AmountOfSubstance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 0e5f5e9d8d..ca79f24e68 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -72,7 +72,6 @@ static AmplitudeRatio() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit) { @@ -488,7 +487,6 @@ public int CompareTo(object obj) return CompareTo(objAmplitudeRatio); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(AmplitudeRatio other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 448d1272fc..b75174feb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -72,7 +72,6 @@ static Angle() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Angle(double numericValue, AngleUnit unit) { @@ -620,7 +619,6 @@ public int CompareTo(object obj) return CompareTo(objAngle); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Angle other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index d392ec317d..5d7af24690 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -72,7 +72,6 @@ static ApparentEnergy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ApparentEnergy(double numericValue, ApparentEnergyUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objApparentEnergy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ApparentEnergy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 4df93933c0..1504bb9e0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -72,7 +72,6 @@ static ApparentPower() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ApparentPower(double numericValue, ApparentPowerUnit unit) { @@ -480,7 +479,6 @@ public int CompareTo(object obj) return CompareTo(objApparentPower); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ApparentPower other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 2be4dfef99..f492c0b1c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -72,7 +72,6 @@ static Area() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Area(double numericValue, AreaUnit unit) { @@ -606,7 +605,6 @@ public int CompareTo(object obj) return CompareTo(objArea); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Area other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 07534ebf43..9bc62f9ffe 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -72,7 +72,6 @@ static AreaDensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public AreaDensity(double numericValue, AreaDensityUnit unit) { @@ -438,7 +437,6 @@ public int CompareTo(object obj) return CompareTo(objAreaDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(AreaDensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 11e66f8d0b..d0998e2c48 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -72,7 +72,6 @@ static AreaMomentOfInertia() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit) { @@ -508,7 +507,6 @@ public int CompareTo(object obj) return CompareTo(objAreaMomentOfInertia); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(AreaMomentOfInertia other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 07e9bb677b..14edd9e1bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -75,7 +75,6 @@ static BitRate() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public BitRate(decimal numericValue, BitRateUnit unit) { @@ -791,7 +790,6 @@ public int CompareTo(object obj) return CompareTo(objBitRate); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(BitRate other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 458d573a27..7ed33d9a42 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -72,7 +72,6 @@ static BrakeSpecificFuelConsumption() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsumptionUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objBrakeSpecificFuelConsumption); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(BrakeSpecificFuelConsumption other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 2fd74cfec4..01c915f557 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -75,7 +75,6 @@ static Capacitance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Capacitance(double numericValue, CapacitanceUnit unit) { @@ -525,7 +524,6 @@ public int CompareTo(object obj) return CompareTo(objCapacitance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Capacitance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 866a1d2785..278892b6e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -72,7 +72,6 @@ static CoefficientOfThermalExpansion() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public CoefficientOfThermalExpansion(double numericValue, CoefficientOfThermalExpansionUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objCoefficientOfThermalExpansion); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(CoefficientOfThermalExpansion other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 4f19f6bd90..52efcf7933 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -75,7 +75,6 @@ static Density() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Density(double numericValue, DensityUnit unit) { @@ -973,7 +972,6 @@ public int CompareTo(object obj) return CompareTo(objDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Density other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 6c6ee09929..8a7f47811f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -72,7 +72,6 @@ static Duration() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Duration(double numericValue, DurationUnit unit) { @@ -564,7 +563,6 @@ public int CompareTo(object obj) return CompareTo(objDuration); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Duration other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index de717c8a67..ded80e3617 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -75,7 +75,6 @@ static DynamicViscosity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public DynamicViscosity(double numericValue, DynamicViscosityUnit unit) { @@ -511,7 +510,6 @@ public int CompareTo(object obj) return CompareTo(objDynamicViscosity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(DynamicViscosity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index c3c3f762be..a9b6b312da 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricAdmittance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricAdmittance(double numericValue, ElectricAdmittanceUnit unit) { @@ -480,7 +479,6 @@ public int CompareTo(object obj) return CompareTo(objElectricAdmittance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricAdmittance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 24ad88a94f..b4363c916e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricCharge() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricCharge(double numericValue, ElectricChargeUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objElectricCharge); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricCharge other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 86ca05b137..c7f047be86 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricChargeDensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricChargeDensity(double numericValue, ElectricChargeDensityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objElectricChargeDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricChargeDensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 0d43bfac70..dc7f49d3c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricConductance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricConductance(double numericValue, ElectricConductanceUnit unit) { @@ -469,7 +468,6 @@ public int CompareTo(object obj) return CompareTo(objElectricConductance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricConductance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 291cbeb664..6ef949a897 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricConductivity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricConductivity(double numericValue, ElectricConductivityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objElectricConductivity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricConductivity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 9855f80955..8f9ba674a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricCurrent() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricCurrent(double numericValue, ElectricCurrentUnit unit) { @@ -536,7 +535,6 @@ public int CompareTo(object obj) return CompareTo(objElectricCurrent); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricCurrent other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 9fc77b95f5..91e9195651 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricCurrentDensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricCurrentDensity(double numericValue, ElectricCurrentDensityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objElectricCurrentDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricCurrentDensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 24f3b659ac..07b4422f6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricCurrentGradient() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricCurrentGradient(double numericValue, ElectricCurrentGradientUnit unit) { @@ -438,7 +437,6 @@ public int CompareTo(object obj) return CompareTo(objElectricCurrentGradient); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricCurrentGradient other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index a04bf61fef..5e3d13b63d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricField() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricField(double numericValue, ElectricFieldUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objElectricField); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricField other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index b29b667963..9331aba45f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricInductance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricInductance(double numericValue, ElectricInductanceUnit unit) { @@ -483,7 +482,6 @@ public int CompareTo(object obj) return CompareTo(objElectricInductance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricInductance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 710a2ea148..8d245bb703 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricPotential() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricPotential(double numericValue, ElectricPotentialUnit unit) { @@ -494,7 +493,6 @@ public int CompareTo(object obj) return CompareTo(objElectricPotential); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricPotential other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 5f0224696a..8309820958 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricPotentialAc() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricPotentialAc(double numericValue, ElectricPotentialAcUnit unit) { @@ -494,7 +493,6 @@ public int CompareTo(object obj) return CompareTo(objElectricPotentialAc); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricPotentialAc other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index fb94318231..9094e21ab0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricPotentialDc() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricPotentialDc(double numericValue, ElectricPotentialDcUnit unit) { @@ -494,7 +493,6 @@ public int CompareTo(object obj) return CompareTo(objElectricPotentialDc); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricPotentialDc other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index c7b790a1fb..8526a8900b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -72,7 +72,6 @@ static ElectricResistance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricResistance(double numericValue, ElectricResistanceUnit unit) { @@ -494,7 +493,6 @@ public int CompareTo(object obj) return CompareTo(objElectricResistance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricResistance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index eb69134c5a..bd7baa0d41 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -75,7 +75,6 @@ static ElectricResistivity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ElectricResistivity(double numericValue, ElectricResistivityUnit unit) { @@ -623,7 +622,6 @@ public int CompareTo(object obj) return CompareTo(objElectricResistivity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ElectricResistivity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 1c9e13d3d5..45b185b837 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -72,7 +72,6 @@ static Energy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Energy(double numericValue, EnergyUnit unit) { @@ -732,7 +731,6 @@ public int CompareTo(object obj) return CompareTo(objEnergy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Energy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index a97168aa66..f7d20f51a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -72,7 +72,6 @@ static Entropy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Entropy(double numericValue, EntropyUnit unit) { @@ -522,7 +521,6 @@ public int CompareTo(object obj) return CompareTo(objEntropy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Entropy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index cd94e9f5cb..545fe84731 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -72,7 +72,6 @@ static Force() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Force(double numericValue, ForceUnit unit) { @@ -606,7 +605,6 @@ public int CompareTo(object obj) return CompareTo(objForce); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Force other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index fd74687584..0ca002b167 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -72,7 +72,6 @@ static ForceChangeRate() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ForceChangeRate(double numericValue, ForceChangeRateUnit unit) { @@ -578,7 +577,6 @@ public int CompareTo(object obj) return CompareTo(objForceChangeRate); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ForceChangeRate other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 8fa64096d2..b658e1e0fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -72,7 +72,6 @@ static ForcePerLength() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ForcePerLength(double numericValue, ForcePerLengthUnit unit) { @@ -550,7 +549,6 @@ public int CompareTo(object obj) return CompareTo(objForcePerLength); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ForcePerLength other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index d6f2651bca..2a9033426b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -72,7 +72,6 @@ static Frequency() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Frequency(double numericValue, FrequencyUnit unit) { @@ -536,7 +535,6 @@ public int CompareTo(object obj) return CompareTo(objFrequency); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Frequency other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 35a53dd3b2..5ccb062530 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -72,7 +72,6 @@ static HeatFlux() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public HeatFlux(double numericValue, HeatFluxUnit unit) { @@ -676,7 +675,6 @@ public int CompareTo(object obj) return CompareTo(objHeatFlux); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(HeatFlux other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 49f1ef023b..32ba6965e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -72,7 +72,6 @@ static HeatTransferCoefficient() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public HeatTransferCoefficient(double numericValue, HeatTransferCoefficientUnit unit) { @@ -452,7 +451,6 @@ public int CompareTo(object obj) return CompareTo(objHeatTransferCoefficient); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(HeatTransferCoefficient other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index db9d9fcd5d..d60e81320a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -75,7 +75,6 @@ static Illuminance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Illuminance(double numericValue, IlluminanceUnit unit) { @@ -483,7 +482,6 @@ public int CompareTo(object obj) return CompareTo(objIlluminance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Illuminance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 051a50ef17..3f6d0dc384 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -72,7 +72,6 @@ static Information() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Information(decimal numericValue, InformationUnit unit) { @@ -788,7 +787,6 @@ public int CompareTo(object obj) return CompareTo(objInformation); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Information other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 2fd9939174..f22507dda4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -72,7 +72,6 @@ static Irradiance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Irradiance(double numericValue, IrradianceUnit unit) { @@ -620,7 +619,6 @@ public int CompareTo(object obj) return CompareTo(objIrradiance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Irradiance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 13095b9d4f..ddabaa6b31 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -75,7 +75,6 @@ static Irradiation() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Irradiation(double numericValue, IrradiationUnit unit) { @@ -483,7 +482,6 @@ public int CompareTo(object obj) return CompareTo(objIrradiation); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Irradiation other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index cc83187a0a..c2751d7225 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -75,7 +75,6 @@ static KinematicViscosity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public KinematicViscosity(double numericValue, KinematicViscosityUnit unit) { @@ -539,7 +538,6 @@ public int CompareTo(object obj) return CompareTo(objKinematicViscosity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(KinematicViscosity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1faa9dd594..fe776b9203 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -72,7 +72,6 @@ static LapseRate() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public LapseRate(double numericValue, LapseRateUnit unit) { @@ -438,7 +437,6 @@ public int CompareTo(object obj) return CompareTo(objLapseRate); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(LapseRate other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 1ce0df6bbf..5308f01d30 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -72,7 +72,6 @@ static Length() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Length(double numericValue, LengthUnit unit) { @@ -732,7 +731,6 @@ public int CompareTo(object obj) return CompareTo(objLength); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Length other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 2161050829..8b8cb6e140 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -72,7 +72,6 @@ static Level() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Level(double numericValue, LevelUnit unit) { @@ -460,7 +459,6 @@ public int CompareTo(object obj) return CompareTo(objLevel); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Level other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index f476bab98a..011570dd35 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -75,7 +75,6 @@ static LinearDensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public LinearDensity(double numericValue, LinearDensityUnit unit) { @@ -469,7 +468,6 @@ public int CompareTo(object obj) return CompareTo(objLinearDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(LinearDensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 7705bd4000..4642c0b18c 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -75,7 +75,6 @@ static LuminousFlux() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public LuminousFlux(double numericValue, LuminousFluxUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objLuminousFlux); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(LuminousFlux other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 67862e4693..b14f8b051c 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -75,7 +75,6 @@ static LuminousIntensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public LuminousIntensity(double numericValue, LuminousIntensityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objLuminousIntensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(LuminousIntensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index a72238762c..ee0f80a664 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -75,7 +75,6 @@ static MagneticField() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MagneticField(double numericValue, MagneticFieldUnit unit) { @@ -483,7 +482,6 @@ public int CompareTo(object obj) return CompareTo(objMagneticField); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MagneticField other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 0ca0bf14eb..cffc1bec59 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -75,7 +75,6 @@ static MagneticFlux() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MagneticFlux(double numericValue, MagneticFluxUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objMagneticFlux); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MagneticFlux other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index e24b9101de..186f03081c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -75,7 +75,6 @@ static Magnetization() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Magnetization(double numericValue, MagnetizationUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objMagnetization); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Magnetization other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index cfc394a677..98bca0aaf2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -72,7 +72,6 @@ static Mass() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Mass(double numericValue, MassUnit unit) { @@ -746,7 +745,6 @@ public int CompareTo(object obj) return CompareTo(objMass); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Mass other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 986a90a560..89a59538cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -72,7 +72,6 @@ static MassFlow() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MassFlow(double numericValue, MassFlowUnit unit) { @@ -858,7 +857,6 @@ public int CompareTo(object obj) return CompareTo(objMassFlow); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MassFlow other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index d3d2d2f1d5..2fd185f2a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -72,7 +72,6 @@ static MassFlux() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MassFlux(double numericValue, MassFluxUnit unit) { @@ -452,7 +451,6 @@ public int CompareTo(object obj) return CompareTo(objMassFlux); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MassFlux other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 72fd273432..e0f48c6105 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -72,7 +72,6 @@ static MassMomentOfInertia() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MassMomentOfInertia(double numericValue, MassMomentOfInertiaUnit unit) { @@ -816,7 +815,6 @@ public int CompareTo(object obj) return CompareTo(objMassMomentOfInertia); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MassMomentOfInertia other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 18303a0639..94988e7187 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -72,7 +72,6 @@ static MolarEnergy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MolarEnergy(double numericValue, MolarEnergyUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objMolarEnergy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MolarEnergy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index c219857e4a..c5945736d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -72,7 +72,6 @@ static MolarEntropy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MolarEntropy(double numericValue, MolarEntropyUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objMolarEntropy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MolarEntropy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 802f7a3322..4381870a51 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -72,7 +72,6 @@ static MolarMass() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public MolarMass(double numericValue, MolarMassUnit unit) { @@ -592,7 +591,6 @@ public int CompareTo(object obj) return CompareTo(objMolarMass); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(MolarMass other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index b29994e562..46b1a02776 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -75,7 +75,6 @@ static Molarity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Molarity(double numericValue, MolarityUnit unit) { @@ -539,7 +538,6 @@ public int CompareTo(object obj) return CompareTo(objMolarity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Molarity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 5a1e0277e4..5676ea9daa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -75,7 +75,6 @@ static Permeability() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Permeability(double numericValue, PermeabilityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objPermeability); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Permeability other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 9d4d1112ce..1b96cb2f39 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -75,7 +75,6 @@ static Permittivity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Permittivity(double numericValue, PermittivityUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objPermittivity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Permittivity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 0823f8283b..e768a314f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -72,7 +72,6 @@ static Power() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Power(decimal numericValue, PowerUnit unit) { @@ -704,7 +703,6 @@ public int CompareTo(object obj) return CompareTo(objPower); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Power other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index d9a03cb5ec..2f4e17b73b 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -72,7 +72,6 @@ static PowerDensity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public PowerDensity(double numericValue, PowerDensityUnit unit) { @@ -1040,7 +1039,6 @@ public int CompareTo(object obj) return CompareTo(objPowerDensity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(PowerDensity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index f1a5dea122..f08a35b8f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -72,7 +72,6 @@ static PowerRatio() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public PowerRatio(double numericValue, PowerRatioUnit unit) { @@ -460,7 +459,6 @@ public int CompareTo(object obj) return CompareTo(objPowerRatio); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(PowerRatio other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index e7f5e4c7bc..36cbcfaf2c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -72,7 +72,6 @@ static Pressure() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Pressure(double numericValue, PressureUnit unit) { @@ -1012,7 +1011,6 @@ public int CompareTo(object obj) return CompareTo(objPressure); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Pressure other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 066d24c627..449e204a02 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -72,7 +72,6 @@ static PressureChangeRate() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public PressureChangeRate(double numericValue, PressureChangeRateUnit unit) { @@ -522,7 +521,6 @@ public int CompareTo(object obj) return CompareTo(objPressureChangeRate); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(PressureChangeRate other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 060127e5a4..19d468d7a0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -72,7 +72,6 @@ static Ratio() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Ratio(double numericValue, RatioUnit unit) { @@ -508,7 +507,6 @@ public int CompareTo(object obj) return CompareTo(objRatio); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Ratio other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 580e21133d..fd3ce31c06 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -72,7 +72,6 @@ static ReactiveEnergy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ReactiveEnergy(double numericValue, ReactiveEnergyUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objReactiveEnergy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ReactiveEnergy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 65981a0e7a..05016f5311 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -72,7 +72,6 @@ static ReactivePower() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ReactivePower(double numericValue, ReactivePowerUnit unit) { @@ -480,7 +479,6 @@ public int CompareTo(object obj) return CompareTo(objReactivePower); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ReactivePower other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index d9c489ff10..77a55d3a10 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -72,7 +72,6 @@ static RotationalAcceleration() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public RotationalAcceleration(double numericValue, RotationalAccelerationUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objRotationalAcceleration); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(RotationalAcceleration other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index a25cda0fcf..b300dbb1af 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -72,7 +72,6 @@ static RotationalSpeed() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public RotationalSpeed(double numericValue, RotationalSpeedUnit unit) { @@ -606,7 +605,6 @@ public int CompareTo(object obj) return CompareTo(objRotationalSpeed); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(RotationalSpeed other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index a20fa279f2..adda7f4247 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -72,7 +72,6 @@ static RotationalStiffness() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public RotationalStiffness(double numericValue, RotationalStiffnessUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objRotationalStiffness); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(RotationalStiffness other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index f4bae36418..65bf873e1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -72,7 +72,6 @@ static RotationalStiffnessPerLength() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public RotationalStiffnessPerLength(double numericValue, RotationalStiffnessPerLengthUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objRotationalStiffnessPerLength); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(RotationalStiffnessPerLength other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index d299740017..62bc64e764 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -75,7 +75,6 @@ static SolidAngle() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public SolidAngle(double numericValue, SolidAngleUnit unit) { @@ -441,7 +440,6 @@ public int CompareTo(object obj) return CompareTo(objSolidAngle); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(SolidAngle other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 3a7f0468f5..003056941b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -75,7 +75,6 @@ static SpecificEnergy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public SpecificEnergy(double numericValue, SpecificEnergyUnit unit) { @@ -553,7 +552,6 @@ public int CompareTo(object obj) return CompareTo(objSpecificEnergy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(SpecificEnergy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index c54191ad88..0db981fa62 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -72,7 +72,6 @@ static SpecificEntropy() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public SpecificEntropy(double numericValue, SpecificEntropyUnit unit) { @@ -536,7 +535,6 @@ public int CompareTo(object obj) return CompareTo(objSpecificEntropy); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(SpecificEntropy other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index c52daa22e5..4819176b28 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -72,7 +72,6 @@ static SpecificVolume() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public SpecificVolume(double numericValue, SpecificVolumeUnit unit) { @@ -466,7 +465,6 @@ public int CompareTo(object obj) return CompareTo(objSpecificVolume); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(SpecificVolume other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index c3d13965f7..d02084483c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -75,7 +75,6 @@ static SpecificWeight() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public SpecificWeight(double numericValue, SpecificWeightUnit unit) { @@ -665,7 +664,6 @@ public int CompareTo(object obj) return CompareTo(objSpecificWeight); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(SpecificWeight other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 0eda083d72..6402126368 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -72,7 +72,6 @@ static Speed() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Speed(double numericValue, SpeedUnit unit) { @@ -872,7 +871,6 @@ public int CompareTo(object obj) return CompareTo(objSpeed); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Speed other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 541f4265b9..c7ffcba2b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -72,7 +72,6 @@ static Temperature() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Temperature(double numericValue, TemperatureUnit unit) { @@ -497,7 +496,6 @@ public int CompareTo(object obj) return CompareTo(objTemperature); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Temperature other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 2b24f327ec..e2fd9d9346 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -72,7 +72,6 @@ static TemperatureChangeRate() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public TemperatureChangeRate(double numericValue, TemperatureChangeRateUnit unit) { @@ -564,7 +563,6 @@ public int CompareTo(object obj) return CompareTo(objTemperatureChangeRate); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(TemperatureChangeRate other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index f189ebd280..58bec0168e 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -72,7 +72,6 @@ static TemperatureDelta() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public TemperatureDelta(double numericValue, TemperatureDeltaUnit unit) { @@ -536,7 +535,6 @@ public int CompareTo(object obj) return CompareTo(objTemperatureDelta); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(TemperatureDelta other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 7491856acc..221000459f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -75,7 +75,6 @@ static ThermalConductivity() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ThermalConductivity(double numericValue, ThermalConductivityUnit unit) { @@ -455,7 +454,6 @@ public int CompareTo(object obj) return CompareTo(objThermalConductivity); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ThermalConductivity other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 00f032a6c2..990197f885 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -72,7 +72,6 @@ static ThermalResistance() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public ThermalResistance(double numericValue, ThermalResistanceUnit unit) { @@ -494,7 +493,6 @@ public int CompareTo(object obj) return CompareTo(objThermalResistance); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(ThermalResistance other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 7ee5f39f0e..fd943d2d44 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -72,7 +72,6 @@ static Torque() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Torque(double numericValue, TorqueUnit unit) { @@ -718,7 +717,6 @@ public int CompareTo(object obj) return CompareTo(objTorque); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Torque other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 65c06ecce1..f17db26236 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -72,7 +72,6 @@ static VitaminA() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public VitaminA(double numericValue, VitaminAUnit unit) { @@ -438,7 +437,6 @@ public int CompareTo(object obj) return CompareTo(objVitaminA); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(VitaminA other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 3772c486e6..527f7264bd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -72,7 +72,6 @@ static Volume() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public Volume(double numericValue, VolumeUnit unit) { @@ -1054,7 +1053,6 @@ public int CompareTo(object obj) return CompareTo(objVolume); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(Volume other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 632a6c06f2..8802e7ec5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -72,7 +72,6 @@ static VolumeFlow() /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. public VolumeFlow(double numericValue, VolumeFlowUnit unit) { @@ -1096,7 +1095,6 @@ public int CompareTo(object obj) return CompareTo(objVolumeFlow); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods public int CompareTo(VolumeFlow other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); diff --git a/UnitsNet/GeneratedCode/Quantity.g.cs b/UnitsNet/GeneratedCode/Quantity.g.cs index 932a5b6975..ee300ded01 100644 --- a/UnitsNet/GeneratedCode/Quantity.g.cs +++ b/UnitsNet/GeneratedCode/Quantity.g.cs @@ -41,29 +41,17 @@ using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using FromValue = System.Double; -#else -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Dynamically parse or construct quantities when types are only known at runtime. /// -#if WINDOWS_UWP - internal -#else - public -#endif - static partial class Quantity + public static partial class Quantity { -#if !WINDOWS_UWP - /// + /// public static bool TryFrom(double value, Enum unit, out IQuantity quantity) { - // Implicit cast to FromValue would prevent TryFrom from being called, + // Implicit cast to QuantityValue would prevent TryFrom from being called, // so we need to explicitly check this here for double arguments. if (double.IsNaN(value) || double.IsInfinity(value)) { @@ -71,9 +59,8 @@ public static bool TryFrom(double value, Enum unit, out IQuantity quantity) return false; } - return TryFrom((FromValue) value, unit, out quantity); + return TryFrom((QuantityValue) value, unit, out quantity); } -#endif /// /// Try to dynamically construct a quantity. @@ -82,12 +69,7 @@ public static bool TryFrom(double value, Enum unit, out IQuantity quantity) /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + public static bool TryFrom(QuantityValue value, Enum unit, out IQuantity quantity) { switch (unit) { @@ -370,12 +352,7 @@ static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + public static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); /// /// Dynamically parse a quantity string representation. @@ -385,12 +362,7 @@ static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + public static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) { if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); @@ -401,12 +373,7 @@ static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantity } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + public static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => TryParse(null, quantityType, quantityString, out quantity); /// @@ -417,12 +384,7 @@ static bool TryParse(Type quantityType, string quantityString, out IQuantity qua /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. /// The parsed quantity. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + public static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) { quantity = default(IQuantity); @@ -705,7 +667,6 @@ static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityTy $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); } -#if !WINDOWS_UWP /// /// Get information about the given quantity type. /// @@ -715,6 +676,5 @@ public static QuantityInfo GetInfo(QuantityType quantityType) { return Infos.First(qi => qi.QuantityType == quantityType); } -#endif } } diff --git a/UnitsNet/Scripts/GenerateUnits.ps1 b/UnitsNet/Scripts/GenerateUnits.ps1 index 56191e7025..8cd15fe397 100644 --- a/UnitsNet/Scripts/GenerateUnits.ps1 +++ b/UnitsNet/Scripts/GenerateUnits.ps1 @@ -13,20 +13,15 @@ function ToCamelCase($str) } function ValueOrDefault($value, $defaultValue){ - if ($value -ne $null) { $value } else { $defaultValue } + if ($null -ne $value) { $value } else { $defaultValue } } function GenerateQuantity([Quantity]$quantity, $outDir) { $outFileName = "$outDir/$($quantity.Name).NetFramework.g.cs" - GenerateQuantitySourceCode $quantity "NetFramework" | Out-File -Encoding "UTF8" $outFileName | Out-Null + GenerateQuantitySourceCode $quantity | Out-File -Encoding "UTF8" $outFileName | Out-Null if (!$?) { exit 1 } - Write-Host -NoNewline "quantity .NET(OK) " - - $outFileName = "$outDir/../../../UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/$($quantity.Name).WindowsRuntimeComponent.g.cs" - GenerateQuantitySourceCode $quantity "WindowsRuntimeComponent" | Out-File -Encoding "UTF8" $outFileName | Out-Null - if (!$?) { exit 1 } - Write-Host -NoNewline "quantity WRC(OK) " + Write-Host -NoNewline "quantity(OK) " } function GenerateUnitTestBaseClass([Quantity]$quantity, $outDir) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index f46760bcf8..5cc4e7ff14 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -1,14 +1,6 @@ using module ".\Types.psm1" -class GeneratorArgs -{ - [Quantity]$Quantity - [Unit]$BaseUnit - [string]$UnitEnumName - [boolean]$TargetIsWindowsRuntimeComponent -} - -function GenerateQuantitySourceCode([Quantity]$quantity, [string]$target) +function GenerateQuantitySourceCode([Quantity]$quantity) { $quantityName = $quantity.Name; $units = $quantity.Units; @@ -17,10 +9,6 @@ function GenerateQuantitySourceCode([Quantity]$quantity, [string]$target) $baseUnitSingularName = $baseUnit.SingularName $baseUnitPluralName = $baseUnit.PluralName $unitEnumName = "$quantityName" + "Unit" - $wrc = $target -eq "WindowsRuntimeComponent" - $privateAccessModifierIfWrc = if ($wrc) { "private" } else { "public" } - $accessModifier = if ($wrc) { "internal" } else { "public" } - $enumOrObject = if ($wrc) { "object" } else { "Enum" } $baseDimensions = $quantity.BaseDimensions; $isDimensionless = $baseDimensions -eq $null -or ( $baseDimensions.Length -eq 0 -and $baseDimensions.Mass -eq 0 -and $baseDimensions.Time -eq 0 -and $baseDimensions.ElectricCurrent -eq 0 -and $baseDimensions.Temperature -eq 0 -and $baseDimensions.AmountOfSubstance -eq 0 -and $baseDimensions.LuminousIntensity -eq 0 ) @@ -29,7 +17,6 @@ function GenerateQuantitySourceCode([Quantity]$quantity, [string]$target) Quantity = $quantity; BaseUnit = $baseUnit; UnitEnumName = $unitEnumName; - TargetIsWindowsRuntimeComponent = $wrc; } # $genArgs | fl | out-string | write-host -foreground yellow @" @@ -86,7 +73,8 @@ $obsoleteAttribute = GetObsoleteAttribute($quantity); if ($obsoleteAttribute) { $obsoleteAttribute = "`r`n " + $obsoleteAttribute; # apply padding to conformance with code format in this section -}@" +} +@" /// /// $($quantity.XmlDocSummary) /// @@ -94,15 +82,8 @@ if ($obsoleteAttribute) /// /// $($quantity.XmlDocRemarks) /// -"@; } - if($wrc) {@" - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. - public sealed partial class $quantityName : IQuantity -"@; } else {@" - public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible "@; }@" + public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible { /// /// The numeric value this quantity was constructed with. @@ -116,43 +97,21 @@ if ($obsoleteAttribute) static $quantityName() { -"@; if($isDimensionless) - {@" +"@; if($isDimensionless) {@" BaseDimensions = BaseDimensions.Dimensionless; -"@; } - else - {@" - BaseDimensions = new BaseDimensions($($baseDimensions.Length), $($baseDimensions.Mass), $($baseDimensions.Time), $($baseDimensions.ElectricCurrent), $($baseDimensions.Temperature), $($baseDimensions.AmountOfSubstance), $($baseDimensions.LuminousIntensity)); -"@; } - if ($wrc) {@" - Info = new QuantityInfo(QuantityType.$quantityName, Units.Cast().ToArray(), BaseUnit, Zero, BaseDimensions); "@; } else {@" - Info = new QuantityInfo<$unitEnumName>(QuantityType.$quantityName, Units, BaseUnit, Zero, BaseDimensions); + BaseDimensions = new BaseDimensions($($baseDimensions.Length), $($baseDimensions.Mass), $($baseDimensions.Time), $($baseDimensions.ElectricCurrent), $($baseDimensions.Temperature), $($baseDimensions.AmountOfSubstance), $($baseDimensions.LuminousIntensity)); "@; }@" + Info = new QuantityInfo<$unitEnumName>(QuantityType.$quantityName, Units, BaseUnit, Zero, BaseDimensions); } -"@; # Windows Runtime Component requires a default constructor - if ($wrc) {@" - /// - /// Creates the quantity with a value of 0 in the base unit $baseUnitSingularName. - /// - /// - /// Windows Runtime Component requires a default constructor. - /// - public $quantityName() - { - _value = 0; - _unit = BaseUnit; - } -"@; } @" /// /// Creates the quantity with the given numeric value and unit. /// /// The numeric value to contruct this quantity with. /// The unit representation to contruct this quantity with. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. /// If value is NaN or Infinity. - $privateAccessModifierIfWrc $quantityName($valueType numericValue, $unitEnumName unit) + public $quantityName($valueType numericValue, $unitEnumName unit) { if(unit == $unitEnumName.Undefined) throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit)); @@ -191,17 +150,9 @@ if ($obsoleteAttribute) /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - public string ToString([CanBeNull] string cultureName) - { - var provider = cultureName; -"@; } else {@" /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { -"@; }@" return ToString(provider, 2); } @@ -210,17 +161,9 @@ if ($obsoleteAttribute) /// /// The number of significant digits after the radix point. /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - public string ToString(string cultureName, int significantDigitsAfterRadix) - { - var provider = cultureName; -"@; } else {@" /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { -"@; }@" var value = Convert.ToDouble(Value); var format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); return ToString(provider, format); @@ -232,17 +175,9 @@ if ($obsoleteAttribute) /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. -"@; # Windows Runtime Component does not support IFormatProvider type - if ($wrc) {@" - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - public string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args) - { - var provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { -"@; }@" if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); @@ -254,15 +189,7 @@ if ($obsoleteAttribute) } #endregion -"@; if ($wrc) {@" - - private static IFormatProvider GetFormatProviderFromCultureName([CanBeNull] string cultureName) - { - return cultureName != null ? new CultureInfo(cultureName) : (IFormatProvider)null; - } -"@; }@" -"@; if (!$wrc) {@" #region IConvertible Methods TypeCode IConvertible.GetTypeCode() @@ -360,7 +287,6 @@ if ($obsoleteAttribute) } #endregion -"@; }@" } } "@; @@ -377,11 +303,7 @@ function GenerateStaticProperties([GeneratorArgs]$genArgs) #region Static Properties /// -"@; if ($wrc) {@" - internal static QuantityInfo Info { get; } -"@; } else {@" public static QuantityInfo<$unitEnumName> Info { get; } -"@; }@" /// /// The of this quantity. @@ -428,7 +350,6 @@ function GenerateProperties([GeneratorArgs]$genArgs) $unitEnumName = $genArgs.UnitEnumName $baseUnitSingularName = $genArgs.BaseUnit.SingularName $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Properties @@ -436,30 +357,20 @@ function GenerateProperties([GeneratorArgs]$genArgs) /// /// The numeric value this quantity was constructed with. /// -"@; # Windows Runtime Component does not support decimal - if ($wrc) {@" - public double Value => Convert.ToDouble(_value); -"@; } else {@" public $valueType Value => _value; -"@; } -@" /// - $enumOrObject IQuantity.Unit => Unit; + Enum IQuantity.Unit => Unit; /// /// The unit this quantity was constructed with -or- if default ctor was used. /// public $unitEnumName Unit => _unit.GetValueOrDefault(BaseUnit); -"@; if ($wrc) {@" - internal QuantityInfo QuantityInfo => Info; -"@; } else {@" public QuantityInfo<$unitEnumName> QuantityInfo => Info; /// QuantityInfo IQuantity.QuantityInfo => Info; -"@; }@" /// /// The of this quantity. @@ -526,17 +437,9 @@ function GenerateStaticMethods([GeneratorArgs]$genArgs) /// /// Unit to get abbreviation for. /// Unit abbreviation string. -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. - public static string GetAbbreviation($unitEnumName unit, [CanBeNull] string cultureName) - { - IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use for localization. Defaults to if null. public static string GetAbbreviation($unitEnumName unit, [CanBeNull] IFormatProvider provider) { -"@; }@" return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); } @@ -550,7 +453,6 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) $unitEnumName = $genArgs.UnitEnumName $units = $genArgs.Quantity.Units $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Static Factory Methods @@ -567,13 +469,7 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) /// Get $quantityName from $($unit.PluralName). /// $($obsoleteAttribute) /// If value is NaN or Infinity. -"@; # Windows Runtime Component does not support overloads with same number of parameters - if ($wrc) {@" - [Windows.Foundation.Metadata.DefaultOverload] - public static $quantityName From$($unit.PluralName)(double $valueParamName) -"@; } else {@" public static $quantityName From$($unit.PluralName)(QuantityValue $valueParamName) -"@; }@" { $valueType value = ($valueType) $valueParamName; return new $quantityName(value, $unitEnumName.$($unit.SingularName)); @@ -586,14 +482,7 @@ function GenerateStaticFactoryMethods([GeneratorArgs]$genArgs) /// Value to convert from. /// Unit to convert from. /// $quantityName unit value. -"@; # Windows Runtime Component does not support parameters named 'value' -if ($wrc) {@" - // Fix name conflict with parameter "value" - [return: System.Runtime.InteropServices.WindowsRuntime.ReturnValueName("returnValue")] - public static $quantityName From(double value, $unitEnumName fromUnit) -"@; } else {@" public static $quantityName From(QuantityValue value, $unitEnumName fromUnit) -"@; }@" { return new $quantityName(($valueType)value, fromUnit); } @@ -610,7 +499,6 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) $baseUnitPluralName = $genArgs.BaseUnit.PluralName $units = $genArgs.Quantity.Units $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Static Parse Methods @@ -664,17 +552,9 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. - public static $quantityName Parse(string str, [CanBeNull] string cultureName) - { - IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use when parsing number and unit. Defaults to if null. public static $quantityName Parse(string str, [CanBeNull] IFormatProvider provider) { -"@; }@" return QuantityParser.Default.Parse<$quantityName, $unitEnumName>( str, provider, @@ -703,17 +583,9 @@ if ($wrc) {@" /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. - public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureName, out $quantityName result) - { - IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out $quantityName result) { -"@; }@" return QuantityParser.Default.TryParse<$quantityName, $unitEnumName>( str, provider, @@ -744,17 +616,9 @@ if ($wrc) {@" /// /// The value of 'str' cannot be null. /// Error parsing string. -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. - public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) - { - IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use when parsing number and unit. Defaults to if null. public static $unitEnumName ParseUnit(string str, IFormatProvider provider = null) { -"@; }@" return UnitParser.Default.Parse<$unitEnumName>(str, provider); } @@ -772,17 +636,9 @@ if ($wrc) {@" /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// -"@; # Windows Runtime Component does not support IFormatProvider type -if ($wrc) {@" - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to if null. - public static bool TryParseUnit(string str, [CanBeNull] string cultureName, out $unitEnumName unit) - { - IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); -"@; } else {@" /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out $unitEnumName unit) { -"@; }@" return UnitParser.Default.TryParse<$unitEnumName>(str, provider, out unit); } @@ -794,7 +650,6 @@ function GenerateLogarithmicArithmeticOperators([GeneratorArgs]$genArgs) { $quantityName = $genArgs.Quantity.Name $valueType = $genArgs.Quantity.BaseType - $wrc = $genArgs.TargetIsWindowsRuntimeComponent $scalingFactor = $genArgs.Quantity.LogarithmicScalingFactor # Most logarithmic operators need a simple scaling factor of 10. However, certain units such as voltage ratio need to use 20 instead. $x = 10 * $scalingFactor; @@ -851,8 +706,7 @@ function GenerateLogarithmicArithmeticOperators([GeneratorArgs]$genArgs) function GenerateArithmeticOperators([GeneratorArgs]$genArgs) { - # Windows Runtime Component does not support operator overloads - if ($wrc -or (-not $quantity.GenerateArithmetic)) { return } + if (-not $quantity.GenerateArithmetic) { return } # Logarithmic units required different arithmetic if ($quantity.Logarithmic) { @@ -909,13 +763,10 @@ function GenerateArithmeticOperators([GeneratorArgs]$genArgs) function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) { $quantityName = $genArgs.Quantity.Name - $wrc = $genArgs.TargetIsWindowsRuntimeComponent @" #region Equality / IComparable -"@; # Windows Runtime Component does not support operator overloads - if (-not $wrc) {@" public static bool operator <=($quantityName left, $quantityName right) { return left.Value <= right.AsBaseNumericType(left.Unit); @@ -946,7 +797,6 @@ function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) return !(left == right); } -"@; }@" public int CompareTo(object obj) { if(obj is null) throw new ArgumentNullException(nameof(obj)); @@ -955,16 +805,11 @@ function GenerateEqualityAndComparison([GeneratorArgs]$genArgs) return CompareTo(obj$quantityName); } - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods - $accessModifier int CompareTo($quantityName other) + public int CompareTo($quantityName other) { return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } -"@; - if ($wrc) {@" - [Windows.Foundation.Metadata.DefaultOverload] -"@; }@" public override bool Equals(object obj) { if(obj is null || !(obj is $quantityName obj$quantityName)) @@ -1051,7 +896,7 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) #region Conversion Methods - double IQuantity.As($enumOrObject unit) => As(($unitEnumName)unit); + double IQuantity.As(Enum unit) => As(($unitEnumName)unit); /// /// Convert to the unit representation . @@ -1066,10 +911,8 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return Convert.ToDouble(converted); } -"@; if (-not $wrc) {@" public double As(Enum unit) => As(($unitEnumName) unit); -"@; }@" /// /// Converts this $quantityName to another $quantityName with the unit representation . /// @@ -1080,12 +923,10 @@ function GenerateConversionMethods([GeneratorArgs]$genArgs) return new $quantityName(convertedValue, unit); } -"@; if (-not $wrc) {@" IQuantity<$unitEnumName> IQuantity<$unitEnumName>.ToUnit($unitEnumName unit) => ToUnit(unit); public IQuantity ToUnit(Enum unit) => ToUnit(($unitEnumName) unit); -"@; }@" /// /// 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/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 index 0539c41fd0..ef73062dda 100644 --- a/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 @@ -46,29 +46,17 @@ using JetBrains.Annotations; using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using FromValue = System.Double; -#else -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Dynamically parse or construct quantities when types are only known at runtime. /// -#if WINDOWS_UWP - internal -#else - public -#endif - static partial class Quantity + public static partial class Quantity { -#if !WINDOWS_UWP - /// + /// public static bool TryFrom(double value, Enum unit, out IQuantity quantity) { - // Implicit cast to FromValue would prevent TryFrom from being called, + // Implicit cast to QuantityValue would prevent TryFrom from being called, // so we need to explicitly check this here for double arguments. if (double.IsNaN(value) || double.IsInfinity(value)) { @@ -76,9 +64,8 @@ namespace UnitsNet return false; } - return TryFrom((FromValue) value, unit, out quantity); + return TryFrom((QuantityValue) value, unit, out quantity); } -#endif /// /// Try to dynamically construct a quantity. @@ -87,12 +74,7 @@ namespace UnitsNet /// Unit enum value. /// The resulting quantity if successful, otherwise default. /// True if successful with assigned the value, otherwise false. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryFrom(FromValue value, Enum unit, out IQuantity quantity) + public static bool TryFrom(QuantityValue value, Enum unit, out IQuantity quantity) { switch (unit) { @@ -113,12 +95,7 @@ namespace UnitsNet } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); + public static IQuantity Parse(Type quantityType, string quantityString) => Parse(null, quantityType, quantityString); /// /// Dynamically parse a quantity string representation. @@ -128,12 +105,7 @@ namespace UnitsNet /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. /// Type must be of type UnitsNet.IQuantity -or- Type is not a known quantity type. -#if WINDOWS_UWP - internal -#else - public -#endif - static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) + public static IQuantity Parse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString) { if (!typeof(IQuantity).Wrap().IsAssignableFrom(quantityType)) throw new ArgumentException($"Type {quantityType} must be of type UnitsNet.IQuantity."); @@ -144,12 +116,7 @@ namespace UnitsNet } /// -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => + public static bool TryParse(Type quantityType, string quantityString, out IQuantity quantity) => TryParse(null, quantityType, quantityString, out quantity); /// @@ -160,12 +127,7 @@ namespace UnitsNet /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. /// The parsed quantity. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) + public static bool TryParse([CanBeNull] IFormatProvider formatProvider, Type quantityType, string quantityString, out IQuantity quantity) { quantity = default(IQuantity); @@ -184,7 +146,6 @@ namespace UnitsNet $"Type {quantityType} is not a known quantity type. Did you pass in a third-party quantity type defined outside UnitsNet library?"); } -#if !WINDOWS_UWP /// /// Get information about the given quantity type. /// @@ -194,7 +155,6 @@ namespace UnitsNet { return Infos.First(qi => qi.QuantityType == quantityType); } -#endif } } "@; diff --git a/UnitsNet/Scripts/Types.psm1 b/UnitsNet/Scripts/Types.psm1 index 11151b0bd2..8badec4b31 100644 --- a/UnitsNet/Scripts/Types.psm1 +++ b/UnitsNet/Scripts/Types.psm1 @@ -41,3 +41,10 @@ class BaseDimensions [int]$AmountOfSubstance = 0 [int]$LuminousIntensity = 0 } + +class GeneratorArgs +{ + [Quantity]$Quantity + [Unit]$BaseUnit + [string]$UnitEnumName +} From 96549055a999734d4221e05aac00acb6bdcdd883 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Wed, 13 Feb 2019 00:37:41 +0100 Subject: [PATCH 07/10] Remove #if WINDOWS_UWP code --- .../Internal/ReflectionHelper.cs | 1 - UnitsNet.Tests/BaseDimensionsTests.cs | 2 - UnitsNet/AmbiguousUnitParseException.cs | 7 +- UnitsNet/BaseDimensions.cs | 6 +- UnitsNet/BaseUnits.cs | 9 -- UnitsNet/CustomCode/GlobalConfiguration.cs | 8 +- .../Quantities/Acceleration.extra.cs | 15 ---- .../Quantities/AmplitudeRatio.extra.cs | 23 +---- UnitsNet/CustomCode/Quantities/Angle.extra.cs | 17 +--- UnitsNet/CustomCode/Quantities/Area.extra.cs | 17 +--- .../BrakeSpecificFuelConsumption.extra.cs | 17 +--- .../CustomCode/Quantities/Density.extra.cs | 17 +--- .../CustomCode/Quantities/Duration.extra.cs | 11 --- .../Quantities/DynamicViscosity.extra.cs | 20 +---- .../Quantities/ElectricPotential.extra.cs | 17 +--- UnitsNet/CustomCode/Quantities/Force.extra.cs | 11 --- .../Quantities/ForcePerLength.extra.cs | 19 +--- .../CustomCode/Quantities/HeatFlux.extra.cs | 17 +--- .../Quantities/KinematicViscosity.extra.cs | 17 +--- .../CustomCode/Quantities/LapseRate.extra.cs | 17 +--- .../CustomCode/Quantities/Length.extra.cs | 20 +---- UnitsNet/CustomCode/Quantities/Level.extra.cs | 7 -- UnitsNet/CustomCode/Quantities/Mass.extra.cs | 25 +----- .../CustomCode/Quantities/MassFlow.extra.cs | 16 +--- .../CustomCode/Quantities/MassFlux.extra.cs | 10 --- .../CustomCode/Quantities/Molarity.extra.cs | 16 +--- UnitsNet/CustomCode/Quantities/Power.extra.cs | 17 +--- .../CustomCode/Quantities/PowerRatio.extra.cs | 22 +---- .../CustomCode/Quantities/Pressure.extra.cs | 17 +--- .../Quantities/RotationalSpeed.extra.cs | 17 +--- .../Quantities/RotationalStiffness.extra.cs | 17 +--- .../RotationalStiffnessPerLength.extra.cs | 16 +--- .../Quantities/SpecificEnergy.extra.cs | 19 +--- .../Quantities/SpecificVolume.extra.cs | 12 --- .../Quantities/SpecificWeight.extra.cs | 11 --- UnitsNet/CustomCode/Quantities/Speed.extra.cs | 17 +--- .../Quantities/Temperature.extra.cs | 17 +--- .../Quantities/TemperatureDelta.extra.cs | 11 --- .../CustomCode/Quantities/Torque.extra.cs | 17 +--- .../CustomCode/Quantities/Volume.extra.cs | 17 +--- .../CustomCode/Quantities/VolumeFlow.extra.cs | 17 +--- UnitsNet/CustomCode/Quantity.cs | 24 +----- UnitsNet/CustomCode/QuantityParser.cs | 6 -- UnitsNet/CustomCode/UnitAbbreviationsCache.cs | 86 +++---------------- UnitsNet/CustomCode/UnitParser.cs | 44 ++-------- .../CustomCode/UnitValueAbbreviationLookup.cs | 1 - UnitsNet/IQuantity.cs | 51 ----------- UnitsNet/QuantityInfo.cs | 9 +- UnitsNet/QuantityNotFoundException.cs | 15 ++-- UnitsNet/QuantityValue.cs | 4 - UnitsNet/UnitConverter.cs | 40 +++------ UnitsNet/UnitInfo.cs | 9 +- UnitsNet/UnitNotFoundException.cs | 15 ++-- UnitsNet/UnitSystem.cs | 13 +-- UnitsNet/UnitsNet.csproj | 3 +- UnitsNet/UnitsNetException.cs | 15 ++-- 56 files changed, 135 insertions(+), 806 deletions(-) diff --git a/UnitsNet.Serialization.JsonNet/Internal/ReflectionHelper.cs b/UnitsNet.Serialization.JsonNet/Internal/ReflectionHelper.cs index becc914216..930acb1080 100644 --- a/UnitsNet.Serialization.JsonNet/Internal/ReflectionHelper.cs +++ b/UnitsNet.Serialization.JsonNet/Internal/ReflectionHelper.cs @@ -19,7 +19,6 @@ internal static PropertyInfo GetProperty(this Type type, string name) #endif } - // Ambiguous method conflict with GetMethods() name WindowsRuntimeComponent, so use GetDeclaredMethods() instead internal static IEnumerable GetDeclaredMethods(this Type someType) { Type t = someType; diff --git a/UnitsNet.Tests/BaseDimensionsTests.cs b/UnitsNet.Tests/BaseDimensionsTests.cs index f147649381..9c0b593590 100644 --- a/UnitsNet.Tests/BaseDimensionsTests.cs +++ b/UnitsNet.Tests/BaseDimensionsTests.cs @@ -410,7 +410,6 @@ public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAcceleration Assert.True(calculatedDimensions == Force.BaseDimensions); } -#if !WINDOWS_UWP [Fact] public void EqualityWorksAsExpectedWithOperatorOverloads() { @@ -692,7 +691,6 @@ public void CheckBaseDimensionMultiplicationWithForceEqualsMassTimesAcceleration var calculatedDimensions = mass.Dimensions * acceleration.Dimensions; Assert.True(calculatedDimensions == Force.BaseDimensions); } -#endif [Fact] public void CheckToStringUsingMolarEntropy() diff --git a/UnitsNet/AmbiguousUnitParseException.cs b/UnitsNet/AmbiguousUnitParseException.cs index c59a5a5e12..c7df84ccc6 100644 --- a/UnitsNet/AmbiguousUnitParseException.cs +++ b/UnitsNet/AmbiguousUnitParseException.cs @@ -30,12 +30,7 @@ namespace UnitsNet /// and /// have "pt" as their abbreviation. /// -#if WINDOWS_UWP - internal -#else - public -#endif - class AmbiguousUnitParseException : UnitsNetException + public class AmbiguousUnitParseException : UnitsNetException { /// public AmbiguousUnitParseException(string message) : base(message) diff --git a/UnitsNet/BaseDimensions.cs b/UnitsNet/BaseDimensions.cs index 6ce00d968b..beb303c57b 100644 --- a/UnitsNet/BaseDimensions.cs +++ b/UnitsNet/BaseDimensions.cs @@ -61,7 +61,7 @@ public bool IsDerivedQuantity() { return !IsBaseQuantity() && !IsDimensionless(); } - + /// /// Checks if this base dimensions object represents a dimensionless quantity. /// @@ -134,8 +134,6 @@ public BaseDimensions Divide(BaseDimensions right) LuminousIntensity - right.LuminousIntensity); } -#if !WINDOWS_UWP - /// /// Check if two dimensions are equal. /// @@ -190,8 +188,6 @@ public BaseDimensions Divide(BaseDimensions right) return left.Divide(right); } -#endif - /// public override string ToString() { diff --git a/UnitsNet/BaseUnits.cs b/UnitsNet/BaseUnits.cs index 16949c0ff6..b26b4439d5 100644 --- a/UnitsNet/BaseUnits.cs +++ b/UnitsNet/BaseUnits.cs @@ -25,9 +25,7 @@ namespace UnitsNet { -#if !WINDOWS_UWP public sealed partial class BaseUnits : IEquatable { } -#endif /// /// Represents the base units for a quantity. All quantities, both base and derived, can be @@ -72,9 +70,6 @@ public override bool Equals(object obj) /// /// The other instance to check if equal to. /// True if equal, otherwise false. -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] -#endif public bool Equals(BaseUnits other) { if(other is null) @@ -95,8 +90,6 @@ public override int GetHashCode() return new {Length, Mass, Time, Current, Temperature, Amount, LuminousIntensity}.GetHashCode(); } -#if !WINDOWS_UWP - /// /// Checks if this instance is equal to another. /// @@ -121,8 +114,6 @@ public override int GetHashCode() return !(left == right); } -#endif - /// public override string ToString() { diff --git a/UnitsNet/CustomCode/GlobalConfiguration.cs b/UnitsNet/CustomCode/GlobalConfiguration.cs index 396eb0ca07..9671a6198d 100644 --- a/UnitsNet/CustomCode/GlobalConfiguration.cs +++ b/UnitsNet/CustomCode/GlobalConfiguration.cs @@ -31,12 +31,6 @@ public sealed class GlobalConfiguration /// Defaults to when creating an instance with no culture provided. /// Can be overridden, but note that this is static and will affect all subsequent usages. /// -#if WINDOWS_UWP - // Windows Runtime Component does not support exposing the IFormatProvider type in public API - internal -#else - public -#endif - static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; + public static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; } } diff --git a/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs b/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs index d4f20f0030..afa200d4eb 100644 --- a/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs @@ -19,24 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace - -using System; -using UnitsNet.Units; - namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Acceleration -#else public partial struct Acceleration -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP /// /// Multiply and to get . /// @@ -44,6 +30,5 @@ public partial struct Acceleration { return new SpecificWeight(acceleration.MetersPerSecondSquared * density.KilogramsPerCubicMeter, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/AmplitudeRatio.extra.cs b/UnitsNet/CustomCode/Quantities/AmplitudeRatio.extra.cs index 0e68fb595b..a1176d647d 100644 --- a/UnitsNet/CustomCode/Quantities/AmplitudeRatio.extra.cs +++ b/UnitsNet/CustomCode/Quantities/AmplitudeRatio.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -22,17 +22,9 @@ using System; using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class AmplitudeRatio -#else public partial struct AmplitudeRatio -#endif { /// /// Initializes a new instance of the struct from the specified electric potential @@ -41,14 +33,7 @@ public partial struct AmplitudeRatio /// resistance. /// /// The electric potential referenced to one volt. - - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - AmplitudeRatio(ElectricPotential voltage) + public AmplitudeRatio(ElectricPotential voltage) : this() { if (voltage.Volts <= 0) diff --git a/UnitsNet/CustomCode/Quantities/Angle.extra.cs b/UnitsNet/CustomCode/Quantities/Angle.extra.cs index 68676d7e50..81d8311411 100644 --- a/UnitsNet/CustomCode/Quantities/Angle.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Angle.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Angle -#else public partial struct Angle -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static RotationalSpeed operator /(Angle angle, TimeSpan timeSpan) { return RotationalSpeed.FromRadiansPerSecond(angle.Radians / timeSpan.TotalSeconds); @@ -44,6 +34,5 @@ public partial struct Angle { return RotationalSpeed.FromRadiansPerSecond(angle.Radians / duration.Seconds); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Area.extra.cs b/UnitsNet/CustomCode/Quantities/Area.extra.cs index f6fc2770c4..02d291b249 100644 --- a/UnitsNet/CustomCode/Quantities/Area.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Area.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,17 +21,9 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Area -#else public partial struct Area -#endif { #region Static Methods @@ -48,8 +40,6 @@ public static Area FromCircleRadius(Length radius) #endregion - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Length operator /(Area area, Length length) { return Length.FromMeters(area.SquareMeters / length.Meters); @@ -64,6 +54,5 @@ public static Area FromCircleRadius(Length radius) { return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs b/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs index 2a9e9a437e..3c2be41550 100644 --- a/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs +++ b/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class BrakeSpecificFuelConsumption -#else public partial struct BrakeSpecificFuelConsumption -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static MassFlow operator *(BrakeSpecificFuelConsumption bsfc, Power power) { return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule*power.Watts); @@ -47,6 +37,5 @@ public partial struct BrakeSpecificFuelConsumption { return specificEnergy.JoulesPerKilogram*bsfc.KilogramsPerJoule; } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Density.extra.cs b/UnitsNet/CustomCode/Quantities/Density.extra.cs index 6fd11240ff..10538a7f06 100644 --- a/UnitsNet/CustomCode/Quantities/Density.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Density.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,17 +21,9 @@ using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Density -#else public partial struct Density -#endif { /// /// Gets from this . @@ -56,8 +48,6 @@ public static Density FromMolarity(Molarity molarity, Mass molecularWeight) #endregion - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Mass operator *(Density density, Volume volume) { return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); @@ -82,6 +72,5 @@ public static Density FromMolarity(Molarity molarity, Mass molecularWeight) { return new SpecificWeight(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared, SpecificWeightUnit.NewtonPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Duration.extra.cs b/UnitsNet/CustomCode/Quantities/Duration.extra.cs index 5748f67250..885b6b99a8 100644 --- a/UnitsNet/CustomCode/Quantities/Duration.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Duration.extra.cs @@ -21,17 +21,9 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Duration -#else public partial struct Duration -#endif { /// /// Convert a Duration to a TimeSpan. @@ -46,8 +38,6 @@ public TimeSpan ToTimeSpan() return TimeSpan.FromSeconds( Seconds ); } - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static DateTime operator +(DateTime time, Duration duration) { return time.AddSeconds(duration.Seconds); @@ -112,6 +102,5 @@ public static explicit operator Duration(TimeSpan duration) { return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs b/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs index 33286fd870..c77134352f 100644 --- a/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs +++ b/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,25 +19,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class DynamicViscosity -#else public partial struct DynamicViscosity -#endif { -// Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) { return KinematicViscosity.FromSquareMetersPerSecond(dynamicViscosity.NewtonSecondsPerMeterSquared / density.KilogramsPerCubicMeter); } -#endif } -} \ No newline at end of file +} diff --git a/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs index 6f1fc43ea7..26832454a3 100644 --- a/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs +++ b/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; -using UnitsNet.Units; - -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class ElectricPotential -#else public partial struct ElectricPotential -#endif { /// /// Gets an in decibels (dB) relative to 1 volt RMS from this . diff --git a/UnitsNet/CustomCode/Quantities/Force.extra.cs b/UnitsNet/CustomCode/Quantities/Force.extra.cs index f13fd8cbcd..e06497d8e3 100644 --- a/UnitsNet/CustomCode/Quantities/Force.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Force.extra.cs @@ -21,17 +21,9 @@ using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Force -#else public partial struct Force -#endif { public static Force FromPressureByArea(Pressure p, Area area) { @@ -44,8 +36,6 @@ public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared, ForceUnit.Newton); } - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Power operator *(Force force, Speed speed) { return Power.FromWatts(force.Newtons * speed.MetersPerSecond); @@ -75,6 +65,5 @@ public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) { return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs b/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs index 86d9642e54..20650ca18c 100644 --- a/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs +++ b/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class ForcePerLength -#else public partial struct ForcePerLength -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Force operator *(ForcePerLength forcePerLength, Length length) { return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); @@ -47,6 +37,5 @@ public partial struct ForcePerLength { return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); } -#endif } -} \ No newline at end of file +} diff --git a/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs b/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs index 2e8910ba43..b5b201fbba 100644 --- a/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs +++ b/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,24 +19,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class HeatFlux -#else public partial struct HeatFlux -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Power operator *(HeatFlux heatFlux, Area area) { return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs b/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs index 72dbd14940..4f5fe2d733 100644 --- a/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs +++ b/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class KinematicViscosity -#else public partial struct KinematicViscosity -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) { return Speed.FromMetersPerSecond(kinematicViscosity.SquareMetersPerSecond / length.Meters); @@ -64,6 +54,5 @@ public partial struct KinematicViscosity { return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs b/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs index ba34a2e828..d92a657563 100644 --- a/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs +++ b/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class LapseRate -#else public partial struct LapseRate -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Length operator /(TemperatureDelta left, LapseRate right) { return Length.FromKilometers(left.Kelvins / right.DegreesCelciusPerKilometer); @@ -44,6 +34,5 @@ public partial struct LapseRate { return TemperatureDelta.FromDegreesCelsius(left.DegreesCelciusPerKilometer * right.Kilometers); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Length.extra.cs b/UnitsNet/CustomCode/Quantities/Length.extra.cs index 7d9ba655d8..001393d172 100644 --- a/UnitsNet/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Length.extra.cs @@ -24,23 +24,9 @@ using JetBrains.Annotations; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture=System.String; -#else -using Culture=System.IFormatProvider; -#endif - -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Length -#else public partial struct Length -#endif { private const double InchesInOneFoot = 12; @@ -67,9 +53,6 @@ public static Length FromFeetInches(double feet, double inches) return FromInches(InchesInOneFoot*feet + inches); } - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP - /// /// Special parsing of feet/inches strings, commonly used. /// 2 feet 4 inches is sometimes denoted as 2′−4″, 2′ 4″, 2′4″, 2 ft 4 in. @@ -188,7 +171,6 @@ public static bool TryParseFeetInches([CanBeNull] string str, out Length result, { return new Pressure(length.Meters * specificWeight.NewtonsPerCubicMeter, PressureUnit.Pascal); } -#endif } public sealed class FeetInches @@ -207,7 +189,7 @@ public override string ToString() return ToString(null); } - public string ToString([CanBeNull] Culture cultureInfo) + public string ToString([CanBeNull] IFormatProvider cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 5 feet and 4.5 inches". // So inches are rounded when converting from base units to feet/inches. diff --git a/UnitsNet/CustomCode/Quantities/Level.extra.cs b/UnitsNet/CustomCode/Quantities/Level.extra.cs index b222bbcaf6..d253f08503 100644 --- a/UnitsNet/CustomCode/Quantities/Level.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Level.extra.cs @@ -22,14 +22,8 @@ using System; using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. - // Cannot have methods with same name and same number of parameters. -#if !WINDOWS_UWP public partial struct Level { /// @@ -55,5 +49,4 @@ public Level(double quantity, double reference) _unit = LevelUnit.Decibel; } } -#endif } diff --git a/UnitsNet/CustomCode/Quantities/Mass.extra.cs b/UnitsNet/CustomCode/Quantities/Mass.extra.cs index 11fb195c63..d6a33c9c0b 100644 --- a/UnitsNet/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Mass.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -23,23 +23,9 @@ using JetBrains.Annotations; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture = System.String; -#else -using Culture = System.IFormatProvider; -#endif - -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Mass -#else public partial struct Mass -#endif { public static Mass FromGravitationalForce(Force f) { @@ -76,8 +62,6 @@ public static Mass FromStonePounds(double stone, double pounds) return FromPounds(StonesInOnePound*stone + pounds); } - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static MassFlow operator /(Mass mass, TimeSpan timeSpan) { return MassFlow.FromKilogramsPerSecond(mass.Kilograms/timeSpan.TotalSeconds); @@ -107,7 +91,6 @@ public static Mass FromStonePounds(double stone, double pounds) { return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); } -#endif } public sealed class StonePounds @@ -126,7 +109,7 @@ public override string ToString() return ToString(null); } - public string ToString([CanBeNull] Culture cultureInfo) + public string ToString([CanBeNull] IFormatProvider cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 11 stone and 4.5 pounds". // So pounds are rounded here. diff --git a/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs b/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs index 49288cfe60..c1842faab8 100644 --- a/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs +++ b/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,19 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class MassFlow -#else public partial struct MassFlow -#endif { -#if !WINDOWS_UWP public static Mass operator *(MassFlow massFlow, TimeSpan time) { return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); @@ -88,6 +79,5 @@ public partial struct MassFlow { return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs b/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs index 31062c283c..f8204f2161 100644 --- a/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs +++ b/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs @@ -19,19 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class MassFlux -#else public partial struct MassFlux -#endif { -#if !WINDOWS_UWP public static Density operator /(MassFlux massFlux, Speed speed) { return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); @@ -44,6 +35,5 @@ public partial struct MassFlux { return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Molarity.extra.cs b/UnitsNet/CustomCode/Quantities/Molarity.extra.cs index 9226caed22..f56ea5304a 100644 --- a/UnitsNet/CustomCode/Quantities/Molarity.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Molarity.extra.cs @@ -1,24 +1,10 @@ using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Molarity -#else public partial struct Molarity -#endif { - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - Molarity(Density density, Mass molecularWeight) + public Molarity(Density density, Mass molecularWeight) : this() { _value = density.KilogramsPerCubicMeter / molecularWeight.Kilograms; diff --git a/UnitsNet/CustomCode/Quantities/Power.extra.cs b/UnitsNet/CustomCode/Quantities/Power.extra.cs index 77b1616860..b7b78c4299 100644 --- a/UnitsNet/CustomCode/Quantities/Power.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Power.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,17 +21,9 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Power -#else public partial struct Power -#endif { /// /// Gets a from this relative to one watt. @@ -47,8 +39,6 @@ public PowerRatio ToPowerRatio() return PowerRatio.FromPower(this); } - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Energy operator *(Power power, TimeSpan time) { return Energy.FromJoules(power.Watts * time.TotalSeconds); @@ -108,6 +98,5 @@ public PowerRatio ToPowerRatio() { return Area.FromSquareMeters( power.Watts / heatFlux.WattsPerSquareMeter ); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/PowerRatio.extra.cs b/UnitsNet/CustomCode/Quantities/PowerRatio.extra.cs index 4180da4d89..32f8bb6d87 100644 --- a/UnitsNet/CustomCode/Quantities/PowerRatio.extra.cs +++ b/UnitsNet/CustomCode/Quantities/PowerRatio.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -22,30 +22,16 @@ using System; using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class PowerRatio -#else public partial struct PowerRatio -#endif { /// /// Initializes a new instance of the struct from the specified power referenced to one watt. /// /// The power relative to one watt. - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - PowerRatio(Power power) + public PowerRatio(Power power) : this() { if (power.Watts <= 0) diff --git a/UnitsNet/CustomCode/Quantities/Pressure.extra.cs b/UnitsNet/CustomCode/Quantities/Pressure.extra.cs index e85acc8212..5e919cc242 100644 --- a/UnitsNet/CustomCode/Quantities/Pressure.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Pressure.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Pressure -#else public partial struct Pressure -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Force operator *(Pressure pressure, Area area) { return Force.FromNewtons(pressure.Pascals * area.SquareMeters); @@ -52,6 +42,5 @@ public partial struct Pressure { return new SpecificWeight(pressure.Pascals / length.Meters, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs index 0afa95479d..96bee553f7 100644 --- a/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs +++ b/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalSpeed -#else public partial struct RotationalSpeed -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) { return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); @@ -54,6 +44,5 @@ public partial struct RotationalSpeed { return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs index 300276c10e..9c2901afc9 100644 --- a/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs +++ b/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalStiffness -#else public partial struct RotationalStiffness -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) { return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); @@ -47,6 +37,5 @@ public partial struct RotationalStiffness { return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs index b4028483ed..59c28865c7 100644 --- a/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs +++ b/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -22,21 +22,11 @@ // ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class RotationalStiffnessPerLength -#else public partial struct RotationalStiffnessPerLength -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static RotationalStiffness operator *(RotationalStiffnessPerLength rotationalStiffness, Length length) { return RotationalStiffness.FromNewtonMetersPerRadian(rotationalStiffness.NewtonMetersPerRadianPerMeter * length.Meters); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs index a17a8a4fd4..745a3a8a20 100644 --- a/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs +++ b/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificEnergy -#else public partial struct SpecificEnergy -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Energy operator *(SpecificEnergy specificEnergy, Mass mass) { return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); @@ -57,6 +47,5 @@ public partial struct SpecificEnergy { return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); } -#endif } -} \ No newline at end of file +} diff --git a/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs index 3df2036e99..e166fff9c8 100644 --- a/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs +++ b/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificVolume -#else public partial struct SpecificVolume -#endif { - -#if !WINDOWS_UWP public static Density operator /(double constant, SpecificVolume volume) { return Density.FromKilogramsPerCubicMeter(constant / volume.CubicMetersPerKilogram); @@ -42,7 +32,5 @@ public partial struct SpecificVolume { return Volume.FromCubicMeters(volume.CubicMetersPerKilogram * mass.Kilograms); } - -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs index b9403d2107..b06ee9d3b6 100644 --- a/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs +++ b/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class SpecificWeight -#else public partial struct SpecificWeight -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Pressure operator *(SpecificWeight specificWeight, Length length) { return new Pressure(specificWeight.NewtonsPerCubicMeter * length.Meters, UnitsNet.Units.PressureUnit.Pascal); @@ -47,6 +37,5 @@ public partial struct SpecificWeight { return new Density(specific.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared, UnitsNet.Units.DensityUnit.KilogramPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Speed.extra.cs b/UnitsNet/CustomCode/Quantities/Speed.extra.cs index 8e5eaab04d..62390d0f7a 100644 --- a/UnitsNet/CustomCode/Quantities/Speed.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Speed.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Speed -#else public partial struct Speed -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Acceleration operator /(Speed speed, TimeSpan timeSpan) { return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); @@ -84,6 +74,5 @@ public partial struct Speed { return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs index fed00fd718..a5bb707468 100644 --- a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using UnitsNet.Units; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Temperature -#else public partial struct Temperature -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP /// /// Add a and a . /// @@ -74,7 +64,6 @@ public partial struct Temperature { return new TemperatureDelta(left.Kelvins - right.Kelvins, TemperatureDeltaUnit.Kelvin); } -#endif /// /// Multiply temperature with a in a given . diff --git a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs index 4ec7201483..8fb1cce3bc 100644 --- a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs +++ b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class TemperatureDelta -#else public partial struct TemperatureDelta -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static LapseRate operator /(TemperatureDelta left, Length right) { return LapseRate.FromDegreesCelciusPerKilometer(left.DegreesCelsius / right.Kilometers); @@ -47,6 +37,5 @@ public partial struct TemperatureDelta { return specificEntropy * temperatureDelta; } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Torque.extra.cs b/UnitsNet/CustomCode/Quantities/Torque.extra.cs index ded64d2ec5..e93afa4ad6 100644 --- a/UnitsNet/CustomCode/Quantities/Torque.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Torque.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -19,20 +19,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Torque -#else public partial struct Torque -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Force operator /(Torque torque, Length length) { return Force.FromNewtons(torque.NewtonMeters / length.Meters); @@ -52,6 +42,5 @@ public partial struct Torque { return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/Volume.extra.cs b/UnitsNet/CustomCode/Quantities/Volume.extra.cs index 8792faf783..a7a1b92a29 100644 --- a/UnitsNet/CustomCode/Quantities/Volume.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Volume.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class Volume -#else public partial struct Volume -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Area operator /(Volume volume, Length length) { return Area.FromSquareMeters(volume.CubicMeters / length.Meters); @@ -59,6 +49,5 @@ public partial struct Volume { return TimeSpan.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs b/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs index 2d31a4785e..14282a40af 100644 --- a/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs +++ b/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -21,20 +21,10 @@ using System; -// ReSharper disable once CheckNamespace namespace UnitsNet { - // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components - // Public structures can't have any members other than public fields, and those fields must be value types or strings. - // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. -#if WINDOWS_UWP - public sealed partial class VolumeFlow -#else public partial struct VolumeFlow -#endif { - // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP public static Volume operator *(VolumeFlow volumeFlow, TimeSpan timeSpan) { return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * timeSpan.TotalSeconds); @@ -64,6 +54,5 @@ public partial struct VolumeFlow { return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); } -#endif } } diff --git a/UnitsNet/CustomCode/Quantity.cs b/UnitsNet/CustomCode/Quantity.cs index 20002b116a..cbe6d876c7 100644 --- a/UnitsNet/CustomCode/Quantity.cs +++ b/UnitsNet/CustomCode/Quantity.cs @@ -1,23 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using UnitsNet.InternalHelpers; -#if WINDOWS_UWP - using FromValue = System.Double; -#else - using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { -#if WINDOWS_UWP - internal -#else - public -#endif - partial class Quantity + public partial class Quantity { private static readonly Lazy InfosLazy; @@ -27,7 +15,6 @@ static Quantity() Types = quantityTypes; Names = quantityTypes.Select(qt => qt.ToString()).ToArray(); -#if !WINDOWS_UWP // A bunch of reflection to enumerate quantity types, instantiate with the default constructor and return its QuantityInfo property InfosLazy = new Lazy(() => typeof(Length) .Wrap() @@ -40,7 +27,6 @@ static Quantity() .Select(q => q.QuantityInfo) .OrderBy(q => q.Name) .ToArray()); -#endif } /// @@ -53,12 +39,10 @@ static Quantity() /// public static string[] Names { get; } -#if !WINDOWS_UWP /// /// All quantity information objects, such as and . /// public static QuantityInfo[] Infos => InfosLazy.Value; -#endif /// /// Dynamically construct a quantity. @@ -67,11 +51,7 @@ static Quantity() /// Unit enum value. /// An object. /// Unit value is not a know unit enum type. -#if WINDOWS_UWP - internal static IQuantity From(FromValue value, Enum unit) -#else - public static IQuantity From(FromValue value, Enum unit) -#endif + public static IQuantity From(QuantityValue value, Enum unit) { if (TryFrom(value, unit, out IQuantity quantity)) return quantity; diff --git a/UnitsNet/CustomCode/QuantityParser.cs b/UnitsNet/CustomCode/QuantityParser.cs index d58df984a1..0e96e0a3b1 100644 --- a/UnitsNet/CustomCode/QuantityParser.cs +++ b/UnitsNet/CustomCode/QuantityParser.cs @@ -31,15 +31,9 @@ namespace UnitsNet { -#if !WINDOWS_UWP internal delegate TQuantity QuantityFromDelegate(QuantityValue value, TUnitType fromUnit) where TQuantity : IQuantity where TUnitType : Enum; -#else - internal delegate TQuantity QuantityFromDelegate(double value, TUnitType fromUnit) - where TQuantity : IQuantity - where TUnitType : Enum; -#endif internal class QuantityParser { diff --git a/UnitsNet/CustomCode/UnitAbbreviationsCache.cs b/UnitsNet/CustomCode/UnitAbbreviationsCache.cs index 6e2ab49532..90cd57da5d 100644 --- a/UnitsNet/CustomCode/UnitAbbreviationsCache.cs +++ b/UnitsNet/CustomCode/UnitAbbreviationsCache.cs @@ -79,13 +79,7 @@ private void LoadGeneratedAbbreviations() /// Unit abbreviations to add. /// The type of unit enum. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviations) where TUnitType : Enum + public void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviations) where TUnitType : Enum { MapUnitToAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviations); } @@ -98,14 +92,7 @@ void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviati /// The unit enum value. /// Unit abbreviations to add as default. /// The type of unit enum. - [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation) where TUnitType : Enum + public void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation) where TUnitType : Enum { MapUnitToDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviation); } @@ -120,13 +107,7 @@ void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation /// Unit abbreviations to add. /// The type of unit enum. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(TUnitType unit, IFormatProvider formatProvider, params string[] abbreviations) where TUnitType : Enum + public void MapUnitToAbbreviation(TUnitType unit, IFormatProvider formatProvider, params string[] abbreviations) where TUnitType : Enum { // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer @@ -147,13 +128,7 @@ void MapUnitToAbbreviation(TUnitType unit, IFormatProvider formatProv /// Unit abbreviation to add as default. /// The type of unit enum. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider, string abbreviation) where TUnitType : Enum + public void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider, string abbreviation) where TUnitType : Enum { // Assuming TUnitType is an enum, this conversion is safe. Seems not possible to enforce this today. // Src: http://stackoverflow.com/questions/908543/how-to-convert-from-system-enum-to-base-integer @@ -174,13 +149,7 @@ void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvider for /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations to add. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) + public void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) { PerformAbbreviationMapping(unitType, unitValue, formatProvider, false, abbreviations); } @@ -195,13 +164,7 @@ void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatP /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviation to add as default. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - void MapUnitToDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] string abbreviation) + public void MapUnitToDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] string abbreviation) { PerformAbbreviationMapping(unitType, unitValue, formatProvider, true, abbreviation); } @@ -237,13 +200,7 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro /// The type of unit enum. /// The default unit abbreviation string. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + public string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum { var unitType = typeof(TUnitType); @@ -277,12 +234,7 @@ string GetDefaultAbbreviation(TUnitType unit, IFormatProvider formatP /// The format provider to use for lookup. Defaults to if null. /// The default unit abbreviation string. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) + public string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) { if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) { @@ -312,13 +264,7 @@ string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider form /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum + public string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum { return GetUnitAbbreviations(typeof(TUnitType), Convert.ToInt32(unit), formatProvider); } @@ -331,12 +277,7 @@ string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatP /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) + public string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; @@ -357,12 +298,7 @@ string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider form /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) + public string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; diff --git a/UnitsNet/CustomCode/UnitParser.cs b/UnitsNet/CustomCode/UnitParser.cs index 7e1d3e093f..a2b6eb4076 100644 --- a/UnitsNet/CustomCode/UnitParser.cs +++ b/UnitsNet/CustomCode/UnitParser.cs @@ -52,12 +52,7 @@ static UnitParser() /// /// [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider = null) where TUnitType : Enum + public TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider = null) where TUnitType : Enum { return (TUnitType)Parse(unitAbbreviation, typeof(TUnitType)); } @@ -76,12 +71,7 @@ TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatProvider /// No units match the abbreviation. /// More than one unit matches the abbreviation. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider = null) + public Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider = null) { if (unitAbbreviation == null) throw new ArgumentNullException(nameof(unitAbbreviation)); unitAbbreviation = unitAbbreviation.Trim(); @@ -116,13 +106,7 @@ Enum Parse([NotNull] string unitAbbreviation, Type unitType, [CanBeNull] IFormat /// Type of unit enum. /// True if successful. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, out TUnitType unit) where TUnitType : Enum + public bool TryParse(string unitAbbreviation, out TUnitType unit) where TUnitType : Enum { return TryParse(unitAbbreviation, null, out unit); } @@ -136,13 +120,7 @@ bool TryParse(string unitAbbreviation, out TUnitType unit) where TUni /// Type of unit enum. /// True if successful. [PublicAPI] - // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider, out TUnitType unit) where TUnitType : Enum + public bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider formatProvider, out TUnitType unit) where TUnitType : Enum { unit = default; @@ -161,12 +139,7 @@ bool TryParse(string unitAbbreviation, [CanBeNull] IFormatProvider fo /// The unit enum value as out result. /// True if successful. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) + public bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) { return TryParse(unitAbbreviation, unitType, null, out unit); } @@ -180,12 +153,7 @@ bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) /// The unit enum value as out result. /// True if successful. [PublicAPI] -#if WINDOWS_UWP - internal -#else - public -#endif - bool TryParse(string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider, out Enum unit) + public bool TryParse(string unitAbbreviation, Type unitType, [CanBeNull] IFormatProvider formatProvider, out Enum unit) { if (unitAbbreviation == null) { diff --git a/UnitsNet/CustomCode/UnitValueAbbreviationLookup.cs b/UnitsNet/CustomCode/UnitValueAbbreviationLookup.cs index c79d17e305..ea171c3a33 100644 --- a/UnitsNet/CustomCode/UnitValueAbbreviationLookup.cs +++ b/UnitsNet/CustomCode/UnitValueAbbreviationLookup.cs @@ -26,7 +26,6 @@ using UnitToAbbreviationMap = System.Collections.Generic.Dictionary>; using AbbreviationToUnitMap = System.Collections.Generic.Dictionary>; -// ReSharper disable once CheckNamespace namespace UnitsNet { internal class UnitValueAbbreviationLookup diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index dcb6cdf144..88498c2624 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -40,12 +40,10 @@ public partial interface IQuantity /// BaseDimensions Dimensions { get; } -#if !WINDOWS_UWP /// /// Information about the quantity type, such as unit values and names. /// QuantityInfo QuantityInfo { get; } -#endif /// /// Dynamically convert to another unit representation. @@ -53,36 +51,20 @@ public partial interface IQuantity /// The unit enum value. The unit must be compatible, so for you should provide a value. /// Value converted to the specified unit. /// Wrong unit enum type was given. -#if WINDOWS_UWP - double As(object unit); -#else double As(Enum unit); -#endif /// /// The unit this quantity was constructed with or the BaseUnit if the default constructor was used. /// - -#if WINDOWS_UWP - object Unit { get; } -#else Enum Unit { get; } -#endif -#if !WINDOWS_UWP /// /// 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. IQuantity ToUnit(Enum unit); -#endif - } -#if !WINDOWS_UWP - - public partial interface IQuantity - { /// /// Get string representation of value and unit. Using two significant digits after radix. /// @@ -108,38 +90,6 @@ public partial interface IQuantity string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args); } -#else - - public partial interface IQuantity - { - /// - /// Get string representation of value and unit. Using two significant digits after radix. - /// - /// String representation. - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - string ToString([CanBeNull] string cultureName); - - /// - /// Get string representation of value and unit. - /// - /// The number of significant digits after the radix point. - /// String representation. - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - string ToString(string cultureName, int significantDigitsAfterRadix); - - /// - /// Get string representation of value and unit. - /// - /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." - /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. - /// String representation. - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to if null. - string ToString([CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args); - } - -#endif - -#if !WINDOWS_UWP public interface IQuantity : IQuantity where TUnitType : Enum { /// @@ -161,5 +111,4 @@ public interface IQuantity : IQuantity where TUnitType : Enum /// IQuantity ToUnit(TUnitType unit); } -#endif } diff --git a/UnitsNet/QuantityInfo.cs b/UnitsNet/QuantityInfo.cs index 6eabf7ddbe..07178e01b8 100644 --- a/UnitsNet/QuantityInfo.cs +++ b/UnitsNet/QuantityInfo.cs @@ -37,12 +37,7 @@ namespace UnitsNet /// /// Typically you obtain this by looking it up via . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class QuantityInfo + public class QuantityInfo { private static readonly string UnitEnumNamespace = typeof(LengthUnit).Namespace; @@ -128,7 +123,6 @@ public QuantityInfo(QuantityType quantityType, [NotNull] Enum[] units, [NotNull] public BaseDimensions BaseDimensions { get; } } -#if !WINDOWS_UWP /// /// /// This is a specialization of , for when the unit type is known. @@ -169,5 +163,4 @@ public QuantityInfo(QuantityType quantityType, TUnit[] units, TUnit baseUnit, IQ /// public new TUnit UnitType { get; } } -#endif } diff --git a/UnitsNet/QuantityNotFoundException.cs b/UnitsNet/QuantityNotFoundException.cs index d7e6be736b..9fe03b95de 100644 --- a/UnitsNet/QuantityNotFoundException.cs +++ b/UnitsNet/QuantityNotFoundException.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -27,12 +27,7 @@ namespace UnitsNet /// Quantity type was not found. This is typically thrown for dynamic conversions, /// such as . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class QuantityNotFoundException : UnitsNetException + public class QuantityNotFoundException : UnitsNetException { public QuantityNotFoundException() { @@ -46,4 +41,4 @@ public QuantityNotFoundException(string message, Exception innerException) : bas { } } -} \ No newline at end of file +} diff --git a/UnitsNet/QuantityValue.cs b/UnitsNet/QuantityValue.cs index e1385fa68e..502aaa62dc 100644 --- a/UnitsNet/QuantityValue.cs +++ b/UnitsNet/QuantityValue.cs @@ -19,11 +19,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// Operator overloads not supported in Windows Runtime Components, we use 'double' type instead - using UnitsNet.InternalHelpers; -#if !WINDOWS_UWP namespace UnitsNet { /// @@ -110,4 +107,3 @@ public override string ToString() } } } -#endif diff --git a/UnitsNet/UnitConverter.cs b/UnitsNet/UnitConverter.cs index 817601ddb2..db42a17549 100644 --- a/UnitsNet/UnitConverter.cs +++ b/UnitsNet/UnitConverter.cs @@ -23,22 +23,16 @@ using System.Globalization; using System.Linq; using System.Reflection; +using JetBrains.Annotations; using UnitsNet.InternalHelpers; using UnitsNet.Units; -#if WINDOWS_UWP -using Culture = System.String; -using FromValue = System.Double; -#else -using Culture = System.IFormatProvider; -using FromValue = UnitsNet.QuantityValue; -#endif - namespace UnitsNet { /// /// Convert between units of a quantity, such as converting from meters to centimeters of a given length. /// + [PublicAPI] public static class UnitConverter { private static readonly string UnitTypeNamespace = typeof(LengthUnit).Namespace; @@ -60,12 +54,7 @@ public static class UnitConverter /// From unit enum value. /// To unit enum value, must be compatible with . /// The converted value in the new unit representation. -#if WINDOWS_UWP - internal -#else - public -#endif - static double Convert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue) + public static double Convert(QuantityValue fromValue, Enum fromUnitValue, Enum toUnitValue) { return Quantity .From(fromValue, fromUnitValue) @@ -80,12 +69,7 @@ static double Convert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue) /// To unit enum value, must be compatible with . /// The converted value, if successful. Otherwise default. /// True if successful. -#if WINDOWS_UWP - internal -#else - public -#endif - static bool TryConvert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) + public static bool TryConvert(QuantityValue fromValue, Enum fromUnitValue, Enum toUnitValue, out double convertedValue) { convertedValue = 0; if (!Quantity.TryFrom(fromValue, fromUnitValue, out IQuantity from)) return false; @@ -131,7 +115,7 @@ static bool TryConvert(FromValue fromValue, Enum fromUnitValue, Enum toUnitValue /// No quantities were found that match . /// No units match the abbreviation. /// More than one unit matches the abbreviation. - public static double ConvertByName(FromValue fromValue, string quantityName, string fromUnit, string toUnit) + public static double ConvertByName(QuantityValue fromValue, string quantityName, string fromUnit, string toUnit) { if (!TryGetUnitType(quantityName, out Type unitType)) throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); @@ -180,7 +164,7 @@ public static double ConvertByName(FromValue fromValue, string quantityName, str /// Result if conversion was successful, 0 if not. /// bool ok = TryConvertByName(5, "Length", "Meter", "Centimeter", out double centimeters); // 500 /// True if conversion was successful. - public static bool TryConvertByName(FromValue inputValue, string quantityName, string fromUnit, string toUnit, out double result) + public static bool TryConvertByName(QuantityValue inputValue, string quantityName, string fromUnit, string toUnit, out double result) { result = 0d; @@ -223,10 +207,8 @@ public static bool TryConvertByName(FromValue inputValue, string quantityName, s /// /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// Output value as the result of converting to . - public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) + public static double ConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev) { - // WindowsRuntimeComponent does not support default values on public methods - // ReSharper disable once IntroduceOptionalParameters.Global return ConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, null); } @@ -263,7 +245,7 @@ public static double ConvertByAbbreviation(FromValue fromValue, string quantityN /// are mapped to the abbreviation. /// /// More than one unit matches the abbreviation. - public static double ConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string culture) + public static double ConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, string culture) { if (!TryGetQuantityType(quantityName, out var quantityType)) throw new QuantityNotFoundException($"The given quantity name was not found: {quantityName}"); @@ -312,7 +294,7 @@ public static double ConvertByAbbreviation(FromValue fromValue, string quantityN /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) + public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result) { return TryConvertByAbbreviation(fromValue, quantityName, fromUnitAbbrev, toUnitAbbrev, out result, null); } @@ -345,7 +327,7 @@ public static bool TryConvertByAbbreviation(FromValue fromValue, string quantity /// Result if conversion was successful, 0 if not. /// double centimeters = ConvertByName(5, "Length", "m", "cm"); // 500 /// True if conversion was successful. - public static bool TryConvertByAbbreviation(FromValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, + public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quantityName, string fromUnitAbbrev, string toUnitAbbrev, out double result, string culture) { result = 0d; @@ -394,7 +376,7 @@ private static MethodInfo GetStaticFromMethod(Type quantityType, Type unitType) .Single(m => m.Name == "From" && m.IsStatic && m.IsPublic && - HasParameterTypes(m, typeof(FromValue), unitType) && + HasParameterTypes(m, typeof(QuantityValue), unitType) && m.ReturnType == quantityType); } diff --git a/UnitsNet/UnitInfo.cs b/UnitsNet/UnitInfo.cs index e1f3f8004a..f988e41470 100644 --- a/UnitsNet/UnitInfo.cs +++ b/UnitsNet/UnitInfo.cs @@ -33,12 +33,7 @@ namespace UnitsNet /// /// Typically you obtain this by looking it up via . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitInfo + public class UnitInfo { public UnitInfo(Enum value) { @@ -58,7 +53,6 @@ public UnitInfo(Enum value) public string Name { get; } } -#if !WINDOWS_UWP /// /// /// This is a specialization of , for when the unit type is known. @@ -76,5 +70,4 @@ public UnitInfo(TUnit value) : base(value) public new TUnit Value { get; } } -#endif } diff --git a/UnitsNet/UnitNotFoundException.cs b/UnitsNet/UnitNotFoundException.cs index 02d54f051c..53b1eec04f 100644 --- a/UnitsNet/UnitNotFoundException.cs +++ b/UnitsNet/UnitNotFoundException.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -27,12 +27,7 @@ namespace UnitsNet /// Unit was not found. This is typically thrown for dynamic conversions, /// such as . /// -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitNotFoundException : UnitsNetException + public class UnitNotFoundException : UnitsNetException { public UnitNotFoundException() { @@ -46,4 +41,4 @@ public UnitNotFoundException(string message, Exception innerException) : base(me { } } -} \ No newline at end of file +} diff --git a/UnitsNet/UnitSystem.cs b/UnitsNet/UnitSystem.cs index 695626b763..8c207d22dd 100644 --- a/UnitsNet/UnitSystem.cs +++ b/UnitsNet/UnitSystem.cs @@ -25,11 +25,7 @@ namespace UnitsNet { -#if !WINDOWS_UWP - public sealed partial class UnitSystem : IEquatable { } -#endif - - public sealed partial class UnitSystem + public sealed class UnitSystem : IEquatable { /// /// Creates an instance of a unit system with the specified base units. @@ -67,9 +63,6 @@ public override bool Equals(object obj) return Equals((UnitSystem)obj); } -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] -#endif public bool Equals(UnitSystem other) { if(other is null) @@ -78,8 +71,6 @@ public bool Equals(UnitSystem other) return BaseUnits.Equals(other.BaseUnits); } -#if !WINDOWS_UWP - /// /// Checks if this instance is equal to another. /// @@ -104,8 +95,6 @@ public bool Equals(UnitSystem other) return !(left == right); } -#endif - /// public override int GetHashCode() { diff --git a/UnitsNet/UnitsNet.csproj b/UnitsNet/UnitsNet.csproj index 21a2e21417..7bd01e5f60 100644 --- a/UnitsNet/UnitsNet.csproj +++ b/UnitsNet/UnitsNet.csproj @@ -47,7 +47,7 @@ - + Common\%(RecursiveDir)%(Filename)%(Extension) @@ -55,7 +55,6 @@ - diff --git a/UnitsNet/UnitsNetException.cs b/UnitsNet/UnitsNetException.cs index 44d47ba6e0..fdfc737dd6 100644 --- a/UnitsNet/UnitsNetException.cs +++ b/UnitsNet/UnitsNetException.cs @@ -1,16 +1,16 @@ // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). // https://github.com/angularsen/UnitsNet -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -23,12 +23,7 @@ namespace UnitsNet { -#if WINDOWS_UWP - internal -#else - public -#endif - class UnitsNetException : Exception + public class UnitsNetException : Exception { public UnitsNetException() { @@ -45,4 +40,4 @@ public UnitsNetException(string message, Exception innerException) : base(messag HResult = 1; } } -} \ No newline at end of file +} From bfb5122c24f4ed418cf14058eb11b2c51db2c428 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Wed, 13 Feb 2019 00:38:05 +0100 Subject: [PATCH 08/10] Ignore namespace in CustomCode folder --- UnitsNet/UnitsNet.csproj.DotSettings | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnitsNet/UnitsNet.csproj.DotSettings b/UnitsNet/UnitsNet.csproj.DotSettings index 0b0edaecd0..78ef24c567 100644 --- a/UnitsNet/UnitsNet.csproj.DotSettings +++ b/UnitsNet/UnitsNet.csproj.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + True \ No newline at end of file From 79f35d7b703f31bd469a7ad04982f3d73c042966 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Wed, 13 Feb 2019 00:57:44 +0100 Subject: [PATCH 09/10] AppVeyor: Run build-with-wrc.bat For now, we want to build WRC, business as usual. If we find that WRC keeps adding pain even with separate code and scripts, we can further consider removing it from continuous integration. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 14c7decb78..24772508f8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ build_script: # Build, test, pack and push nugets ##################################### - .\\build.bat + .\\build-with-wrc.bat $BuildExitCode = $LASTEXITCODE ##################################### From 5a2d402528abb33774d4d9a785a2c19f5937c42d Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Wed, 13 Feb 2019 01:00:03 +0100 Subject: [PATCH 10/10] Fix error trying to delete non-existing Artifacts dir --- Build/build-functions.psm1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Build/build-functions.psm1 b/Build/build-functions.psm1 index 1a60be8fdc..014366f985 100644 --- a/Build/build-functions.psm1 +++ b/Build/build-functions.psm1 @@ -10,9 +10,11 @@ if ($msbuild) { } function Remove-ArtifactsDir { - write-host -foreground blue "Clean up...`n" - rm $artifactsDir -Recurse -Force -ErrorAction Stop - write-host -foreground blue "Clean up...END`n" + if (Test-Path $artifactsDir) { + write-host -foreground blue "Clean up...`n" + rm $artifactsDir -Recurse -Force -ErrorAction Stop + write-host -foreground blue "Clean up...END`n" + } } function Update-GeneratedCode {