From 3cb3efd57c5ed7cfdcaa361cdbdeb01f3e116e6a Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 27 Sep 2018 16:44:21 -0400 Subject: [PATCH 1/5] Removing obsolete quantity units --- .../Quantities/Duration.Common.g.cs | 46 - .../GeneratedCode/Quantities/Flow.Common.g.cs | 1026 ----------------- .../Quantities/Pressure.Common.g.cs | 23 - .../Quantities/TemperatureDelta.Common.g.cs | 184 --- .../Quantities/Volume.Common.g.cs | 46 - Common/UnitDefinitions/Duration.json | 34 - Common/UnitDefinitions/Flow.json | 263 ----- Common/UnitDefinitions/Pressure.json | 17 - Common/UnitDefinitions/TemperatureDelta.json | 104 -- Common/UnitDefinitions/Volume.json | 42 - UnitsNet.Tests/CustomCode/DurationTests.cs | 4 - UnitsNet.Tests/CustomCode/FlowTests.cs | 72 -- UnitsNet.Tests/CustomCode/LapseRateTests.cs | 8 +- UnitsNet.Tests/CustomCode/PressureTests.cs | 2 - .../CustomCode/TemperatureDeltaTests.cs | 9 - UnitsNet.Tests/CustomCode/VolumeTests.cs | 8 - .../GeneratedCode/DurationTestsBase.g.cs | 20 - .../GeneratedCode/FlowTestsBase.g.cs | 427 ------- .../GeneratedCode/PressureTestsBase.g.cs | 10 - .../TemperatureDeltaTestsBase.g.cs | 80 -- .../GeneratedCode/VolumeTestsBase.g.cs | 20 - UnitsNet.Tests/UnitSystemTests.cs | 18 +- .../Flow.WindowsRuntimeComponent.g.cs | 239 ---- .../CustomCode/Quantities/LapseRate.extra.cs | 4 +- .../Quantities/Temperature.extra.cs | 8 +- .../Quantities/TemperatureDelta.extra.cs | 2 +- .../Number/NumberToDurationExtensions.g.cs | 24 - .../Number/NumberToFlowExtensions.g.cs | 331 ------ .../Number/NumberToPressureExtensions.g.cs | 12 - .../NumberToTemperatureDeltaExtensions.g.cs | 96 -- .../Number/NumberToVolumeExtensions.g.cs | 24 - .../Quantities/Duration.NetFramework.g.cs | 18 - .../Quantities/Flow.NetFramework.g.cs | 528 --------- .../Quantities/Pressure.NetFramework.g.cs | 9 - .../TemperatureDelta.NetFramework.g.cs | 72 -- .../Quantities/Volume.NetFramework.g.cs | 18 - UnitsNet/GeneratedCode/QuantityType.g.cs | 1 - .../GeneratedCode/UnitSystem.Default.g.cs | 200 ---- .../GeneratedCode/Units/DurationUnit.g.cs | 4 - UnitsNet/GeneratedCode/Units/FlowUnit.g.cs | 93 -- .../GeneratedCode/Units/PressureUnit.g.cs | 2 - .../Units/TemperatureDeltaUnit.g.cs | 16 - UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs | 4 - 43 files changed, 19 insertions(+), 4149 deletions(-) delete mode 100644 Common/GeneratedCode/Quantities/Flow.Common.g.cs delete mode 100644 Common/UnitDefinitions/Flow.json delete mode 100644 UnitsNet.Tests/CustomCode/FlowTests.cs delete mode 100644 UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs delete mode 100644 UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs delete mode 100644 UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs delete mode 100644 UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs delete mode 100644 UnitsNet/GeneratedCode/Units/FlowUnit.g.cs diff --git a/Common/GeneratedCode/Quantities/Duration.Common.g.cs b/Common/GeneratedCode/Quantities/Duration.Common.g.cs index 58ea15708b..a0593d34e1 100644 --- a/Common/GeneratedCode/Quantities/Duration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Duration.Common.g.cs @@ -186,12 +186,6 @@ public static BaseDimensions BaseDimensions /// public double Minutes => As(DurationUnit.Minute); - /// - /// Get Duration in Months. - /// - [System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")] - public double Months => As(DurationUnit.Month); - /// /// Get Duration in Months30. /// @@ -212,12 +206,6 @@ public static BaseDimensions BaseDimensions /// public double Weeks => As(DurationUnit.Week); - /// - /// Get Duration in Years. - /// - [System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")] - public double Years => As(DurationUnit.Year); - /// /// Get Duration in Years365. /// @@ -302,21 +290,6 @@ public static Duration FromMinutes(QuantityValue minutes) return new Duration(value, DurationUnit.Minute); } - /// - /// Get Duration from Months. - /// - [System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Duration FromMonths(double months) -#else - public static Duration FromMonths(QuantityValue months) -#endif - { - double value = (double) months; - return new Duration(value, DurationUnit.Month); - } - /// /// Get Duration from Months30. /// @@ -373,21 +346,6 @@ public static Duration FromWeeks(QuantityValue weeks) return new Duration(value, DurationUnit.Week); } - /// - /// Get Duration from Years. - /// - [System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Duration FromYears(double years) -#else - public static Duration FromYears(QuantityValue years) -#endif - { - double value = (double) years; - return new Duration(value, DurationUnit.Year); - } - /// /// Get Duration from Years365. /// @@ -579,12 +537,10 @@ private double AsBaseUnit() case DurationUnit.Microsecond: return (_value) * 1e-6d; case DurationUnit.Millisecond: return (_value) * 1e-3d; case DurationUnit.Minute: return _value*60; - case DurationUnit.Month: return _value*30*24*3600; case DurationUnit.Month30: return _value*30*24*3600; case DurationUnit.Nanosecond: return (_value) * 1e-9d; case DurationUnit.Second: return _value; case DurationUnit.Week: return _value*7*24*3600; - case DurationUnit.Year: return _value*365*24*3600; case DurationUnit.Year365: return _value*365*24*3600; default: throw new NotImplementedException($"Can not convert {Unit} to base units."); @@ -605,12 +561,10 @@ private double AsBaseNumericType(DurationUnit unit) case DurationUnit.Microsecond: return (baseUnitValue) / 1e-6d; case DurationUnit.Millisecond: return (baseUnitValue) / 1e-3d; case DurationUnit.Minute: return baseUnitValue/60; - case DurationUnit.Month: return baseUnitValue/(30*24*3600); case DurationUnit.Month30: return baseUnitValue/(30*24*3600); case DurationUnit.Nanosecond: return (baseUnitValue) / 1e-9d; case DurationUnit.Second: return baseUnitValue; case DurationUnit.Week: return baseUnitValue/(7*24*3600); - case DurationUnit.Year: return baseUnitValue/(365*24*3600); case DurationUnit.Year365: return baseUnitValue/(365*24*3600); default: throw new NotImplementedException($"Can not convert {Unit} to {unit}."); diff --git a/Common/GeneratedCode/Quantities/Flow.Common.g.cs b/Common/GeneratedCode/Quantities/Flow.Common.g.cs deleted file mode 100644 index 92500edca9..0000000000 --- a/Common/GeneratedCode/Quantities/Flow.Common.g.cs +++ /dev/null @@ -1,1026 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Linq; -using JetBrains.Annotations; -using UnitsNet.Units; - -// ReSharper disable once CheckNamespace - -namespace UnitsNet -{ - /// - /// In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q. - /// - // ReSharper disable once PartialTypeWithSinglePart - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - - // 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 Flow : IQuantity -#else - public partial struct Flow : IQuantity, IComparable, IComparable -#endif - { - /// - /// The numeric value this quantity was constructed with. - /// - private readonly double _value; - - /// - /// The unit this quantity was constructed with. - /// - private readonly FlowUnit? _unit; - - /// - /// The unit this quantity was constructed with -or- if default ctor was used. - /// - public FlowUnit Unit => _unit.GetValueOrDefault(BaseUnit); - - static Flow() - { - BaseDimensions = new BaseDimensions(3, 0, -1, 0, 0, 0, 0); - } - - /// - /// Creates the quantity with the given value in the base unit CubicMeterPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Flow(double cubicmeterspersecond) - { - _value = Convert.ToDouble(cubicmeterspersecond); - _unit = BaseUnit; - } - - /// - /// Creates the quantity with the given numeric value and unit. - /// - /// Numeric value. - /// Unit representation. - /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. -#if WINDOWS_UWP - private -#else - public -#endif - Flow(double numericValue, FlowUnit unit) - { - _value = numericValue; - _unit = unit; - } - - // 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 - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerSecond. - /// - /// Value assuming base unit CubicMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Flow(long cubicmeterspersecond) : this(Convert.ToDouble(cubicmeterspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerSecond. - /// - /// Value assuming base unit CubicMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Flow(decimal cubicmeterspersecond) : this(Convert.ToDouble(cubicmeterspersecond), BaseUnit) { } - - #region Properties - - /// - /// The of this quantity. - /// - public static QuantityType QuantityType => QuantityType.Flow; - - /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. - /// - public static FlowUnit BaseUnit => FlowUnit.CubicMeterPerSecond; - - /// - /// The of this quantity. - /// - public static BaseDimensions BaseDimensions - { - get; - } - - /// - /// All units of measurement for the Flow quantity. - /// - public static FlowUnit[] Units { get; } = Enum.GetValues(typeof(FlowUnit)).Cast().Except(new FlowUnit[]{ FlowUnit.Undefined }).ToArray(); - - /// - /// Get Flow in CentilitersPerMinute. - /// - public double CentilitersPerMinute => As(FlowUnit.CentilitersPerMinute); - - /// - /// Get Flow in CubicDecimetersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicDecimetersPerMinute => As(FlowUnit.CubicDecimeterPerMinute); - - /// - /// Get Flow in CubicFeetPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicFeetPerHour => As(FlowUnit.CubicFootPerHour); - - /// - /// Get Flow in CubicFeetPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicFeetPerMinute => As(FlowUnit.CubicFootPerMinute); - - /// - /// Get Flow in CubicFeetPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicFeetPerSecond => As(FlowUnit.CubicFootPerSecond); - - /// - /// Get Flow in CubicMetersPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicMetersPerHour => As(FlowUnit.CubicMeterPerHour); - - /// - /// Get Flow in CubicMetersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicMetersPerMinute => As(FlowUnit.CubicMeterPerMinute); - - /// - /// Get Flow in CubicMetersPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicMetersPerSecond => As(FlowUnit.CubicMeterPerSecond); - - /// - /// Get Flow in CubicYardsPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicYardsPerHour => As(FlowUnit.CubicYardPerHour); - - /// - /// Get Flow in CubicYardsPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicYardsPerMinute => As(FlowUnit.CubicYardPerMinute); - - /// - /// Get Flow in CubicYardsPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double CubicYardsPerSecond => As(FlowUnit.CubicYardPerSecond); - - /// - /// Get Flow in DecilitersPerMinute. - /// - public double DecilitersPerMinute => As(FlowUnit.DecilitersPerMinute); - - /// - /// Get Flow in KilolitersPerMinute. - /// - public double KilolitersPerMinute => As(FlowUnit.KilolitersPerMinute); - - /// - /// Get Flow in LitersPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double LitersPerHour => As(FlowUnit.LitersPerHour); - - /// - /// Get Flow in LitersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double LitersPerMinute => As(FlowUnit.LitersPerMinute); - - /// - /// Get Flow in LitersPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double LitersPerSecond => As(FlowUnit.LitersPerSecond); - - /// - /// Get Flow in MicrolitersPerMinute. - /// - public double MicrolitersPerMinute => As(FlowUnit.MicrolitersPerMinute); - - /// - /// Get Flow in MillilitersPerMinute. - /// - public double MillilitersPerMinute => As(FlowUnit.MillilitersPerMinute); - - /// - /// Get Flow in MillionUsGallonsPerDay. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double MillionUsGallonsPerDay => As(FlowUnit.MillionUsGallonsPerDay); - - /// - /// Get Flow in NanolitersPerMinute. - /// - public double NanolitersPerMinute => As(FlowUnit.NanolitersPerMinute); - - /// - /// Get Flow in OilBarrelsPerDay. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double OilBarrelsPerDay => As(FlowUnit.OilBarrelsPerDay); - - /// - /// Get Flow in UsGallonsPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double UsGallonsPerHour => As(FlowUnit.UsGallonsPerHour); - - /// - /// Get Flow in UsGallonsPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double UsGallonsPerMinute => As(FlowUnit.UsGallonsPerMinute); - - /// - /// Get Flow in UsGallonsPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public double UsGallonsPerSecond => As(FlowUnit.UsGallonsPerSecond); - - #endregion - - #region Static - - /// - /// Gets an instance of this quantity with a value of 0 in the base unit CubicMeterPerSecond. - /// - public static Flow Zero => new Flow(0, BaseUnit); - - /// - /// Get Flow from CentilitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCentilitersPerMinute(double centilitersperminute) -#else - public static Flow FromCentilitersPerMinute(QuantityValue centilitersperminute) -#endif - { - double value = (double) centilitersperminute; - return new Flow(value, FlowUnit.CentilitersPerMinute); - } - - /// - /// Get Flow from CubicDecimetersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicDecimetersPerMinute(double cubicdecimetersperminute) -#else - public static Flow FromCubicDecimetersPerMinute(QuantityValue cubicdecimetersperminute) -#endif - { - double value = (double) cubicdecimetersperminute; - return new Flow(value, FlowUnit.CubicDecimeterPerMinute); - } - - /// - /// Get Flow from CubicFeetPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicFeetPerHour(double cubicfeetperhour) -#else - public static Flow FromCubicFeetPerHour(QuantityValue cubicfeetperhour) -#endif - { - double value = (double) cubicfeetperhour; - return new Flow(value, FlowUnit.CubicFootPerHour); - } - - /// - /// Get Flow from CubicFeetPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicFeetPerMinute(double cubicfeetperminute) -#else - public static Flow FromCubicFeetPerMinute(QuantityValue cubicfeetperminute) -#endif - { - double value = (double) cubicfeetperminute; - return new Flow(value, FlowUnit.CubicFootPerMinute); - } - - /// - /// Get Flow from CubicFeetPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicFeetPerSecond(double cubicfeetpersecond) -#else - public static Flow FromCubicFeetPerSecond(QuantityValue cubicfeetpersecond) -#endif - { - double value = (double) cubicfeetpersecond; - return new Flow(value, FlowUnit.CubicFootPerSecond); - } - - /// - /// Get Flow from CubicMetersPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicMetersPerHour(double cubicmetersperhour) -#else - public static Flow FromCubicMetersPerHour(QuantityValue cubicmetersperhour) -#endif - { - double value = (double) cubicmetersperhour; - return new Flow(value, FlowUnit.CubicMeterPerHour); - } - - /// - /// Get Flow from CubicMetersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicMetersPerMinute(double cubicmetersperminute) -#else - public static Flow FromCubicMetersPerMinute(QuantityValue cubicmetersperminute) -#endif - { - double value = (double) cubicmetersperminute; - return new Flow(value, FlowUnit.CubicMeterPerMinute); - } - - /// - /// Get Flow from CubicMetersPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicMetersPerSecond(double cubicmeterspersecond) -#else - public static Flow FromCubicMetersPerSecond(QuantityValue cubicmeterspersecond) -#endif - { - double value = (double) cubicmeterspersecond; - return new Flow(value, FlowUnit.CubicMeterPerSecond); - } - - /// - /// Get Flow from CubicYardsPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicYardsPerHour(double cubicyardsperhour) -#else - public static Flow FromCubicYardsPerHour(QuantityValue cubicyardsperhour) -#endif - { - double value = (double) cubicyardsperhour; - return new Flow(value, FlowUnit.CubicYardPerHour); - } - - /// - /// Get Flow from CubicYardsPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicYardsPerMinute(double cubicyardsperminute) -#else - public static Flow FromCubicYardsPerMinute(QuantityValue cubicyardsperminute) -#endif - { - double value = (double) cubicyardsperminute; - return new Flow(value, FlowUnit.CubicYardPerMinute); - } - - /// - /// Get Flow from CubicYardsPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromCubicYardsPerSecond(double cubicyardspersecond) -#else - public static Flow FromCubicYardsPerSecond(QuantityValue cubicyardspersecond) -#endif - { - double value = (double) cubicyardspersecond; - return new Flow(value, FlowUnit.CubicYardPerSecond); - } - - /// - /// Get Flow from DecilitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromDecilitersPerMinute(double decilitersperminute) -#else - public static Flow FromDecilitersPerMinute(QuantityValue decilitersperminute) -#endif - { - double value = (double) decilitersperminute; - return new Flow(value, FlowUnit.DecilitersPerMinute); - } - - /// - /// Get Flow from KilolitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromKilolitersPerMinute(double kilolitersperminute) -#else - public static Flow FromKilolitersPerMinute(QuantityValue kilolitersperminute) -#endif - { - double value = (double) kilolitersperminute; - return new Flow(value, FlowUnit.KilolitersPerMinute); - } - - /// - /// Get Flow from LitersPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromLitersPerHour(double litersperhour) -#else - public static Flow FromLitersPerHour(QuantityValue litersperhour) -#endif - { - double value = (double) litersperhour; - return new Flow(value, FlowUnit.LitersPerHour); - } - - /// - /// Get Flow from LitersPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromLitersPerMinute(double litersperminute) -#else - public static Flow FromLitersPerMinute(QuantityValue litersperminute) -#endif - { - double value = (double) litersperminute; - return new Flow(value, FlowUnit.LitersPerMinute); - } - - /// - /// Get Flow from LitersPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromLitersPerSecond(double literspersecond) -#else - public static Flow FromLitersPerSecond(QuantityValue literspersecond) -#endif - { - double value = (double) literspersecond; - return new Flow(value, FlowUnit.LitersPerSecond); - } - - /// - /// Get Flow from MicrolitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromMicrolitersPerMinute(double microlitersperminute) -#else - public static Flow FromMicrolitersPerMinute(QuantityValue microlitersperminute) -#endif - { - double value = (double) microlitersperminute; - return new Flow(value, FlowUnit.MicrolitersPerMinute); - } - - /// - /// Get Flow from MillilitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromMillilitersPerMinute(double millilitersperminute) -#else - public static Flow FromMillilitersPerMinute(QuantityValue millilitersperminute) -#endif - { - double value = (double) millilitersperminute; - return new Flow(value, FlowUnit.MillilitersPerMinute); - } - - /// - /// Get Flow from MillionUsGallonsPerDay. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromMillionUsGallonsPerDay(double millionusgallonsperday) -#else - public static Flow FromMillionUsGallonsPerDay(QuantityValue millionusgallonsperday) -#endif - { - double value = (double) millionusgallonsperday; - return new Flow(value, FlowUnit.MillionUsGallonsPerDay); - } - - /// - /// Get Flow from NanolitersPerMinute. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromNanolitersPerMinute(double nanolitersperminute) -#else - public static Flow FromNanolitersPerMinute(QuantityValue nanolitersperminute) -#endif - { - double value = (double) nanolitersperminute; - return new Flow(value, FlowUnit.NanolitersPerMinute); - } - - /// - /// Get Flow from OilBarrelsPerDay. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromOilBarrelsPerDay(double oilbarrelsperday) -#else - public static Flow FromOilBarrelsPerDay(QuantityValue oilbarrelsperday) -#endif - { - double value = (double) oilbarrelsperday; - return new Flow(value, FlowUnit.OilBarrelsPerDay); - } - - /// - /// Get Flow from UsGallonsPerHour. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromUsGallonsPerHour(double usgallonsperhour) -#else - public static Flow FromUsGallonsPerHour(QuantityValue usgallonsperhour) -#endif - { - double value = (double) usgallonsperhour; - return new Flow(value, FlowUnit.UsGallonsPerHour); - } - - /// - /// Get Flow from UsGallonsPerMinute. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromUsGallonsPerMinute(double usgallonsperminute) -#else - public static Flow FromUsGallonsPerMinute(QuantityValue usgallonsperminute) -#endif - { - double value = (double) usgallonsperminute; - return new Flow(value, FlowUnit.UsGallonsPerMinute); - } - - /// - /// Get Flow from UsGallonsPerSecond. - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Flow FromUsGallonsPerSecond(double usgallonspersecond) -#else - public static Flow FromUsGallonsPerSecond(QuantityValue usgallonspersecond) -#endif - { - double value = (double) usgallonspersecond; - return new Flow(value, FlowUnit.UsGallonsPerSecond); - } - - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Flow unit value. -#if WINDOWS_UWP - // Fix name conflict with parameter "value" - [return: System.Runtime.InteropServices.WindowsRuntime.ReturnValueName("returnValue")] - public static Flow From(double value, FlowUnit fromUnit) -#else - public static Flow From(QuantityValue value, FlowUnit fromUnit) -#endif - { - return new Flow((double)value, fromUnit); - } - - /// - /// Get unit abbreviation string. - /// - /// Unit to get abbreviation for. - /// Unit abbreviation string. - [UsedImplicitly] - public static string GetAbbreviation(FlowUnit unit) - { - return GetAbbreviation(unit, null); - } - - #endregion - - #region Equality / IComparable - - public int CompareTo(object obj) - { - if(obj is null) throw new ArgumentNullException(nameof(obj)); - if(!(obj is Flow)) throw new ArgumentException("Expected type Flow.", nameof(obj)); - - return CompareTo((Flow)obj); - } - - // 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 - int CompareTo(Flow other) - { - return _value.CompareTo(other.AsBaseNumericType(this.Unit)); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Flow)) - return false; - - var objQuantity = (Flow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - - /// - /// - /// Compare equality to another Flow 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(Flow 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); - } - - /// - /// Compare equality to another Flow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Flow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Flow other, Flow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - - /// - /// Returns the hash code for this instance. - /// - /// A hash code for the current Flow. - public override int GetHashCode() - { - return new { Value, Unit }.GetHashCode(); - } - - #endregion - - #region Conversion - - /// - /// Convert to the unit representation . - /// - /// Value converted to the specified unit. - public double As(FlowUnit unit) - { - if(Unit == unit) - return Convert.ToDouble(Value); - - var converted = AsBaseNumericType(unit); - return Convert.ToDouble(converted); - } - - /// - /// Converts this Flow to another Flow with the unit representation . - /// - /// A Flow with the specified unit. - public Flow ToUnit(FlowUnit unit) - { - var convertedValue = AsBaseNumericType(unit); - return new Flow(convertedValue, 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 double AsBaseUnit() - { - switch(Unit) - { - case FlowUnit.CentilitersPerMinute: return (_value/60000.00000) * 1e-2d; - case FlowUnit.CubicDecimeterPerMinute: return _value/60000.00000; - case FlowUnit.CubicFootPerHour: return _value*7.8657907199999087346816086183876e-6; - case FlowUnit.CubicFootPerMinute: return _value/2118.88000326; - case FlowUnit.CubicFootPerSecond: return _value/35.314666721; - case FlowUnit.CubicMeterPerHour: return _value/3600; - case FlowUnit.CubicMeterPerMinute: return _value/60; - case FlowUnit.CubicMeterPerSecond: return _value; - case FlowUnit.CubicYardPerHour: return _value*2.1237634944E-4; - case FlowUnit.CubicYardPerMinute: return _value*0.0127425809664; - case FlowUnit.CubicYardPerSecond: return _value*0.764554857984; - case FlowUnit.DecilitersPerMinute: return (_value/60000.00000) * 1e-1d; - case FlowUnit.KilolitersPerMinute: return (_value/60000.00000) * 1e3d; - case FlowUnit.LitersPerHour: return _value/3600000.000; - case FlowUnit.LitersPerMinute: return _value/60000.00000; - case FlowUnit.LitersPerSecond: return _value/1000; - case FlowUnit.MicrolitersPerMinute: return (_value/60000.00000) * 1e-6d; - case FlowUnit.MillilitersPerMinute: return (_value/60000.00000) * 1e-3d; - case FlowUnit.MillionUsGallonsPerDay: return _value/22.824465227; - case FlowUnit.NanolitersPerMinute: return (_value/60000.00000) * 1e-9d; - case FlowUnit.OilBarrelsPerDay: return _value*1.8401307283333333333333333333333e-6; - case FlowUnit.UsGallonsPerHour: return _value/951019.38848933424; - case FlowUnit.UsGallonsPerMinute: return _value/15850.323141489; - case FlowUnit.UsGallonsPerSecond: return _value/264.1720523581484; - default: - throw new NotImplementedException($"Can not convert {Unit} to base units."); - } - } - - private double AsBaseNumericType(FlowUnit unit) - { - if(Unit == unit) - return _value; - - var baseUnitValue = AsBaseUnit(); - - switch(unit) - { - case FlowUnit.CentilitersPerMinute: return (baseUnitValue*60000.00000) / 1e-2d; - case FlowUnit.CubicDecimeterPerMinute: return baseUnitValue*60000.00000; - case FlowUnit.CubicFootPerHour: return baseUnitValue/7.8657907199999087346816086183876e-6; - case FlowUnit.CubicFootPerMinute: return baseUnitValue*2118.88000326; - case FlowUnit.CubicFootPerSecond: return baseUnitValue*35.314666721; - case FlowUnit.CubicMeterPerHour: return baseUnitValue*3600; - case FlowUnit.CubicMeterPerMinute: return baseUnitValue*60; - case FlowUnit.CubicMeterPerSecond: return baseUnitValue; - case FlowUnit.CubicYardPerHour: return baseUnitValue/2.1237634944E-4; - case FlowUnit.CubicYardPerMinute: return baseUnitValue/0.0127425809664; - case FlowUnit.CubicYardPerSecond: return baseUnitValue/0.764554857984; - case FlowUnit.DecilitersPerMinute: return (baseUnitValue*60000.00000) / 1e-1d; - case FlowUnit.KilolitersPerMinute: return (baseUnitValue*60000.00000) / 1e3d; - case FlowUnit.LitersPerHour: return baseUnitValue*3600000.000; - case FlowUnit.LitersPerMinute: return baseUnitValue*60000.00000; - case FlowUnit.LitersPerSecond: return baseUnitValue*1000; - case FlowUnit.MicrolitersPerMinute: return (baseUnitValue*60000.00000) / 1e-6d; - case FlowUnit.MillilitersPerMinute: return (baseUnitValue*60000.00000) / 1e-3d; - case FlowUnit.MillionUsGallonsPerDay: return baseUnitValue*22.824465227; - case FlowUnit.NanolitersPerMinute: return (baseUnitValue*60000.00000) / 1e-9d; - case FlowUnit.OilBarrelsPerDay: return baseUnitValue/1.8401307283333333333333333333333e-6; - case FlowUnit.UsGallonsPerHour: return baseUnitValue*951019.38848933424; - case FlowUnit.UsGallonsPerMinute: return baseUnitValue*15850.323141489; - case FlowUnit.UsGallonsPerSecond: return baseUnitValue*264.1720523581484; - default: - throw new NotImplementedException($"Can not convert {Unit} to {unit}."); - } - } - - #endregion - - #region Parsing - - /// - /// 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 Flow Parse(string str) - { - return Parse(str, null); - } - - /// - /// 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 Flow result) - { - return TryParse(str, null, 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 FlowUnit ParseUnit(string str) - { - return ParseUnit(str, (IFormatProvider)null); - } - - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static FlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - - #endregion - - /// - /// Set the default unit used by ToString(). Default is CubicMeterPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static FlowUnit ToStringDefaultUnit { get; set; } = FlowUnit.CubicMeterPerSecond; - - /// - /// Get default string representation of value and unit. - /// - /// String representation. - public override string ToString() - { - return ToString(Unit); - } - - /// - /// Get string representation of value and unit. Using current UI culture and two significant digits after radix. - /// - /// Unit representation to use. - /// String representation. - public string ToString(FlowUnit unit) - { - return ToString(unit, null, 2); - } - - /// - /// Represents the largest possible value of Flow - /// - public static Flow MaxValue => new Flow(double.MaxValue, BaseUnit); - - /// - /// Represents the smallest possible value of Flow - /// - public static Flow MinValue => new Flow(double.MinValue, BaseUnit); - - /// - /// The of this quantity. - /// - public QuantityType Type => Flow.QuantityType; - - /// - /// The of this quantity. - /// - public BaseDimensions Dimensions => Flow.BaseDimensions; - } -} diff --git a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs index 26a39fe932..6eac7f04c4 100644 --- a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs @@ -321,12 +321,6 @@ public static BaseDimensions BaseDimensions /// public double PoundsForcePerSquareInch => As(PressureUnit.PoundForcePerSquareInch); - /// - /// Get Pressure in Psi. - /// - [System.Obsolete("Deprecated due to github issue #215, please use PoundForcePerSquareInch instead")] - public double Psi => As(PressureUnit.Psi); - /// /// Get Pressure in TechnicalAtmospheres. /// @@ -809,21 +803,6 @@ public static Pressure FromPoundsForcePerSquareInch(QuantityValue poundsforceper return new Pressure(value, PressureUnit.PoundForcePerSquareInch); } - /// - /// Get Pressure from Psi. - /// - [System.Obsolete("Deprecated due to github issue #215, please use PoundForcePerSquareInch instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Pressure FromPsi(double psi) -#else - public static Pressure FromPsi(QuantityValue psi) -#endif - { - double value = (double) psi; - return new Pressure(value, PressureUnit.Psi); - } - /// /// Get Pressure from TechnicalAtmospheres. /// @@ -1098,7 +1077,6 @@ private double AsBaseUnit() case PressureUnit.Pascal: return _value; case PressureUnit.PoundForcePerSquareFoot: return _value*4.788025898033584e1; case PressureUnit.PoundForcePerSquareInch: return _value*6.894757293168361e3; - case PressureUnit.Psi: return _value*6.894757293168361e3; case PressureUnit.TechnicalAtmosphere: return _value*9.80680592331*1e4; case PressureUnit.TonneForcePerSquareCentimeter: return _value*9.80665e7; case PressureUnit.TonneForcePerSquareMeter: return _value*9.80665e3; @@ -1150,7 +1128,6 @@ private double AsBaseNumericType(PressureUnit unit) case PressureUnit.Pascal: return baseUnitValue; case PressureUnit.PoundForcePerSquareFoot: return baseUnitValue/4.788025898033584e1; case PressureUnit.PoundForcePerSquareInch: return baseUnitValue/6.894757293168361e3; - case PressureUnit.Psi: return baseUnitValue/6.894757293168361e3; case PressureUnit.TechnicalAtmosphere: return baseUnitValue/(9.80680592331*1e4); case PressureUnit.TonneForcePerSquareCentimeter: return baseUnitValue/9.80665e7; case PressureUnit.TonneForcePerSquareMeter: return baseUnitValue/9.80665e3; diff --git a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs index f450738404..fd837da213 100644 --- a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs @@ -165,89 +165,41 @@ public static BaseDimensions BaseDimensions /// public double DegreesCelsius => As(TemperatureDeltaUnit.DegreeCelsius); - /// - /// Get TemperatureDelta in DegreesCelsiusDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeCelsius instead")] - public double DegreesCelsiusDelta => As(TemperatureDeltaUnit.DegreeCelsiusDelta); - /// /// Get TemperatureDelta in DegreesDelisle. /// public double DegreesDelisle => As(TemperatureDeltaUnit.DegreeDelisle); - /// - /// Get TemperatureDelta in DegreesDelisleDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeDelisle instead")] - public double DegreesDelisleDelta => As(TemperatureDeltaUnit.DegreeDelisleDelta); - /// /// Get TemperatureDelta in DegreesFahrenheit. /// public double DegreesFahrenheit => As(TemperatureDeltaUnit.DegreeFahrenheit); - /// - /// Get TemperatureDelta in DegreesFahrenheitDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeFahrenheit instead")] - public double DegreesFahrenheitDelta => As(TemperatureDeltaUnit.DegreeFahrenheitDelta); - /// /// Get TemperatureDelta in DegreesNewton. /// public double DegreesNewton => As(TemperatureDeltaUnit.DegreeNewton); - /// - /// Get TemperatureDelta in DegreesNewtonDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeNewton instead")] - public double DegreesNewtonDelta => As(TemperatureDeltaUnit.DegreeNewtonDelta); - /// /// Get TemperatureDelta in DegreesRankine. /// public double DegreesRankine => As(TemperatureDeltaUnit.DegreeRankine); - /// - /// Get TemperatureDelta in DegreesRankineDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRankine instead")] - public double DegreesRankineDelta => As(TemperatureDeltaUnit.DegreeRankineDelta); - /// /// Get TemperatureDelta in DegreesReaumur. /// public double DegreesReaumur => As(TemperatureDeltaUnit.DegreeReaumur); - /// - /// Get TemperatureDelta in DegreesReaumurDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeReaumur instead")] - public double DegreesReaumurDelta => As(TemperatureDeltaUnit.DegreeReaumurDelta); - /// /// Get TemperatureDelta in DegreesRoemer. /// public double DegreesRoemer => As(TemperatureDeltaUnit.DegreeRoemer); - /// - /// Get TemperatureDelta in DegreesRoemerDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRoemer instead")] - public double DegreesRoemerDelta => As(TemperatureDeltaUnit.DegreeRoemerDelta); - /// /// Get TemperatureDelta in Kelvins. /// public double Kelvins => As(TemperatureDeltaUnit.Kelvin); - /// - /// Get TemperatureDelta in KelvinsDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use Kelvin instead")] - public double KelvinsDelta => As(TemperatureDeltaUnit.KelvinDelta); - #endregion #region Static @@ -271,21 +223,6 @@ public static TemperatureDelta FromDegreesCelsius(QuantityValue degreescelsius) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeCelsius); } - /// - /// Get TemperatureDelta from DegreesCelsiusDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeCelsius instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesCelsiusDelta(double degreescelsiusdelta) -#else - public static TemperatureDelta FromDegreesCelsiusDelta(QuantityValue degreescelsiusdelta) -#endif - { - double value = (double) degreescelsiusdelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeCelsiusDelta); - } - /// /// Get TemperatureDelta from DegreesDelisle. /// @@ -300,21 +237,6 @@ public static TemperatureDelta FromDegreesDelisle(QuantityValue degreesdelisle) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeDelisle); } - /// - /// Get TemperatureDelta from DegreesDelisleDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeDelisle instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesDelisleDelta(double degreesdelisledelta) -#else - public static TemperatureDelta FromDegreesDelisleDelta(QuantityValue degreesdelisledelta) -#endif - { - double value = (double) degreesdelisledelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeDelisleDelta); - } - /// /// Get TemperatureDelta from DegreesFahrenheit. /// @@ -329,21 +251,6 @@ public static TemperatureDelta FromDegreesFahrenheit(QuantityValue degreesfahren return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeFahrenheit); } - /// - /// Get TemperatureDelta from DegreesFahrenheitDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeFahrenheit instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesFahrenheitDelta(double degreesfahrenheitdelta) -#else - public static TemperatureDelta FromDegreesFahrenheitDelta(QuantityValue degreesfahrenheitdelta) -#endif - { - double value = (double) degreesfahrenheitdelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeFahrenheitDelta); - } - /// /// Get TemperatureDelta from DegreesNewton. /// @@ -358,21 +265,6 @@ public static TemperatureDelta FromDegreesNewton(QuantityValue degreesnewton) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeNewton); } - /// - /// Get TemperatureDelta from DegreesNewtonDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeNewton instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesNewtonDelta(double degreesnewtondelta) -#else - public static TemperatureDelta FromDegreesNewtonDelta(QuantityValue degreesnewtondelta) -#endif - { - double value = (double) degreesnewtondelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeNewtonDelta); - } - /// /// Get TemperatureDelta from DegreesRankine. /// @@ -387,21 +279,6 @@ public static TemperatureDelta FromDegreesRankine(QuantityValue degreesrankine) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRankine); } - /// - /// Get TemperatureDelta from DegreesRankineDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRankine instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesRankineDelta(double degreesrankinedelta) -#else - public static TemperatureDelta FromDegreesRankineDelta(QuantityValue degreesrankinedelta) -#endif - { - double value = (double) degreesrankinedelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRankineDelta); - } - /// /// Get TemperatureDelta from DegreesReaumur. /// @@ -416,21 +293,6 @@ public static TemperatureDelta FromDegreesReaumur(QuantityValue degreesreaumur) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeReaumur); } - /// - /// Get TemperatureDelta from DegreesReaumurDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeReaumur instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesReaumurDelta(double degreesreaumurdelta) -#else - public static TemperatureDelta FromDegreesReaumurDelta(QuantityValue degreesreaumurdelta) -#endif - { - double value = (double) degreesreaumurdelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeReaumurDelta); - } - /// /// Get TemperatureDelta from DegreesRoemer. /// @@ -445,21 +307,6 @@ public static TemperatureDelta FromDegreesRoemer(QuantityValue degreesroemer) return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRoemer); } - /// - /// Get TemperatureDelta from DegreesRoemerDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRoemer instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromDegreesRoemerDelta(double degreesroemerdelta) -#else - public static TemperatureDelta FromDegreesRoemerDelta(QuantityValue degreesroemerdelta) -#endif - { - double value = (double) degreesroemerdelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.DegreeRoemerDelta); - } - /// /// Get TemperatureDelta from Kelvins. /// @@ -474,21 +321,6 @@ public static TemperatureDelta FromKelvins(QuantityValue kelvins) return new TemperatureDelta(value, TemperatureDeltaUnit.Kelvin); } - /// - /// Get TemperatureDelta from KelvinsDelta. - /// - [System.Obsolete("Deprecated due to github issue #180, please use Kelvin instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static TemperatureDelta FromKelvinsDelta(double kelvinsdelta) -#else - public static TemperatureDelta FromKelvinsDelta(QuantityValue kelvinsdelta) -#endif - { - double value = (double) kelvinsdelta; - return new TemperatureDelta(value, TemperatureDeltaUnit.KelvinDelta); - } - /// /// Dynamically convert from value and unit enum to . @@ -662,21 +494,13 @@ private double AsBaseUnit() switch(Unit) { case TemperatureDeltaUnit.DegreeCelsius: return _value; - case TemperatureDeltaUnit.DegreeCelsiusDelta: return _value; case TemperatureDeltaUnit.DegreeDelisle: return _value*-2/3; - case TemperatureDeltaUnit.DegreeDelisleDelta: return _value*-2/3; case TemperatureDeltaUnit.DegreeFahrenheit: return _value*5/9; - case TemperatureDeltaUnit.DegreeFahrenheitDelta: return _value*5/9; case TemperatureDeltaUnit.DegreeNewton: return _value*100/33; - case TemperatureDeltaUnit.DegreeNewtonDelta: return _value*100/33; case TemperatureDeltaUnit.DegreeRankine: return _value*5/9; - case TemperatureDeltaUnit.DegreeRankineDelta: return _value*5/9; case TemperatureDeltaUnit.DegreeReaumur: return _value*5/4; - case TemperatureDeltaUnit.DegreeReaumurDelta: return _value*5/4; case TemperatureDeltaUnit.DegreeRoemer: return _value*40/21; - case TemperatureDeltaUnit.DegreeRoemerDelta: return _value*40/21; case TemperatureDeltaUnit.Kelvin: return _value; - case TemperatureDeltaUnit.KelvinDelta: return _value; default: throw new NotImplementedException($"Can not convert {Unit} to base units."); } @@ -692,21 +516,13 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) switch(unit) { case TemperatureDeltaUnit.DegreeCelsius: return baseUnitValue; - case TemperatureDeltaUnit.DegreeCelsiusDelta: return baseUnitValue; case TemperatureDeltaUnit.DegreeDelisle: return baseUnitValue*-3/2; - case TemperatureDeltaUnit.DegreeDelisleDelta: return baseUnitValue*-3/2; case TemperatureDeltaUnit.DegreeFahrenheit: return baseUnitValue*9/5; - case TemperatureDeltaUnit.DegreeFahrenheitDelta: return baseUnitValue*9/5; case TemperatureDeltaUnit.DegreeNewton: return baseUnitValue*33/100; - case TemperatureDeltaUnit.DegreeNewtonDelta: return baseUnitValue*33/100; case TemperatureDeltaUnit.DegreeRankine: return baseUnitValue*9/5; - case TemperatureDeltaUnit.DegreeRankineDelta: return baseUnitValue*9/5; case TemperatureDeltaUnit.DegreeReaumur: return baseUnitValue*4/5; - case TemperatureDeltaUnit.DegreeReaumurDelta: return baseUnitValue*4/5; case TemperatureDeltaUnit.DegreeRoemer: return baseUnitValue*21/40; - case TemperatureDeltaUnit.DegreeRoemerDelta: return baseUnitValue*21/40; case TemperatureDeltaUnit.Kelvin: return baseUnitValue; - case TemperatureDeltaUnit.KelvinDelta: return baseUnitValue; default: throw new NotImplementedException($"Can not convert {Unit} to {unit}."); } diff --git a/Common/GeneratedCode/Quantities/Volume.Common.g.cs b/Common/GeneratedCode/Quantities/Volume.Common.g.cs index 7af8d0bd50..0d028f51ab 100644 --- a/Common/GeneratedCode/Quantities/Volume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Volume.Common.g.cs @@ -321,18 +321,6 @@ public static BaseDimensions BaseDimensions /// public double OilBarrels => As(VolumeUnit.OilBarrel); - /// - /// Get Volume in Tablespoons. - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTablespoon instead")] - public double Tablespoons => As(VolumeUnit.Tablespoon); - - /// - /// Get Volume in Teaspoons. - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTeaspoon instead")] - public double Teaspoons => As(VolumeUnit.Teaspoon); - /// /// Get Volume in UkTablespoons. /// @@ -840,36 +828,6 @@ public static Volume FromOilBarrels(QuantityValue oilbarrels) return new Volume(value, VolumeUnit.OilBarrel); } - /// - /// Get Volume from Tablespoons. - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTablespoon instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Volume FromTablespoons(double tablespoons) -#else - public static Volume FromTablespoons(QuantityValue tablespoons) -#endif - { - double value = (double) tablespoons; - return new Volume(value, VolumeUnit.Tablespoon); - } - - /// - /// Get Volume from Teaspoons. - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTeaspoon instead")] -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static Volume FromTeaspoons(double teaspoons) -#else - public static Volume FromTeaspoons(QuantityValue teaspoons) -#endif - { - double value = (double) teaspoons; - return new Volume(value, VolumeUnit.Teaspoon); - } - /// /// Get Volume from UkTablespoons. /// @@ -1214,8 +1172,6 @@ private double AsBaseUnit() case VolumeUnit.Microliter: return (_value/1e3) * 1e-6d; case VolumeUnit.Milliliter: return (_value/1e3) * 1e-3d; case VolumeUnit.OilBarrel: return _value*0.158987294928; - case VolumeUnit.Tablespoon: return _value*1.478676478125e-5; - case VolumeUnit.Teaspoon: return _value*4.92892159375e-6; case VolumeUnit.UkTablespoon: return _value*1.5e-5; case VolumeUnit.UsBeerBarrel: return _value*0.1173477658; case VolumeUnit.UsCustomaryCup: return _value*0.0002365882365; @@ -1272,8 +1228,6 @@ private double AsBaseNumericType(VolumeUnit unit) case VolumeUnit.Microliter: return (baseUnitValue*1e3) / 1e-6d; case VolumeUnit.Milliliter: return (baseUnitValue*1e3) / 1e-3d; case VolumeUnit.OilBarrel: return baseUnitValue/0.158987294928; - case VolumeUnit.Tablespoon: return baseUnitValue/1.478676478125e-5; - case VolumeUnit.Teaspoon: return baseUnitValue/4.92892159375e-6; case VolumeUnit.UkTablespoon: return baseUnitValue/1.5e-5; case VolumeUnit.UsBeerBarrel: return baseUnitValue/0.1173477658; case VolumeUnit.UsCustomaryCup: return baseUnitValue/0.0002365882365; diff --git a/Common/UnitDefinitions/Duration.json b/Common/UnitDefinitions/Duration.json index ad19f0f063..7343405e0e 100644 --- a/Common/UnitDefinitions/Duration.json +++ b/Common/UnitDefinitions/Duration.json @@ -6,23 +6,6 @@ "T": 1 }, "Units": [ - { - "ObsoleteText": "Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.", - "SingularName": "Year", - "PluralName": "Years", - "FromUnitToBaseFunc": "x*365*24*3600", - "FromBaseToUnitFunc": "x/(365*24*3600)", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "yr", "year", "years" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "год" ] - } - ] - }, { "SingularName": "Year365", "PluralName": "Years365", @@ -39,23 +22,6 @@ } ] }, - { - "ObsoleteText": "Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.", - "SingularName": "Month", - "PluralName": "Months", - "FromUnitToBaseFunc": "x*30*24*3600", - "FromBaseToUnitFunc": "x/(30*24*3600)", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "mo", "month", "months" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "месяц" ] - } - ] - }, { "SingularName": "Month30", "PluralName": "Months30", diff --git a/Common/UnitDefinitions/Flow.json b/Common/UnitDefinitions/Flow.json deleted file mode 100644 index 2b4918d122..0000000000 --- a/Common/UnitDefinitions/Flow.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "Name": "Flow", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "BaseUnit": "CubicMeterPerSecond", - "XmlDoc": "In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q.", - "BaseDimensions": { - "L": 3, - "T": -1 - }, - "Units": [ - { - "SingularName": "CubicMeterPerSecond", - "PluralName": "CubicMetersPerSecond", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x", - "FromBaseToUnitFunc": "x", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "m³/s" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "м³/с" ] - } - ] - }, - { - "SingularName": "CubicMeterPerMinute", - "PluralName": "CubicMetersPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/60", - "FromBaseToUnitFunc": "x*60", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "m³/min" ] - } - ] - }, - { - "SingularName": "CubicMeterPerHour", - "PluralName": "CubicMetersPerHour", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/3600", - "FromBaseToUnitFunc": "x*3600", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "m³/h" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "м³/ч" ] - } - ] - }, - { - "SingularName": "CubicFootPerSecond", - "PluralName": "CubicFeetPerSecond", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/35.314666721", - "FromBaseToUnitFunc": "x*35.314666721", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "ft³/s" ] - } - ] - }, - { - "SingularName": "CubicFootPerMinute", - "PluralName": "CubicFeetPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/2118.88000326", - "FromBaseToUnitFunc": "x*2118.88000326", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "ft³/min" ] - } - ] - }, - { - "SingularName": "CubicFootPerHour", - "PluralName": "CubicFeetPerHour", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x*7.8657907199999087346816086183876e-6", - "FromBaseToUnitFunc": "x/7.8657907199999087346816086183876e-6", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "ft³/h", "cf/hr" ] - } - ] - }, - { - "SingularName": "CubicYardPerSecond", - "PluralName": "CubicYardsPerSecond", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x*0.764554857984", - "FromBaseToUnitFunc": "x/0.764554857984", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "yd³/s" ] - } - ] - }, - { - "SingularName": "CubicYardPerMinute", - "PluralName": "CubicYardsPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x*0.0127425809664", - "FromBaseToUnitFunc": "x/0.0127425809664", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "yd³/min" ] - } - ] - }, - { - "SingularName": "CubicYardPerHour", - "PluralName": "CubicYardsPerHour", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x*2.1237634944E-4", - "FromBaseToUnitFunc": "x/2.1237634944E-4", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "yd³/h" ] - } - ] - }, - { - "SingularName": "MillionUsGallonsPerDay", - "PluralName": "MillionUsGallonsPerDay", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/22.824465227", - "FromBaseToUnitFunc": "x*22.824465227", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "MGD" ] - } - ] - }, - { - "SingularName": "LitersPerSecond", - "PluralName": "LitersPerSecond", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/1000", - "FromBaseToUnitFunc": "x*1000", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "LPS" ] - } - ] - }, - { - "SingularName": "LitersPerMinute", - "PluralName": "LitersPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/60000.00000", - "FromBaseToUnitFunc": "x*60000.00000", - "Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ], - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "LPM" ] - } - ] - }, - { - "SingularName": "LitersPerHour", - "PluralName": "LitersPerHour", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/3600000.000", - "FromBaseToUnitFunc": "x*3600000.000", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "LPH" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "л/ч" ] - } - ] - }, - { - "SingularName": "UsGallonsPerSecond", - "PluralName": "UsGallonsPerSecond", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/264.1720523581484", - "FromBaseToUnitFunc": "x*264.1720523581484", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "gal (U.S.)/s" ] - } - ] - }, - { - "SingularName": "UsGallonsPerMinute", - "PluralName": "UsGallonsPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/15850.323141489", - "FromBaseToUnitFunc": "x*15850.323141489", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "gal (U.S.)/min", "GPM" ] - } - ] - }, - { - "SingularName": "UsGallonsPerHour", - "PluralName": "UsGallonsPerHour", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/951019.38848933424", - "FromBaseToUnitFunc": "x*951019.38848933424", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "gal (U.S.)/h" ] - } - ] - }, - { - "SingularName": "CubicDecimeterPerMinute", - "PluralName": "CubicDecimetersPerMinute", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x/60000.00000", - "FromBaseToUnitFunc": "x*60000.00000", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "dm³/min" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "дм³/мин" ] - } - ] - }, - { - "SingularName": "OilBarrelsPerDay", - "PluralName": "OilBarrelsPerDay", - "ObsoleteText": "Deprecated due to github issue #363, please use VolumeFlow instead", - "FromUnitToBaseFunc": "x*1.8401307283333333333333333333333e-6", - "FromBaseToUnitFunc": "x/1.8401307283333333333333333333333e-6", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "bbl/d", "BOPD" ] - } - ] - } - ] -} diff --git a/Common/UnitDefinitions/Pressure.json b/Common/UnitDefinitions/Pressure.json index 7651a70e07..753a76b58a 100644 --- a/Common/UnitDefinitions/Pressure.json +++ b/Common/UnitDefinitions/Pressure.json @@ -161,23 +161,6 @@ } ] }, - { - "SingularName": "Psi", - "PluralName": "Psi", - "ObsoleteText": "Deprecated due to github issue #215, please use PoundForcePerSquareInch instead", - "FromUnitToBaseFunc": "x*6.894757293168361e3", - "FromBaseToUnitFunc": "x/6.894757293168361e3", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "psi" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "psi" ] - } - ] - }, { "SingularName": "TechnicalAtmosphere", "PluralName": "TechnicalAtmospheres", diff --git a/Common/UnitDefinitions/TemperatureDelta.json b/Common/UnitDefinitions/TemperatureDelta.json index 771f916667..34b37da1ea 100644 --- a/Common/UnitDefinitions/TemperatureDelta.json +++ b/Common/UnitDefinitions/TemperatureDelta.json @@ -98,110 +98,6 @@ "Abbreviations": [ "∆°Rø" ] } ] - }, - { - "SingularName": "KelvinDelta", - "PluralName": "KelvinsDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use Kelvin instead", - "FromUnitToBaseFunc": "x", - "FromBaseToUnitFunc": "x", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆K" ] - } - ] - }, - { - "SingularName": "DegreeCelsiusDelta", - "PluralName": "DegreesCelsiusDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeCelsius instead", - "FromUnitToBaseFunc": "x", - "FromBaseToUnitFunc": "x", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°C" ] - } - ] - }, - { - "SingularName": "DegreeDelisleDelta", - "PluralName": "DegreesDelisleDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeDelisle instead", - "FromUnitToBaseFunc": "x*-2/3", - "FromBaseToUnitFunc": "x*-3/2", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°De" ] - } - ] - }, - { - "SingularName": "DegreeFahrenheitDelta", - "PluralName": "DegreesFahrenheitDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeFahrenheit instead", - "FromUnitToBaseFunc": "x*5/9", - "FromBaseToUnitFunc": "x*9/5", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°F" ] - } - ] - }, - { - "SingularName": "DegreeNewtonDelta", - "PluralName": "DegreesNewtonDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeNewton instead", - "FromUnitToBaseFunc": "x*100/33", - "FromBaseToUnitFunc": "x*33/100", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°N" ] - } - ] - }, - { - "SingularName": "DegreeRankineDelta", - "PluralName": "DegreesRankineDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeRankine instead", - "FromUnitToBaseFunc": "x*5/9", - "FromBaseToUnitFunc": "x*9/5", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°R" ] - } - ] - }, - { - "SingularName": "DegreeReaumurDelta", - "PluralName": "DegreesReaumurDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeReaumur instead", - "FromUnitToBaseFunc": "x*5/4", - "FromBaseToUnitFunc": "x*4/5", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°Ré" ] - } - ] - }, - { - "SingularName": "DegreeRoemerDelta", - "PluralName": "DegreesRoemerDelta", - "ObsoleteText": "Deprecated due to github issue #180, please use DegreeRoemer instead", - "FromUnitToBaseFunc": "x*40/21", - "FromBaseToUnitFunc": "x*21/40", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "∆°Rø" ] - } - ] } ] } \ No newline at end of file diff --git a/Common/UnitDefinitions/Volume.json b/Common/UnitDefinitions/Volume.json index 013540c76b..1b2c417995 100644 --- a/Common/UnitDefinitions/Volume.json +++ b/Common/UnitDefinitions/Volume.json @@ -252,48 +252,6 @@ } ] }, - { - "SingularName": "Tablespoon", - "PluralName": "Tablespoons", - "ObsoleteText": "Deprecated due to github issue #134, please use UsTablespoon instead", - "FromUnitToBaseFunc": "x*1.478676478125e-5", - "FromBaseToUnitFunc": "x/1.478676478125e-5", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "Tbsp", "Tbs", "T", "tb", "tbs", "tbsp", "tblsp", "tblspn", "Tbsp.", "Tbs.", "T.", "tb.", "tbs.", "tbsp.", "tblsp.", "tblspn.", "tablespoon", "Tablespoon" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "столовая ложка" ] - }, - { - "Culture": "nb-NO", - "Abbreviations": [ "ss", "ss.", "SS", "SS." ] - } - ] - }, - { - "SingularName": "Teaspoon", - "PluralName": "Teaspoons", - "ObsoleteText": "Deprecated due to github issue #134, please use UsTeaspoon instead", - "FromUnitToBaseFunc": "x*4.92892159375e-6", - "FromBaseToUnitFunc": "x/4.92892159375e-6", - "Localization": [ - { - "Culture": "en-US", - "Abbreviations": [ "tsp", "t", "ts", "tspn", "t.", "ts.", "tsp.", "tspn.", "teaspoon" ] - }, - { - "Culture": "ru-RU", - "Abbreviations": [ "чайная ложка" ] - }, - { - "Culture": "nb-NO", - "Abbreviations": [ "ts", "ts." ] - } - ] - }, { "SingularName": "UsTablespoon", "PluralName": "UsTablespoons", diff --git a/UnitsNet.Tests/CustomCode/DurationTests.cs b/UnitsNet.Tests/CustomCode/DurationTests.cs index 4ad5c3338e..f99439a482 100644 --- a/UnitsNet.Tests/CustomCode/DurationTests.cs +++ b/UnitsNet.Tests/CustomCode/DurationTests.cs @@ -36,8 +36,6 @@ public class DurationTests : DurationTestsBase protected override double MinutesInOneSecond => 0.0166667; - protected override double MonthsInOneSecond => 3.858024691358024e-7; - protected override double Months30InOneSecond => 3.858024691358024e-7; protected override double NanosecondsInOneSecond => 1e+9; @@ -46,8 +44,6 @@ public class DurationTests : DurationTestsBase protected override double WeeksInOneSecond => 1.653439153439153e-6; - protected override double YearsInOneSecond => 3.170979198376458e-8; - protected override double Years365InOneSecond => 3.170979198376458e-8; [Fact] diff --git a/UnitsNet.Tests/CustomCode/FlowTests.cs b/UnitsNet.Tests/CustomCode/FlowTests.cs deleted file mode 100644 index 9742af1064..0000000000 --- a/UnitsNet.Tests/CustomCode/FlowTests.cs +++ /dev/null @@ -1,72 +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. - -namespace UnitsNet.Tests.CustomCode -{ - public class FlowTests : FlowTestsBase - { - protected override double CubicMetersPerHourInOneCubicMeterPerSecond => 3600.0; - - protected override double CubicDecimetersPerMinuteInOneCubicMeterPerSecond => 60000.00000; - - protected override double CubicFeetPerHourInOneCubicMeterPerSecond => 1.271328001973604e+5; - - protected override double CubicFeetPerSecondInOneCubicMeterPerSecond => 35.314666721489; - - protected override double MillionUsGallonsPerDayInOneCubicMeterPerSecond => 22.824465227; - - protected override double CubicMetersPerSecondInOneCubicMeterPerSecond => 1; - - protected override double UsGallonsPerMinuteInOneCubicMeterPerSecond => 15850.323141489; - protected override double LitersPerHourInOneCubicMeterPerSecond => 3600000; - - protected override double LitersPerMinuteInOneCubicMeterPerSecond => 60000.00000; - - protected override double NanolitersPerMinuteInOneCubicMeterPerSecond => 60000000000000.00000; - protected override double LitersPerSecondInOneCubicMeterPerSecond => 1000; - - protected override double MicrolitersPerMinuteInOneCubicMeterPerSecond => 60000000000.00000; - - protected override double MillilitersPerMinuteInOneCubicMeterPerSecond => 60000000.00000; - - protected override double CentilitersPerMinuteInOneCubicMeterPerSecond => 6000000.00000; - - protected override double DecilitersPerMinuteInOneCubicMeterPerSecond => 600000.00000; - - protected override double KilolitersPerMinuteInOneCubicMeterPerSecond => 60.00000; - - protected override double OilBarrelsPerDayInOneCubicMeterPerSecond => 543439.65056533388306722269588172; - - protected override double CubicFeetPerMinuteInOneCubicMeterPerSecond => 2.11888E3; - - protected override double CubicMetersPerMinuteInOneCubicMeterPerSecond => 6.0E1; - - protected override double CubicYardsPerHourInOneCubicMeterPerSecond => 4.708622232E3; - - protected override double CubicYardsPerMinuteInOneCubicMeterPerSecond => 7.84770372E1; - - protected override double CubicYardsPerSecondInOneCubicMeterPerSecond => 1.30795062; - - protected override double UsGallonsPerHourInOneCubicMeterPerSecond => 9.510193884893328E5; - - protected override double UsGallonsPerSecondInOneCubicMeterPerSecond => 2.64172052358148E2; - } -} \ No newline at end of file diff --git a/UnitsNet.Tests/CustomCode/LapseRateTests.cs b/UnitsNet.Tests/CustomCode/LapseRateTests.cs index 4ae15baa1e..e78920162e 100644 --- a/UnitsNet.Tests/CustomCode/LapseRateTests.cs +++ b/UnitsNet.Tests/CustomCode/LapseRateTests.cs @@ -52,14 +52,14 @@ public class LapseRateTests : LapseRateTestsBase [Fact] public void TemperatureDeltaDividedByLapseRateEqualsLength() { - Length length = TemperatureDelta.FromDegreesCelsiusDelta(50) / LapseRate.FromDegreesCelciusPerKilometer(5); + Length length = TemperatureDelta.FromDegreesCelsius(50) / LapseRate.FromDegreesCelciusPerKilometer(5); Assert.Equal(length, Length.FromKilometers(10)); } [Fact] public void TemperatureDeltaDividedByLengthEqualsLapseRate() { - LapseRate lapseRate = TemperatureDelta.FromDegreesCelsiusDelta(50) / Length.FromKilometers(10); + LapseRate lapseRate = TemperatureDelta.FromDegreesCelsius(50) / Length.FromKilometers(10); Assert.Equal(lapseRate, LapseRate.FromDegreesCelciusPerKilometer(5)); } @@ -67,14 +67,14 @@ public void TemperatureDeltaDividedByLengthEqualsLapseRate() public void LengthMultipliedByLapseRateEqualsTemperatureDelta() { TemperatureDelta temperatureDelta = Length.FromKilometers(10) * LapseRate.FromDegreesCelciusPerKilometer(5); - Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsiusDelta(50)); + Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsius(50)); } [Fact] public void LapseRateMultipliedByLengthEqualsTemperatureDelta() { TemperatureDelta temperatureDelta = LapseRate.FromDegreesCelciusPerKilometer(5) * Length.FromKilometers(10); - Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsiusDelta(50)); + Assert.Equal(temperatureDelta, TemperatureDelta.FromDegreesCelsius(50)); } } } diff --git a/UnitsNet.Tests/CustomCode/PressureTests.cs b/UnitsNet.Tests/CustomCode/PressureTests.cs index bf6b3d4bd2..da37b8d7dc 100644 --- a/UnitsNet.Tests/CustomCode/PressureTests.cs +++ b/UnitsNet.Tests/CustomCode/PressureTests.cs @@ -66,8 +66,6 @@ public class PressureTests : PressureTestsBase protected override double PoundsForcePerSquareInchInOnePascal => 1.450377377302092e-4; - protected override double PsiInOnePascal => 1.450377377302092e-4; - protected override double TechnicalAtmospheresInOnePascal => 1.0197*1E-5; protected override double TonnesForcePerSquareCentimeterInOnePascal => 1.019716212977928e-8; diff --git a/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs b/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs index d1254bc451..ae78d91649 100644 --- a/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs +++ b/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs @@ -45,15 +45,6 @@ namespace UnitsNet.Tests.CustomCode { public class TemperatureDeltaTests : TemperatureDeltaTestsBase { - protected override double DegreesCelsiusDeltaInOneKelvin => 1; - protected override double DegreesDelisleDeltaInOneKelvin => -1.5d; - protected override double DegreesFahrenheitDeltaInOneKelvin => 1.8; - protected override double DegreesNewtonDeltaInOneKelvin => 0.33d; - protected override double DegreesRankineDeltaInOneKelvin => 1.8; - protected override double DegreesReaumurDeltaInOneKelvin => 0.8; - protected override double DegreesRoemerDeltaInOneKelvin => 21/40d; - protected override double KelvinsDeltaInOneKelvin => 1; - protected override double DegreesCelsiusInOneKelvin => 1; protected override double DegreesDelisleInOneKelvin => -1.5d; protected override double DegreesFahrenheitInOneKelvin => 1.8; diff --git a/UnitsNet.Tests/CustomCode/VolumeTests.cs b/UnitsNet.Tests/CustomCode/VolumeTests.cs index 649c0e2ca1..3ab757796a 100644 --- a/UnitsNet.Tests/CustomCode/VolumeTests.cs +++ b/UnitsNet.Tests/CustomCode/VolumeTests.cs @@ -75,25 +75,17 @@ public class VolumeTests : VolumeTestsBase protected override double AuTablespoonsInOneCubicMeter => 50000; protected override double UsTablespoonsInOneCubicMeter => 67628.0454; - - protected override double TablespoonsInOneCubicMeter => 67628.0454; - - protected override double TablespoonsTolerance => 1E-4; protected override double MetricTeaspoonsInOneCubicMeter => 200000; protected override double UsTeaspoonsInOneCubicMeter => 202884.13621105801; - protected override double TeaspoonsInOneCubicMeter => 202884.13621105801; - protected override double ImperialBeerBarrelsInOneCubicMeter => 6.1102568972; protected override double UkTablespoonsInOneCubicMeter => 66666.6666667; protected override double UsBeerBarrelsInOneCubicMeter => 8.5216790723083; - protected override double TeaspoonsTolerance => 1E-3; - protected override double UsGallonsInOneCubicMeter => 264.17217; protected override double UsOuncesInOneCubicMeter => 33814.02270; diff --git a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs index 0c107c622b..8708558bee 100644 --- a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs @@ -58,12 +58,10 @@ public abstract partial class DurationTestsBase protected abstract double MicrosecondsInOneSecond { get; } protected abstract double MillisecondsInOneSecond { get; } protected abstract double MinutesInOneSecond { get; } - protected abstract double MonthsInOneSecond { get; } protected abstract double Months30InOneSecond { get; } protected abstract double NanosecondsInOneSecond { get; } protected abstract double SecondsInOneSecond { get; } protected abstract double WeeksInOneSecond { get; } - protected abstract double YearsInOneSecond { get; } protected abstract double Years365InOneSecond { get; } // ReSharper disable VirtualMemberNeverOverriden.Global @@ -72,12 +70,10 @@ public abstract partial class DurationTestsBase protected virtual double MicrosecondsTolerance { get { return 1e-5; } } protected virtual double MillisecondsTolerance { get { return 1e-5; } } protected virtual double MinutesTolerance { get { return 1e-5; } } - protected virtual double MonthsTolerance { get { return 1e-5; } } protected virtual double Months30Tolerance { get { return 1e-5; } } protected virtual double NanosecondsTolerance { get { return 1e-5; } } protected virtual double SecondsTolerance { get { return 1e-5; } } protected virtual double WeeksTolerance { get { return 1e-5; } } - protected virtual double YearsTolerance { get { return 1e-5; } } protected virtual double Years365Tolerance { get { return 1e-5; } } // ReSharper restore VirtualMemberNeverOverriden.Global @@ -90,12 +86,10 @@ public void SecondToDurationUnits() AssertEx.EqualTolerance(MicrosecondsInOneSecond, second.Microseconds, MicrosecondsTolerance); AssertEx.EqualTolerance(MillisecondsInOneSecond, second.Milliseconds, MillisecondsTolerance); AssertEx.EqualTolerance(MinutesInOneSecond, second.Minutes, MinutesTolerance); - AssertEx.EqualTolerance(MonthsInOneSecond, second.Months, MonthsTolerance); AssertEx.EqualTolerance(Months30InOneSecond, second.Months30, Months30Tolerance); AssertEx.EqualTolerance(NanosecondsInOneSecond, second.Nanoseconds, NanosecondsTolerance); AssertEx.EqualTolerance(SecondsInOneSecond, second.Seconds, SecondsTolerance); AssertEx.EqualTolerance(WeeksInOneSecond, second.Weeks, WeeksTolerance); - AssertEx.EqualTolerance(YearsInOneSecond, second.Years, YearsTolerance); AssertEx.EqualTolerance(Years365InOneSecond, second.Years365, Years365Tolerance); } @@ -107,12 +101,10 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Microsecond).Microseconds, MicrosecondsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Millisecond).Milliseconds, MillisecondsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Minute).Minutes, MinutesTolerance); - AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Month).Months, MonthsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Month30).Months30, Months30Tolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Nanosecond).Nanoseconds, NanosecondsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Second).Seconds, SecondsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Week).Weeks, WeeksTolerance); - AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Year).Years, YearsTolerance); AssertEx.EqualTolerance(1, Duration.From(1, DurationUnit.Year365).Years365, Years365Tolerance); } @@ -125,12 +117,10 @@ public void As() AssertEx.EqualTolerance(MicrosecondsInOneSecond, second.As(DurationUnit.Microsecond), MicrosecondsTolerance); AssertEx.EqualTolerance(MillisecondsInOneSecond, second.As(DurationUnit.Millisecond), MillisecondsTolerance); AssertEx.EqualTolerance(MinutesInOneSecond, second.As(DurationUnit.Minute), MinutesTolerance); - AssertEx.EqualTolerance(MonthsInOneSecond, second.As(DurationUnit.Month), MonthsTolerance); AssertEx.EqualTolerance(Months30InOneSecond, second.As(DurationUnit.Month30), Months30Tolerance); AssertEx.EqualTolerance(NanosecondsInOneSecond, second.As(DurationUnit.Nanosecond), NanosecondsTolerance); AssertEx.EqualTolerance(SecondsInOneSecond, second.As(DurationUnit.Second), SecondsTolerance); AssertEx.EqualTolerance(WeeksInOneSecond, second.As(DurationUnit.Week), WeeksTolerance); - AssertEx.EqualTolerance(YearsInOneSecond, second.As(DurationUnit.Year), YearsTolerance); AssertEx.EqualTolerance(Years365InOneSecond, second.As(DurationUnit.Year365), Years365Tolerance); } @@ -159,10 +149,6 @@ public void ToUnit() AssertEx.EqualTolerance(MinutesInOneSecond, (double)minuteQuantity.Value, MinutesTolerance); Assert.Equal(DurationUnit.Minute, minuteQuantity.Unit); - var monthQuantity = second.ToUnit(DurationUnit.Month); - AssertEx.EqualTolerance(MonthsInOneSecond, (double)monthQuantity.Value, MonthsTolerance); - Assert.Equal(DurationUnit.Month, monthQuantity.Unit); - var month30Quantity = second.ToUnit(DurationUnit.Month30); AssertEx.EqualTolerance(Months30InOneSecond, (double)month30Quantity.Value, Months30Tolerance); Assert.Equal(DurationUnit.Month30, month30Quantity.Unit); @@ -179,10 +165,6 @@ public void ToUnit() AssertEx.EqualTolerance(WeeksInOneSecond, (double)weekQuantity.Value, WeeksTolerance); Assert.Equal(DurationUnit.Week, weekQuantity.Unit); - var yearQuantity = second.ToUnit(DurationUnit.Year); - AssertEx.EqualTolerance(YearsInOneSecond, (double)yearQuantity.Value, YearsTolerance); - Assert.Equal(DurationUnit.Year, yearQuantity.Unit); - var year365Quantity = second.ToUnit(DurationUnit.Year365); AssertEx.EqualTolerance(Years365InOneSecond, (double)year365Quantity.Value, Years365Tolerance); Assert.Equal(DurationUnit.Year365, year365Quantity.Unit); @@ -197,12 +179,10 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, Duration.FromMicroseconds(second.Microseconds).Seconds, MicrosecondsTolerance); AssertEx.EqualTolerance(1, Duration.FromMilliseconds(second.Milliseconds).Seconds, MillisecondsTolerance); AssertEx.EqualTolerance(1, Duration.FromMinutes(second.Minutes).Seconds, MinutesTolerance); - AssertEx.EqualTolerance(1, Duration.FromMonths(second.Months).Seconds, MonthsTolerance); AssertEx.EqualTolerance(1, Duration.FromMonths30(second.Months30).Seconds, Months30Tolerance); AssertEx.EqualTolerance(1, Duration.FromNanoseconds(second.Nanoseconds).Seconds, NanosecondsTolerance); AssertEx.EqualTolerance(1, Duration.FromSeconds(second.Seconds).Seconds, SecondsTolerance); AssertEx.EqualTolerance(1, Duration.FromWeeks(second.Weeks).Seconds, WeeksTolerance); - AssertEx.EqualTolerance(1, Duration.FromYears(second.Years).Seconds, YearsTolerance); AssertEx.EqualTolerance(1, Duration.FromYears365(second.Years365).Seconds, Years365Tolerance); } diff --git a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs deleted file mode 100644 index 3b2b44ce5e..0000000000 --- a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs +++ /dev/null @@ -1,427 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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 Flow. - /// -// ReSharper disable once PartialTypeWithSinglePart - public abstract partial class FlowTestsBase - { - protected abstract double CentilitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double CubicDecimetersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double CubicFeetPerHourInOneCubicMeterPerSecond { get; } - protected abstract double CubicFeetPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double CubicFeetPerSecondInOneCubicMeterPerSecond { get; } - protected abstract double CubicMetersPerHourInOneCubicMeterPerSecond { get; } - protected abstract double CubicMetersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double CubicMetersPerSecondInOneCubicMeterPerSecond { get; } - protected abstract double CubicYardsPerHourInOneCubicMeterPerSecond { get; } - protected abstract double CubicYardsPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double CubicYardsPerSecondInOneCubicMeterPerSecond { get; } - protected abstract double DecilitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double KilolitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double LitersPerHourInOneCubicMeterPerSecond { get; } - protected abstract double LitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double LitersPerSecondInOneCubicMeterPerSecond { get; } - protected abstract double MicrolitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double MillilitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double MillionUsGallonsPerDayInOneCubicMeterPerSecond { get; } - protected abstract double NanolitersPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double OilBarrelsPerDayInOneCubicMeterPerSecond { get; } - protected abstract double UsGallonsPerHourInOneCubicMeterPerSecond { get; } - protected abstract double UsGallonsPerMinuteInOneCubicMeterPerSecond { get; } - protected abstract double UsGallonsPerSecondInOneCubicMeterPerSecond { get; } - -// ReSharper disable VirtualMemberNeverOverriden.Global - protected virtual double CentilitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double CubicDecimetersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double CubicFeetPerHourTolerance { get { return 1e-5; } } - protected virtual double CubicFeetPerMinuteTolerance { get { return 1e-5; } } - protected virtual double CubicFeetPerSecondTolerance { get { return 1e-5; } } - protected virtual double CubicMetersPerHourTolerance { get { return 1e-5; } } - protected virtual double CubicMetersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double CubicMetersPerSecondTolerance { get { return 1e-5; } } - protected virtual double CubicYardsPerHourTolerance { get { return 1e-5; } } - protected virtual double CubicYardsPerMinuteTolerance { get { return 1e-5; } } - protected virtual double CubicYardsPerSecondTolerance { get { return 1e-5; } } - protected virtual double DecilitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double KilolitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double LitersPerHourTolerance { get { return 1e-5; } } - protected virtual double LitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double LitersPerSecondTolerance { get { return 1e-5; } } - protected virtual double MicrolitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double MillilitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double MillionUsGallonsPerDayTolerance { get { return 1e-5; } } - protected virtual double NanolitersPerMinuteTolerance { get { return 1e-5; } } - protected virtual double OilBarrelsPerDayTolerance { get { return 1e-5; } } - protected virtual double UsGallonsPerHourTolerance { get { return 1e-5; } } - protected virtual double UsGallonsPerMinuteTolerance { get { return 1e-5; } } - protected virtual double UsGallonsPerSecondTolerance { get { return 1e-5; } } -// ReSharper restore VirtualMemberNeverOverriden.Global - - [Fact] - public void CubicMeterPerSecondToFlowUnits() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - AssertEx.EqualTolerance(CentilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.CentilitersPerMinute, CentilitersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicDecimetersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.CubicDecimetersPerMinute, CubicDecimetersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicFeetPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.CubicFeetPerHour, CubicFeetPerHourTolerance); - AssertEx.EqualTolerance(CubicFeetPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.CubicFeetPerMinute, CubicFeetPerMinuteTolerance); - AssertEx.EqualTolerance(CubicFeetPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.CubicFeetPerSecond, CubicFeetPerSecondTolerance); - AssertEx.EqualTolerance(CubicMetersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.CubicMetersPerHour, CubicMetersPerHourTolerance); - AssertEx.EqualTolerance(CubicMetersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.CubicMetersPerMinute, CubicMetersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicMetersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(CubicYardsPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.CubicYardsPerHour, CubicYardsPerHourTolerance); - AssertEx.EqualTolerance(CubicYardsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.CubicYardsPerMinute, CubicYardsPerMinuteTolerance); - AssertEx.EqualTolerance(CubicYardsPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.CubicYardsPerSecond, CubicYardsPerSecondTolerance); - AssertEx.EqualTolerance(DecilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.DecilitersPerMinute, DecilitersPerMinuteTolerance); - AssertEx.EqualTolerance(KilolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.KilolitersPerMinute, KilolitersPerMinuteTolerance); - AssertEx.EqualTolerance(LitersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.LitersPerHour, LitersPerHourTolerance); - AssertEx.EqualTolerance(LitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.LitersPerMinute, LitersPerMinuteTolerance); - AssertEx.EqualTolerance(LitersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.LitersPerSecond, LitersPerSecondTolerance); - AssertEx.EqualTolerance(MicrolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.MicrolitersPerMinute, MicrolitersPerMinuteTolerance); - AssertEx.EqualTolerance(MillilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.MillilitersPerMinute, MillilitersPerMinuteTolerance); - AssertEx.EqualTolerance(MillionUsGallonsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.MillionUsGallonsPerDay, MillionUsGallonsPerDayTolerance); - AssertEx.EqualTolerance(NanolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.NanolitersPerMinute, NanolitersPerMinuteTolerance); - AssertEx.EqualTolerance(OilBarrelsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.OilBarrelsPerDay, OilBarrelsPerDayTolerance); - AssertEx.EqualTolerance(UsGallonsPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.UsGallonsPerHour, UsGallonsPerHourTolerance); - AssertEx.EqualTolerance(UsGallonsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.UsGallonsPerMinute, UsGallonsPerMinuteTolerance); - AssertEx.EqualTolerance(UsGallonsPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.UsGallonsPerSecond, UsGallonsPerSecondTolerance); - } - - [Fact] - public void FromValueAndUnit() - { - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CentilitersPerMinute).CentilitersPerMinute, CentilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicDecimeterPerMinute).CubicDecimetersPerMinute, CubicDecimetersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicFootPerHour).CubicFeetPerHour, CubicFeetPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicFootPerMinute).CubicFeetPerMinute, CubicFeetPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicFootPerSecond).CubicFeetPerSecond, CubicFeetPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicMeterPerHour).CubicMetersPerHour, CubicMetersPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicMeterPerMinute).CubicMetersPerMinute, CubicMetersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicMeterPerSecond).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicYardPerHour).CubicYardsPerHour, CubicYardsPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicYardPerMinute).CubicYardsPerMinute, CubicYardsPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.CubicYardPerSecond).CubicYardsPerSecond, CubicYardsPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.DecilitersPerMinute).DecilitersPerMinute, DecilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.KilolitersPerMinute).KilolitersPerMinute, KilolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.LitersPerHour).LitersPerHour, LitersPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.LitersPerMinute).LitersPerMinute, LitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.LitersPerSecond).LitersPerSecond, LitersPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.MicrolitersPerMinute).MicrolitersPerMinute, MicrolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.MillilitersPerMinute).MillilitersPerMinute, MillilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.MillionUsGallonsPerDay).MillionUsGallonsPerDay, MillionUsGallonsPerDayTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.NanolitersPerMinute).NanolitersPerMinute, NanolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.OilBarrelsPerDay).OilBarrelsPerDay, OilBarrelsPerDayTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.UsGallonsPerHour).UsGallonsPerHour, UsGallonsPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.UsGallonsPerMinute).UsGallonsPerMinute, UsGallonsPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.From(1, FlowUnit.UsGallonsPerSecond).UsGallonsPerSecond, UsGallonsPerSecondTolerance); - } - - [Fact] - public void As() - { - var cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - AssertEx.EqualTolerance(CentilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CentilitersPerMinute), CentilitersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicDecimetersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicDecimeterPerMinute), CubicDecimetersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicFeetPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicFootPerHour), CubicFeetPerHourTolerance); - AssertEx.EqualTolerance(CubicFeetPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicFootPerMinute), CubicFeetPerMinuteTolerance); - AssertEx.EqualTolerance(CubicFeetPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicFootPerSecond), CubicFeetPerSecondTolerance); - AssertEx.EqualTolerance(CubicMetersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicMeterPerHour), CubicMetersPerHourTolerance); - AssertEx.EqualTolerance(CubicMetersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicMeterPerMinute), CubicMetersPerMinuteTolerance); - AssertEx.EqualTolerance(CubicMetersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicMeterPerSecond), CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(CubicYardsPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicYardPerHour), CubicYardsPerHourTolerance); - AssertEx.EqualTolerance(CubicYardsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicYardPerMinute), CubicYardsPerMinuteTolerance); - AssertEx.EqualTolerance(CubicYardsPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicYardPerSecond), CubicYardsPerSecondTolerance); - AssertEx.EqualTolerance(DecilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.DecilitersPerMinute), DecilitersPerMinuteTolerance); - AssertEx.EqualTolerance(KilolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.KilolitersPerMinute), KilolitersPerMinuteTolerance); - AssertEx.EqualTolerance(LitersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.LitersPerHour), LitersPerHourTolerance); - AssertEx.EqualTolerance(LitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.LitersPerMinute), LitersPerMinuteTolerance); - AssertEx.EqualTolerance(LitersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.LitersPerSecond), LitersPerSecondTolerance); - AssertEx.EqualTolerance(MicrolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.MicrolitersPerMinute), MicrolitersPerMinuteTolerance); - AssertEx.EqualTolerance(MillilitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.MillilitersPerMinute), MillilitersPerMinuteTolerance); - AssertEx.EqualTolerance(MillionUsGallonsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.MillionUsGallonsPerDay), MillionUsGallonsPerDayTolerance); - AssertEx.EqualTolerance(NanolitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.NanolitersPerMinute), NanolitersPerMinuteTolerance); - AssertEx.EqualTolerance(OilBarrelsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.OilBarrelsPerDay), OilBarrelsPerDayTolerance); - AssertEx.EqualTolerance(UsGallonsPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.UsGallonsPerHour), UsGallonsPerHourTolerance); - AssertEx.EqualTolerance(UsGallonsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.UsGallonsPerMinute), UsGallonsPerMinuteTolerance); - AssertEx.EqualTolerance(UsGallonsPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.UsGallonsPerSecond), UsGallonsPerSecondTolerance); - } - - [Fact] - public void ToUnit() - { - var cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - - var centilitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CentilitersPerMinute); - AssertEx.EqualTolerance(CentilitersPerMinuteInOneCubicMeterPerSecond, (double)centilitersperminuteQuantity.Value, CentilitersPerMinuteTolerance); - Assert.Equal(FlowUnit.CentilitersPerMinute, centilitersperminuteQuantity.Unit); - - var cubicdecimeterperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicDecimeterPerMinute); - AssertEx.EqualTolerance(CubicDecimetersPerMinuteInOneCubicMeterPerSecond, (double)cubicdecimeterperminuteQuantity.Value, CubicDecimetersPerMinuteTolerance); - Assert.Equal(FlowUnit.CubicDecimeterPerMinute, cubicdecimeterperminuteQuantity.Unit); - - var cubicfootperhourQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicFootPerHour); - AssertEx.EqualTolerance(CubicFeetPerHourInOneCubicMeterPerSecond, (double)cubicfootperhourQuantity.Value, CubicFeetPerHourTolerance); - Assert.Equal(FlowUnit.CubicFootPerHour, cubicfootperhourQuantity.Unit); - - var cubicfootperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicFootPerMinute); - AssertEx.EqualTolerance(CubicFeetPerMinuteInOneCubicMeterPerSecond, (double)cubicfootperminuteQuantity.Value, CubicFeetPerMinuteTolerance); - Assert.Equal(FlowUnit.CubicFootPerMinute, cubicfootperminuteQuantity.Unit); - - var cubicfootpersecondQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicFootPerSecond); - AssertEx.EqualTolerance(CubicFeetPerSecondInOneCubicMeterPerSecond, (double)cubicfootpersecondQuantity.Value, CubicFeetPerSecondTolerance); - Assert.Equal(FlowUnit.CubicFootPerSecond, cubicfootpersecondQuantity.Unit); - - var cubicmeterperhourQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicMeterPerHour); - AssertEx.EqualTolerance(CubicMetersPerHourInOneCubicMeterPerSecond, (double)cubicmeterperhourQuantity.Value, CubicMetersPerHourTolerance); - Assert.Equal(FlowUnit.CubicMeterPerHour, cubicmeterperhourQuantity.Unit); - - var cubicmeterperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicMeterPerMinute); - AssertEx.EqualTolerance(CubicMetersPerMinuteInOneCubicMeterPerSecond, (double)cubicmeterperminuteQuantity.Value, CubicMetersPerMinuteTolerance); - Assert.Equal(FlowUnit.CubicMeterPerMinute, cubicmeterperminuteQuantity.Unit); - - var cubicmeterpersecondQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicMeterPerSecond); - AssertEx.EqualTolerance(CubicMetersPerSecondInOneCubicMeterPerSecond, (double)cubicmeterpersecondQuantity.Value, CubicMetersPerSecondTolerance); - Assert.Equal(FlowUnit.CubicMeterPerSecond, cubicmeterpersecondQuantity.Unit); - - var cubicyardperhourQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicYardPerHour); - AssertEx.EqualTolerance(CubicYardsPerHourInOneCubicMeterPerSecond, (double)cubicyardperhourQuantity.Value, CubicYardsPerHourTolerance); - Assert.Equal(FlowUnit.CubicYardPerHour, cubicyardperhourQuantity.Unit); - - var cubicyardperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicYardPerMinute); - AssertEx.EqualTolerance(CubicYardsPerMinuteInOneCubicMeterPerSecond, (double)cubicyardperminuteQuantity.Value, CubicYardsPerMinuteTolerance); - Assert.Equal(FlowUnit.CubicYardPerMinute, cubicyardperminuteQuantity.Unit); - - var cubicyardpersecondQuantity = cubicmeterpersecond.ToUnit(FlowUnit.CubicYardPerSecond); - AssertEx.EqualTolerance(CubicYardsPerSecondInOneCubicMeterPerSecond, (double)cubicyardpersecondQuantity.Value, CubicYardsPerSecondTolerance); - Assert.Equal(FlowUnit.CubicYardPerSecond, cubicyardpersecondQuantity.Unit); - - var decilitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.DecilitersPerMinute); - AssertEx.EqualTolerance(DecilitersPerMinuteInOneCubicMeterPerSecond, (double)decilitersperminuteQuantity.Value, DecilitersPerMinuteTolerance); - Assert.Equal(FlowUnit.DecilitersPerMinute, decilitersperminuteQuantity.Unit); - - var kilolitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.KilolitersPerMinute); - AssertEx.EqualTolerance(KilolitersPerMinuteInOneCubicMeterPerSecond, (double)kilolitersperminuteQuantity.Value, KilolitersPerMinuteTolerance); - Assert.Equal(FlowUnit.KilolitersPerMinute, kilolitersperminuteQuantity.Unit); - - var litersperhourQuantity = cubicmeterpersecond.ToUnit(FlowUnit.LitersPerHour); - AssertEx.EqualTolerance(LitersPerHourInOneCubicMeterPerSecond, (double)litersperhourQuantity.Value, LitersPerHourTolerance); - Assert.Equal(FlowUnit.LitersPerHour, litersperhourQuantity.Unit); - - var litersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.LitersPerMinute); - AssertEx.EqualTolerance(LitersPerMinuteInOneCubicMeterPerSecond, (double)litersperminuteQuantity.Value, LitersPerMinuteTolerance); - Assert.Equal(FlowUnit.LitersPerMinute, litersperminuteQuantity.Unit); - - var literspersecondQuantity = cubicmeterpersecond.ToUnit(FlowUnit.LitersPerSecond); - AssertEx.EqualTolerance(LitersPerSecondInOneCubicMeterPerSecond, (double)literspersecondQuantity.Value, LitersPerSecondTolerance); - Assert.Equal(FlowUnit.LitersPerSecond, literspersecondQuantity.Unit); - - var microlitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.MicrolitersPerMinute); - AssertEx.EqualTolerance(MicrolitersPerMinuteInOneCubicMeterPerSecond, (double)microlitersperminuteQuantity.Value, MicrolitersPerMinuteTolerance); - Assert.Equal(FlowUnit.MicrolitersPerMinute, microlitersperminuteQuantity.Unit); - - var millilitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.MillilitersPerMinute); - AssertEx.EqualTolerance(MillilitersPerMinuteInOneCubicMeterPerSecond, (double)millilitersperminuteQuantity.Value, MillilitersPerMinuteTolerance); - Assert.Equal(FlowUnit.MillilitersPerMinute, millilitersperminuteQuantity.Unit); - - var millionusgallonsperdayQuantity = cubicmeterpersecond.ToUnit(FlowUnit.MillionUsGallonsPerDay); - AssertEx.EqualTolerance(MillionUsGallonsPerDayInOneCubicMeterPerSecond, (double)millionusgallonsperdayQuantity.Value, MillionUsGallonsPerDayTolerance); - Assert.Equal(FlowUnit.MillionUsGallonsPerDay, millionusgallonsperdayQuantity.Unit); - - var nanolitersperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.NanolitersPerMinute); - AssertEx.EqualTolerance(NanolitersPerMinuteInOneCubicMeterPerSecond, (double)nanolitersperminuteQuantity.Value, NanolitersPerMinuteTolerance); - Assert.Equal(FlowUnit.NanolitersPerMinute, nanolitersperminuteQuantity.Unit); - - var oilbarrelsperdayQuantity = cubicmeterpersecond.ToUnit(FlowUnit.OilBarrelsPerDay); - AssertEx.EqualTolerance(OilBarrelsPerDayInOneCubicMeterPerSecond, (double)oilbarrelsperdayQuantity.Value, OilBarrelsPerDayTolerance); - Assert.Equal(FlowUnit.OilBarrelsPerDay, oilbarrelsperdayQuantity.Unit); - - var usgallonsperhourQuantity = cubicmeterpersecond.ToUnit(FlowUnit.UsGallonsPerHour); - AssertEx.EqualTolerance(UsGallonsPerHourInOneCubicMeterPerSecond, (double)usgallonsperhourQuantity.Value, UsGallonsPerHourTolerance); - Assert.Equal(FlowUnit.UsGallonsPerHour, usgallonsperhourQuantity.Unit); - - var usgallonsperminuteQuantity = cubicmeterpersecond.ToUnit(FlowUnit.UsGallonsPerMinute); - AssertEx.EqualTolerance(UsGallonsPerMinuteInOneCubicMeterPerSecond, (double)usgallonsperminuteQuantity.Value, UsGallonsPerMinuteTolerance); - Assert.Equal(FlowUnit.UsGallonsPerMinute, usgallonsperminuteQuantity.Unit); - - var usgallonspersecondQuantity = cubicmeterpersecond.ToUnit(FlowUnit.UsGallonsPerSecond); - AssertEx.EqualTolerance(UsGallonsPerSecondInOneCubicMeterPerSecond, (double)usgallonspersecondQuantity.Value, UsGallonsPerSecondTolerance); - Assert.Equal(FlowUnit.UsGallonsPerSecond, usgallonspersecondQuantity.Unit); - } - - [Fact] - public void ConversionRoundTrip() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - AssertEx.EqualTolerance(1, Flow.FromCentilitersPerMinute(cubicmeterpersecond.CentilitersPerMinute).CubicMetersPerSecond, CentilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicDecimetersPerMinute(cubicmeterpersecond.CubicDecimetersPerMinute).CubicMetersPerSecond, CubicDecimetersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicFeetPerHour(cubicmeterpersecond.CubicFeetPerHour).CubicMetersPerSecond, CubicFeetPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicFeetPerMinute(cubicmeterpersecond.CubicFeetPerMinute).CubicMetersPerSecond, CubicFeetPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicFeetPerSecond(cubicmeterpersecond.CubicFeetPerSecond).CubicMetersPerSecond, CubicFeetPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicMetersPerHour(cubicmeterpersecond.CubicMetersPerHour).CubicMetersPerSecond, CubicMetersPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicMetersPerMinute(cubicmeterpersecond.CubicMetersPerMinute).CubicMetersPerSecond, CubicMetersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicMetersPerSecond(cubicmeterpersecond.CubicMetersPerSecond).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicYardsPerHour(cubicmeterpersecond.CubicYardsPerHour).CubicMetersPerSecond, CubicYardsPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicYardsPerMinute(cubicmeterpersecond.CubicYardsPerMinute).CubicMetersPerSecond, CubicYardsPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromCubicYardsPerSecond(cubicmeterpersecond.CubicYardsPerSecond).CubicMetersPerSecond, CubicYardsPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.FromDecilitersPerMinute(cubicmeterpersecond.DecilitersPerMinute).CubicMetersPerSecond, DecilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromKilolitersPerMinute(cubicmeterpersecond.KilolitersPerMinute).CubicMetersPerSecond, KilolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromLitersPerHour(cubicmeterpersecond.LitersPerHour).CubicMetersPerSecond, LitersPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.FromLitersPerMinute(cubicmeterpersecond.LitersPerMinute).CubicMetersPerSecond, LitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromLitersPerSecond(cubicmeterpersecond.LitersPerSecond).CubicMetersPerSecond, LitersPerSecondTolerance); - AssertEx.EqualTolerance(1, Flow.FromMicrolitersPerMinute(cubicmeterpersecond.MicrolitersPerMinute).CubicMetersPerSecond, MicrolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromMillilitersPerMinute(cubicmeterpersecond.MillilitersPerMinute).CubicMetersPerSecond, MillilitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromMillionUsGallonsPerDay(cubicmeterpersecond.MillionUsGallonsPerDay).CubicMetersPerSecond, MillionUsGallonsPerDayTolerance); - AssertEx.EqualTolerance(1, Flow.FromNanolitersPerMinute(cubicmeterpersecond.NanolitersPerMinute).CubicMetersPerSecond, NanolitersPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromOilBarrelsPerDay(cubicmeterpersecond.OilBarrelsPerDay).CubicMetersPerSecond, OilBarrelsPerDayTolerance); - AssertEx.EqualTolerance(1, Flow.FromUsGallonsPerHour(cubicmeterpersecond.UsGallonsPerHour).CubicMetersPerSecond, UsGallonsPerHourTolerance); - AssertEx.EqualTolerance(1, Flow.FromUsGallonsPerMinute(cubicmeterpersecond.UsGallonsPerMinute).CubicMetersPerSecond, UsGallonsPerMinuteTolerance); - AssertEx.EqualTolerance(1, Flow.FromUsGallonsPerSecond(cubicmeterpersecond.UsGallonsPerSecond).CubicMetersPerSecond, UsGallonsPerSecondTolerance); - } - - [Fact] - public void ArithmeticOperators() - { - Flow v = Flow.FromCubicMetersPerSecond(1); - AssertEx.EqualTolerance(-1, -v.CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(2, (Flow.FromCubicMetersPerSecond(3)-v).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(2, (v + v).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(10, (v*10).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(10, (10*v).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(2, (Flow.FromCubicMetersPerSecond(10)/5).CubicMetersPerSecond, CubicMetersPerSecondTolerance); - AssertEx.EqualTolerance(2, Flow.FromCubicMetersPerSecond(10)/Flow.FromCubicMetersPerSecond(5), CubicMetersPerSecondTolerance); - } - - [Fact] - public void ComparisonOperators() - { - Flow oneCubicMeterPerSecond = Flow.FromCubicMetersPerSecond(1); - Flow twoCubicMetersPerSecond = Flow.FromCubicMetersPerSecond(2); - - Assert.True(oneCubicMeterPerSecond < twoCubicMetersPerSecond); - Assert.True(oneCubicMeterPerSecond <= twoCubicMetersPerSecond); - Assert.True(twoCubicMetersPerSecond > oneCubicMeterPerSecond); - Assert.True(twoCubicMetersPerSecond >= oneCubicMeterPerSecond); - - Assert.False(oneCubicMeterPerSecond > twoCubicMetersPerSecond); - Assert.False(oneCubicMeterPerSecond >= twoCubicMetersPerSecond); - Assert.False(twoCubicMetersPerSecond < oneCubicMeterPerSecond); - Assert.False(twoCubicMetersPerSecond <= oneCubicMeterPerSecond); - } - - [Fact] - public void CompareToIsImplemented() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - Assert.Equal(0, cubicmeterpersecond.CompareTo(cubicmeterpersecond)); - Assert.True(cubicmeterpersecond.CompareTo(Flow.Zero) > 0); - Assert.True(Flow.Zero.CompareTo(cubicmeterpersecond) < 0); - } - - [Fact] - public void CompareToThrowsOnTypeMismatch() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - Assert.Throws(() => cubicmeterpersecond.CompareTo(new object())); - } - - [Fact] - public void CompareToThrowsOnNull() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - Assert.Throws(() => cubicmeterpersecond.CompareTo(null)); - } - - - [Fact] - public void EqualityOperators() - { - Flow a = Flow.FromCubicMetersPerSecond(1); - Flow b = Flow.FromCubicMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - - [Fact] - public void EqualsIsImplemented() - { - Flow v = Flow.FromCubicMetersPerSecond(1); - Assert.True(v.Equals(Flow.FromCubicMetersPerSecond(1), Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - Assert.False(v.Equals(Flow.Zero, Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - } - - [Fact] - public void EqualsReturnsFalseOnTypeMismatch() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - Assert.False(cubicmeterpersecond.Equals(new object())); - } - - [Fact] - public void EqualsReturnsFalseOnNull() - { - Flow cubicmeterpersecond = Flow.FromCubicMetersPerSecond(1); - Assert.False(cubicmeterpersecond.Equals(null)); - } - - [Fact] - public void UnitsDoesNotContainUndefined() - { - Assert.DoesNotContain(FlowUnit.Undefined, Flow.Units); - } - - } -} diff --git a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs index fad6f6b86e..98dca17dd2 100644 --- a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs @@ -85,7 +85,6 @@ public abstract partial class PressureTestsBase protected abstract double PascalsInOnePascal { get; } protected abstract double PoundsForcePerSquareFootInOnePascal { get; } protected abstract double PoundsForcePerSquareInchInOnePascal { get; } - protected abstract double PsiInOnePascal { get; } protected abstract double TechnicalAtmospheresInOnePascal { get; } protected abstract double TonnesForcePerSquareCentimeterInOnePascal { get; } protected abstract double TonnesForcePerSquareMeterInOnePascal { get; } @@ -125,7 +124,6 @@ public abstract partial class PressureTestsBase protected virtual double PascalsTolerance { get { return 1e-5; } } protected virtual double PoundsForcePerSquareFootTolerance { get { return 1e-5; } } protected virtual double PoundsForcePerSquareInchTolerance { get { return 1e-5; } } - protected virtual double PsiTolerance { get { return 1e-5; } } protected virtual double TechnicalAtmospheresTolerance { get { return 1e-5; } } protected virtual double TonnesForcePerSquareCentimeterTolerance { get { return 1e-5; } } protected virtual double TonnesForcePerSquareMeterTolerance { get { return 1e-5; } } @@ -169,7 +167,6 @@ public void PascalToPressureUnits() AssertEx.EqualTolerance(PascalsInOnePascal, pascal.Pascals, PascalsTolerance); AssertEx.EqualTolerance(PoundsForcePerSquareFootInOnePascal, pascal.PoundsForcePerSquareFoot, PoundsForcePerSquareFootTolerance); AssertEx.EqualTolerance(PoundsForcePerSquareInchInOnePascal, pascal.PoundsForcePerSquareInch, PoundsForcePerSquareInchTolerance); - AssertEx.EqualTolerance(PsiInOnePascal, pascal.Psi, PsiTolerance); AssertEx.EqualTolerance(TechnicalAtmospheresInOnePascal, pascal.TechnicalAtmospheres, TechnicalAtmospheresTolerance); AssertEx.EqualTolerance(TonnesForcePerSquareCentimeterInOnePascal, pascal.TonnesForcePerSquareCentimeter, TonnesForcePerSquareCentimeterTolerance); AssertEx.EqualTolerance(TonnesForcePerSquareMeterInOnePascal, pascal.TonnesForcePerSquareMeter, TonnesForcePerSquareMeterTolerance); @@ -212,7 +209,6 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.Pascal).Pascals, PascalsTolerance); AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.PoundForcePerSquareFoot).PoundsForcePerSquareFoot, PoundsForcePerSquareFootTolerance); AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.PoundForcePerSquareInch).PoundsForcePerSquareInch, PoundsForcePerSquareInchTolerance); - AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.Psi).Psi, PsiTolerance); AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.TechnicalAtmosphere).TechnicalAtmospheres, TechnicalAtmospheresTolerance); AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.TonneForcePerSquareCentimeter).TonnesForcePerSquareCentimeter, TonnesForcePerSquareCentimeterTolerance); AssertEx.EqualTolerance(1, Pressure.From(1, PressureUnit.TonneForcePerSquareMeter).TonnesForcePerSquareMeter, TonnesForcePerSquareMeterTolerance); @@ -256,7 +252,6 @@ public void As() AssertEx.EqualTolerance(PascalsInOnePascal, pascal.As(PressureUnit.Pascal), PascalsTolerance); AssertEx.EqualTolerance(PoundsForcePerSquareFootInOnePascal, pascal.As(PressureUnit.PoundForcePerSquareFoot), PoundsForcePerSquareFootTolerance); AssertEx.EqualTolerance(PoundsForcePerSquareInchInOnePascal, pascal.As(PressureUnit.PoundForcePerSquareInch), PoundsForcePerSquareInchTolerance); - AssertEx.EqualTolerance(PsiInOnePascal, pascal.As(PressureUnit.Psi), PsiTolerance); AssertEx.EqualTolerance(TechnicalAtmospheresInOnePascal, pascal.As(PressureUnit.TechnicalAtmosphere), TechnicalAtmospheresTolerance); AssertEx.EqualTolerance(TonnesForcePerSquareCentimeterInOnePascal, pascal.As(PressureUnit.TonneForcePerSquareCentimeter), TonnesForcePerSquareCentimeterTolerance); AssertEx.EqualTolerance(TonnesForcePerSquareMeterInOnePascal, pascal.As(PressureUnit.TonneForcePerSquareMeter), TonnesForcePerSquareMeterTolerance); @@ -397,10 +392,6 @@ public void ToUnit() AssertEx.EqualTolerance(PoundsForcePerSquareInchInOnePascal, (double)poundforcepersquareinchQuantity.Value, PoundsForcePerSquareInchTolerance); Assert.Equal(PressureUnit.PoundForcePerSquareInch, poundforcepersquareinchQuantity.Unit); - var psiQuantity = pascal.ToUnit(PressureUnit.Psi); - AssertEx.EqualTolerance(PsiInOnePascal, (double)psiQuantity.Value, PsiTolerance); - Assert.Equal(PressureUnit.Psi, psiQuantity.Unit); - var technicalatmosphereQuantity = pascal.ToUnit(PressureUnit.TechnicalAtmosphere); AssertEx.EqualTolerance(TechnicalAtmospheresInOnePascal, (double)technicalatmosphereQuantity.Value, TechnicalAtmospheresTolerance); Assert.Equal(PressureUnit.TechnicalAtmosphere, technicalatmosphereQuantity.Unit); @@ -458,7 +449,6 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, Pressure.FromPascals(pascal.Pascals).Pascals, PascalsTolerance); AssertEx.EqualTolerance(1, Pressure.FromPoundsForcePerSquareFoot(pascal.PoundsForcePerSquareFoot).Pascals, PoundsForcePerSquareFootTolerance); AssertEx.EqualTolerance(1, Pressure.FromPoundsForcePerSquareInch(pascal.PoundsForcePerSquareInch).Pascals, PoundsForcePerSquareInchTolerance); - AssertEx.EqualTolerance(1, Pressure.FromPsi(pascal.Psi).Pascals, PsiTolerance); AssertEx.EqualTolerance(1, Pressure.FromTechnicalAtmospheres(pascal.TechnicalAtmospheres).Pascals, TechnicalAtmospheresTolerance); AssertEx.EqualTolerance(1, Pressure.FromTonnesForcePerSquareCentimeter(pascal.TonnesForcePerSquareCentimeter).Pascals, TonnesForcePerSquareCentimeterTolerance); AssertEx.EqualTolerance(1, Pressure.FromTonnesForcePerSquareMeter(pascal.TonnesForcePerSquareMeter).Pascals, TonnesForcePerSquareMeterTolerance); diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs index 3fd5e0a093..f7b56263c6 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs @@ -54,39 +54,23 @@ namespace UnitsNet.Tests public abstract partial class TemperatureDeltaTestsBase { protected abstract double DegreesCelsiusInOneKelvin { get; } - protected abstract double DegreesCelsiusDeltaInOneKelvin { get; } protected abstract double DegreesDelisleInOneKelvin { get; } - protected abstract double DegreesDelisleDeltaInOneKelvin { get; } protected abstract double DegreesFahrenheitInOneKelvin { get; } - protected abstract double DegreesFahrenheitDeltaInOneKelvin { get; } protected abstract double DegreesNewtonInOneKelvin { get; } - protected abstract double DegreesNewtonDeltaInOneKelvin { get; } protected abstract double DegreesRankineInOneKelvin { get; } - protected abstract double DegreesRankineDeltaInOneKelvin { get; } protected abstract double DegreesReaumurInOneKelvin { get; } - protected abstract double DegreesReaumurDeltaInOneKelvin { get; } protected abstract double DegreesRoemerInOneKelvin { get; } - protected abstract double DegreesRoemerDeltaInOneKelvin { get; } protected abstract double KelvinsInOneKelvin { get; } - protected abstract double KelvinsDeltaInOneKelvin { get; } // ReSharper disable VirtualMemberNeverOverriden.Global protected virtual double DegreesCelsiusTolerance { get { return 1e-5; } } - protected virtual double DegreesCelsiusDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesDelisleTolerance { get { return 1e-5; } } - protected virtual double DegreesDelisleDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesFahrenheitTolerance { get { return 1e-5; } } - protected virtual double DegreesFahrenheitDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesNewtonTolerance { get { return 1e-5; } } - protected virtual double DegreesNewtonDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesRankineTolerance { get { return 1e-5; } } - protected virtual double DegreesRankineDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesReaumurTolerance { get { return 1e-5; } } - protected virtual double DegreesReaumurDeltaTolerance { get { return 1e-5; } } protected virtual double DegreesRoemerTolerance { get { return 1e-5; } } - protected virtual double DegreesRoemerDeltaTolerance { get { return 1e-5; } } protected virtual double KelvinsTolerance { get { return 1e-5; } } - protected virtual double KelvinsDeltaTolerance { get { return 1e-5; } } // ReSharper restore VirtualMemberNeverOverriden.Global [Fact] @@ -94,42 +78,26 @@ public void KelvinToTemperatureDeltaUnits() { TemperatureDelta kelvin = TemperatureDelta.FromKelvins(1); AssertEx.EqualTolerance(DegreesCelsiusInOneKelvin, kelvin.DegreesCelsius, DegreesCelsiusTolerance); - AssertEx.EqualTolerance(DegreesCelsiusDeltaInOneKelvin, kelvin.DegreesCelsiusDelta, DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(DegreesDelisleInOneKelvin, kelvin.DegreesDelisle, DegreesDelisleTolerance); - AssertEx.EqualTolerance(DegreesDelisleDeltaInOneKelvin, kelvin.DegreesDelisleDelta, DegreesDelisleDeltaTolerance); AssertEx.EqualTolerance(DegreesFahrenheitInOneKelvin, kelvin.DegreesFahrenheit, DegreesFahrenheitTolerance); - AssertEx.EqualTolerance(DegreesFahrenheitDeltaInOneKelvin, kelvin.DegreesFahrenheitDelta, DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(DegreesNewtonInOneKelvin, kelvin.DegreesNewton, DegreesNewtonTolerance); - AssertEx.EqualTolerance(DegreesNewtonDeltaInOneKelvin, kelvin.DegreesNewtonDelta, DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(DegreesRankineInOneKelvin, kelvin.DegreesRankine, DegreesRankineTolerance); - AssertEx.EqualTolerance(DegreesRankineDeltaInOneKelvin, kelvin.DegreesRankineDelta, DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(DegreesReaumurInOneKelvin, kelvin.DegreesReaumur, DegreesReaumurTolerance); - AssertEx.EqualTolerance(DegreesReaumurDeltaInOneKelvin, kelvin.DegreesReaumurDelta, DegreesReaumurDeltaTolerance); AssertEx.EqualTolerance(DegreesRoemerInOneKelvin, kelvin.DegreesRoemer, DegreesRoemerTolerance); - AssertEx.EqualTolerance(DegreesRoemerDeltaInOneKelvin, kelvin.DegreesRoemerDelta, DegreesRoemerDeltaTolerance); AssertEx.EqualTolerance(KelvinsInOneKelvin, kelvin.Kelvins, KelvinsTolerance); - AssertEx.EqualTolerance(KelvinsDeltaInOneKelvin, kelvin.KelvinsDelta, KelvinsDeltaTolerance); } [Fact] public void FromValueAndUnit() { AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeCelsius).DegreesCelsius, DegreesCelsiusTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeCelsiusDelta).DegreesCelsiusDelta, DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeDelisle).DegreesDelisle, DegreesDelisleTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeDelisleDelta).DegreesDelisleDelta, DegreesDelisleDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeFahrenheit).DegreesFahrenheit, DegreesFahrenheitTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeFahrenheitDelta).DegreesFahrenheitDelta, DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeNewton).DegreesNewton, DegreesNewtonTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeNewtonDelta).DegreesNewtonDelta, DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeRankine).DegreesRankine, DegreesRankineTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeRankineDelta).DegreesRankineDelta, DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeReaumur).DegreesReaumur, DegreesReaumurTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeReaumurDelta).DegreesReaumurDelta, DegreesReaumurDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeRoemer).DegreesRoemer, DegreesRoemerTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.DegreeRoemerDelta).DegreesRoemerDelta, DegreesRoemerDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.Kelvin).Kelvins, KelvinsTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.From(1, TemperatureDeltaUnit.KelvinDelta).KelvinsDelta, KelvinsDeltaTolerance); } [Fact] @@ -137,21 +105,13 @@ public void As() { var kelvin = TemperatureDelta.FromKelvins(1); AssertEx.EqualTolerance(DegreesCelsiusInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeCelsius), DegreesCelsiusTolerance); - AssertEx.EqualTolerance(DegreesCelsiusDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeCelsiusDelta), DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(DegreesDelisleInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeDelisle), DegreesDelisleTolerance); - AssertEx.EqualTolerance(DegreesDelisleDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeDelisleDelta), DegreesDelisleDeltaTolerance); AssertEx.EqualTolerance(DegreesFahrenheitInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeFahrenheit), DegreesFahrenheitTolerance); - AssertEx.EqualTolerance(DegreesFahrenheitDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeFahrenheitDelta), DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(DegreesNewtonInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeNewton), DegreesNewtonTolerance); - AssertEx.EqualTolerance(DegreesNewtonDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeNewtonDelta), DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(DegreesRankineInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeRankine), DegreesRankineTolerance); - AssertEx.EqualTolerance(DegreesRankineDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeRankineDelta), DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(DegreesReaumurInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeReaumur), DegreesReaumurTolerance); - AssertEx.EqualTolerance(DegreesReaumurDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeReaumurDelta), DegreesReaumurDeltaTolerance); AssertEx.EqualTolerance(DegreesRoemerInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeRoemer), DegreesRoemerTolerance); - AssertEx.EqualTolerance(DegreesRoemerDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.DegreeRoemerDelta), DegreesRoemerDeltaTolerance); AssertEx.EqualTolerance(KelvinsInOneKelvin, kelvin.As(TemperatureDeltaUnit.Kelvin), KelvinsTolerance); - AssertEx.EqualTolerance(KelvinsDeltaInOneKelvin, kelvin.As(TemperatureDeltaUnit.KelvinDelta), KelvinsDeltaTolerance); } [Fact] @@ -163,65 +123,33 @@ public void ToUnit() AssertEx.EqualTolerance(DegreesCelsiusInOneKelvin, (double)degreecelsiusQuantity.Value, DegreesCelsiusTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeCelsius, degreecelsiusQuantity.Unit); - var degreecelsiusdeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeCelsiusDelta); - AssertEx.EqualTolerance(DegreesCelsiusDeltaInOneKelvin, (double)degreecelsiusdeltaQuantity.Value, DegreesCelsiusDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeCelsiusDelta, degreecelsiusdeltaQuantity.Unit); - var degreedelisleQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeDelisle); AssertEx.EqualTolerance(DegreesDelisleInOneKelvin, (double)degreedelisleQuantity.Value, DegreesDelisleTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeDelisle, degreedelisleQuantity.Unit); - var degreedelisledeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeDelisleDelta); - AssertEx.EqualTolerance(DegreesDelisleDeltaInOneKelvin, (double)degreedelisledeltaQuantity.Value, DegreesDelisleDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeDelisleDelta, degreedelisledeltaQuantity.Unit); - var degreefahrenheitQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeFahrenheit); AssertEx.EqualTolerance(DegreesFahrenheitInOneKelvin, (double)degreefahrenheitQuantity.Value, DegreesFahrenheitTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeFahrenheit, degreefahrenheitQuantity.Unit); - var degreefahrenheitdeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeFahrenheitDelta); - AssertEx.EqualTolerance(DegreesFahrenheitDeltaInOneKelvin, (double)degreefahrenheitdeltaQuantity.Value, DegreesFahrenheitDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeFahrenheitDelta, degreefahrenheitdeltaQuantity.Unit); - var degreenewtonQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeNewton); AssertEx.EqualTolerance(DegreesNewtonInOneKelvin, (double)degreenewtonQuantity.Value, DegreesNewtonTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeNewton, degreenewtonQuantity.Unit); - var degreenewtondeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeNewtonDelta); - AssertEx.EqualTolerance(DegreesNewtonDeltaInOneKelvin, (double)degreenewtondeltaQuantity.Value, DegreesNewtonDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeNewtonDelta, degreenewtondeltaQuantity.Unit); - var degreerankineQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeRankine); AssertEx.EqualTolerance(DegreesRankineInOneKelvin, (double)degreerankineQuantity.Value, DegreesRankineTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeRankine, degreerankineQuantity.Unit); - var degreerankinedeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeRankineDelta); - AssertEx.EqualTolerance(DegreesRankineDeltaInOneKelvin, (double)degreerankinedeltaQuantity.Value, DegreesRankineDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeRankineDelta, degreerankinedeltaQuantity.Unit); - var degreereaumurQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeReaumur); AssertEx.EqualTolerance(DegreesReaumurInOneKelvin, (double)degreereaumurQuantity.Value, DegreesReaumurTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeReaumur, degreereaumurQuantity.Unit); - var degreereaumurdeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeReaumurDelta); - AssertEx.EqualTolerance(DegreesReaumurDeltaInOneKelvin, (double)degreereaumurdeltaQuantity.Value, DegreesReaumurDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeReaumurDelta, degreereaumurdeltaQuantity.Unit); - var degreeroemerQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeRoemer); AssertEx.EqualTolerance(DegreesRoemerInOneKelvin, (double)degreeroemerQuantity.Value, DegreesRoemerTolerance); Assert.Equal(TemperatureDeltaUnit.DegreeRoemer, degreeroemerQuantity.Unit); - var degreeroemerdeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.DegreeRoemerDelta); - AssertEx.EqualTolerance(DegreesRoemerDeltaInOneKelvin, (double)degreeroemerdeltaQuantity.Value, DegreesRoemerDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.DegreeRoemerDelta, degreeroemerdeltaQuantity.Unit); - var kelvinQuantity = kelvin.ToUnit(TemperatureDeltaUnit.Kelvin); AssertEx.EqualTolerance(KelvinsInOneKelvin, (double)kelvinQuantity.Value, KelvinsTolerance); Assert.Equal(TemperatureDeltaUnit.Kelvin, kelvinQuantity.Unit); - - var kelvindeltaQuantity = kelvin.ToUnit(TemperatureDeltaUnit.KelvinDelta); - AssertEx.EqualTolerance(KelvinsDeltaInOneKelvin, (double)kelvindeltaQuantity.Value, KelvinsDeltaTolerance); - Assert.Equal(TemperatureDeltaUnit.KelvinDelta, kelvindeltaQuantity.Unit); } [Fact] @@ -229,21 +157,13 @@ public void ConversionRoundTrip() { TemperatureDelta kelvin = TemperatureDelta.FromKelvins(1); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsius(kelvin.DegreesCelsius).Kelvins, DegreesCelsiusTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesCelsiusDelta(kelvin.DegreesCelsiusDelta).Kelvins, DegreesCelsiusDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesDelisle(kelvin.DegreesDelisle).Kelvins, DegreesDelisleTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesDelisleDelta(kelvin.DegreesDelisleDelta).Kelvins, DegreesDelisleDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheit(kelvin.DegreesFahrenheit).Kelvins, DegreesFahrenheitTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesFahrenheitDelta(kelvin.DegreesFahrenheitDelta).Kelvins, DegreesFahrenheitDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewton(kelvin.DegreesNewton).Kelvins, DegreesNewtonTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesNewtonDelta(kelvin.DegreesNewtonDelta).Kelvins, DegreesNewtonDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankine(kelvin.DegreesRankine).Kelvins, DegreesRankineTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRankineDelta(kelvin.DegreesRankineDelta).Kelvins, DegreesRankineDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesReaumur(kelvin.DegreesReaumur).Kelvins, DegreesReaumurTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesReaumurDelta(kelvin.DegreesReaumurDelta).Kelvins, DegreesReaumurDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRoemer(kelvin.DegreesRoemer).Kelvins, DegreesRoemerTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromDegreesRoemerDelta(kelvin.DegreesRoemerDelta).Kelvins, DegreesRoemerDeltaTolerance); AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvins(kelvin.Kelvins).Kelvins, KelvinsTolerance); - AssertEx.EqualTolerance(1, TemperatureDelta.FromKelvinsDelta(kelvin.KelvinsDelta).Kelvins, KelvinsDeltaTolerance); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs index feecaf0831..6d81c3d63e 100644 --- a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs @@ -85,8 +85,6 @@ public abstract partial class VolumeTestsBase protected abstract double MicrolitersInOneCubicMeter { get; } protected abstract double MillilitersInOneCubicMeter { get; } protected abstract double OilBarrelsInOneCubicMeter { get; } - protected abstract double TablespoonsInOneCubicMeter { get; } - protected abstract double TeaspoonsInOneCubicMeter { get; } protected abstract double UkTablespoonsInOneCubicMeter { get; } protected abstract double UsBeerBarrelsInOneCubicMeter { get; } protected abstract double UsCustomaryCupsInOneCubicMeter { get; } @@ -131,8 +129,6 @@ public abstract partial class VolumeTestsBase protected virtual double MicrolitersTolerance { get { return 1e-5; } } protected virtual double MillilitersTolerance { get { return 1e-5; } } protected virtual double OilBarrelsTolerance { get { return 1e-5; } } - protected virtual double TablespoonsTolerance { get { return 1e-5; } } - protected virtual double TeaspoonsTolerance { get { return 1e-5; } } protected virtual double UkTablespoonsTolerance { get { return 1e-5; } } protected virtual double UsBeerBarrelsTolerance { get { return 1e-5; } } protected virtual double UsCustomaryCupsTolerance { get { return 1e-5; } } @@ -181,8 +177,6 @@ public void CubicMeterToVolumeUnits() AssertEx.EqualTolerance(MicrolitersInOneCubicMeter, cubicmeter.Microliters, MicrolitersTolerance); AssertEx.EqualTolerance(MillilitersInOneCubicMeter, cubicmeter.Milliliters, MillilitersTolerance); AssertEx.EqualTolerance(OilBarrelsInOneCubicMeter, cubicmeter.OilBarrels, OilBarrelsTolerance); - AssertEx.EqualTolerance(TablespoonsInOneCubicMeter, cubicmeter.Tablespoons, TablespoonsTolerance); - AssertEx.EqualTolerance(TeaspoonsInOneCubicMeter, cubicmeter.Teaspoons, TeaspoonsTolerance); AssertEx.EqualTolerance(UkTablespoonsInOneCubicMeter, cubicmeter.UkTablespoons, UkTablespoonsTolerance); AssertEx.EqualTolerance(UsBeerBarrelsInOneCubicMeter, cubicmeter.UsBeerBarrels, UsBeerBarrelsTolerance); AssertEx.EqualTolerance(UsCustomaryCupsInOneCubicMeter, cubicmeter.UsCustomaryCups, UsCustomaryCupsTolerance); @@ -230,8 +224,6 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.Microliter).Microliters, MicrolitersTolerance); AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.Milliliter).Milliliters, MillilitersTolerance); AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.OilBarrel).OilBarrels, OilBarrelsTolerance); - AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.Tablespoon).Tablespoons, TablespoonsTolerance); - AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.Teaspoon).Teaspoons, TeaspoonsTolerance); AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.UkTablespoon).UkTablespoons, UkTablespoonsTolerance); AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.UsBeerBarrel).UsBeerBarrels, UsBeerBarrelsTolerance); AssertEx.EqualTolerance(1, Volume.From(1, VolumeUnit.UsCustomaryCup).UsCustomaryCups, UsCustomaryCupsTolerance); @@ -280,8 +272,6 @@ public void As() AssertEx.EqualTolerance(MicrolitersInOneCubicMeter, cubicmeter.As(VolumeUnit.Microliter), MicrolitersTolerance); AssertEx.EqualTolerance(MillilitersInOneCubicMeter, cubicmeter.As(VolumeUnit.Milliliter), MillilitersTolerance); AssertEx.EqualTolerance(OilBarrelsInOneCubicMeter, cubicmeter.As(VolumeUnit.OilBarrel), OilBarrelsTolerance); - AssertEx.EqualTolerance(TablespoonsInOneCubicMeter, cubicmeter.As(VolumeUnit.Tablespoon), TablespoonsTolerance); - AssertEx.EqualTolerance(TeaspoonsInOneCubicMeter, cubicmeter.As(VolumeUnit.Teaspoon), TeaspoonsTolerance); AssertEx.EqualTolerance(UkTablespoonsInOneCubicMeter, cubicmeter.As(VolumeUnit.UkTablespoon), UkTablespoonsTolerance); AssertEx.EqualTolerance(UsBeerBarrelsInOneCubicMeter, cubicmeter.As(VolumeUnit.UsBeerBarrel), UsBeerBarrelsTolerance); AssertEx.EqualTolerance(UsCustomaryCupsInOneCubicMeter, cubicmeter.As(VolumeUnit.UsCustomaryCup), UsCustomaryCupsTolerance); @@ -427,14 +417,6 @@ public void ToUnit() AssertEx.EqualTolerance(OilBarrelsInOneCubicMeter, (double)oilbarrelQuantity.Value, OilBarrelsTolerance); Assert.Equal(VolumeUnit.OilBarrel, oilbarrelQuantity.Unit); - var tablespoonQuantity = cubicmeter.ToUnit(VolumeUnit.Tablespoon); - AssertEx.EqualTolerance(TablespoonsInOneCubicMeter, (double)tablespoonQuantity.Value, TablespoonsTolerance); - Assert.Equal(VolumeUnit.Tablespoon, tablespoonQuantity.Unit); - - var teaspoonQuantity = cubicmeter.ToUnit(VolumeUnit.Teaspoon); - AssertEx.EqualTolerance(TeaspoonsInOneCubicMeter, (double)teaspoonQuantity.Value, TeaspoonsTolerance); - Assert.Equal(VolumeUnit.Teaspoon, teaspoonQuantity.Unit); - var uktablespoonQuantity = cubicmeter.ToUnit(VolumeUnit.UkTablespoon); AssertEx.EqualTolerance(UkTablespoonsInOneCubicMeter, (double)uktablespoonQuantity.Value, UkTablespoonsTolerance); Assert.Equal(VolumeUnit.UkTablespoon, uktablespoonQuantity.Unit); @@ -512,8 +494,6 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, Volume.FromMicroliters(cubicmeter.Microliters).CubicMeters, MicrolitersTolerance); AssertEx.EqualTolerance(1, Volume.FromMilliliters(cubicmeter.Milliliters).CubicMeters, MillilitersTolerance); AssertEx.EqualTolerance(1, Volume.FromOilBarrels(cubicmeter.OilBarrels).CubicMeters, OilBarrelsTolerance); - AssertEx.EqualTolerance(1, Volume.FromTablespoons(cubicmeter.Tablespoons).CubicMeters, TablespoonsTolerance); - AssertEx.EqualTolerance(1, Volume.FromTeaspoons(cubicmeter.Teaspoons).CubicMeters, TeaspoonsTolerance); AssertEx.EqualTolerance(1, Volume.FromUkTablespoons(cubicmeter.UkTablespoons).CubicMeters, UkTablespoonsTolerance); AssertEx.EqualTolerance(1, Volume.FromUsBeerBarrels(cubicmeter.UsBeerBarrels).CubicMeters, UsBeerBarrelsTolerance); AssertEx.EqualTolerance(1, Volume.FromUsCustomaryCups(cubicmeter.UsCustomaryCups).CubicMeters, UsCustomaryCupsTolerance); diff --git a/UnitsNet.Tests/UnitSystemTests.cs b/UnitsNet.Tests/UnitSystemTests.cs index 1bdb3f34c2..e65f0df700 100644 --- a/UnitsNet.Tests/UnitSystemTests.cs +++ b/UnitsNet.Tests/UnitSystemTests.cs @@ -259,7 +259,6 @@ public void ShouldUseCorrectMicroSign() Assert.Equal(DurationUnit.Microsecond, Duration.ParseUnit("\u00b5s")); Assert.Equal(ElectricCurrentUnit.Microampere, ElectricCurrent.ParseUnit("\u00b5A")); Assert.Equal(ElectricPotentialUnit.Microvolt, ElectricPotential.ParseUnit("\u00b5V")); - Assert.Equal(FlowUnit.MicrolitersPerMinute, Flow.ParseUnit("\u00b5LPM")); Assert.Equal(ForceChangeRateUnit.MicronewtonPerSecond, ForceChangeRate.ParseUnit("\u00b5N/s")); Assert.Equal(ForcePerLengthUnit.MicronewtonPerMeter, ForcePerLength.ParseUnit("\u00b5N/m")); Assert.Equal(KinematicViscosityUnit.Microstokes, KinematicViscosity.ParseUnit("\u00b5St")); @@ -276,6 +275,7 @@ public void ShouldUseCorrectMicroSign() Assert.Equal(TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond, TemperatureChangeRate.ParseUnit("\u00b5°C/s")); Assert.Equal(VolumeUnit.Microliter, Volume.ParseUnit("\u00b5l")); Assert.Equal(VolumeUnit.CubicMicrometer, Volume.ParseUnit("\u00b5m³")); + Assert.Equal(VolumeFlowUnit.MicrolitersPerMinute, VolumeFlow.ParseUnit("\u00b5LPM")); // "\u03bc" = Lower case greek letter 'Mu' Assert.Throws(() => Acceleration.ParseUnit("\u03bcm/s²")); @@ -286,7 +286,6 @@ public void ShouldUseCorrectMicroSign() Assert.Throws(() => Duration.ParseUnit("\u03bcs")); Assert.Throws(() => ElectricCurrent.ParseUnit("\u03bcA")); Assert.Throws(() => ElectricPotential.ParseUnit("\u03bcV")); - Assert.Throws(() => Flow.ParseUnit("\u03bcLPM")); Assert.Throws(() => ForceChangeRate.ParseUnit("\u03bcN/s")); Assert.Throws(() => ForcePerLength.ParseUnit("\u03bcN/m")); Assert.Throws(() => KinematicViscosity.ParseUnit("\u03bcSt")); @@ -303,6 +302,7 @@ public void ShouldUseCorrectMicroSign() Assert.Throws(() => TemperatureChangeRate.ParseUnit("\u03bc°C/s")); Assert.Throws(() => Volume.ParseUnit("\u03bcl")); Assert.Throws(() => Volume.ParseUnit("\u03bcm³")); + Assert.Throws( () => VolumeFlow.ParseUnit( "\u03bcLPM" ) ); } [Theory] @@ -315,9 +315,7 @@ public void AllUnitAbbreviationsImplemented(string cultureName) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) - .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, - EnumUtils.GetEnumValues())) - .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) + .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) .Concat(GetUnitTypesWithMissingAbbreviations(cultureName, EnumUtils.GetEnumValues())) @@ -350,7 +348,6 @@ public void AllUnitsImplementToStringForInvariantCulture() Assert.Equal("1 °", Angle.FromDegrees(1).ToString()); Assert.Equal("1 m²", Area.FromSquareMeters(1).ToString()); Assert.Equal("1 V", ElectricPotential.FromVolts(1).ToString()); - Assert.Equal("1 m³/s", Flow.FromCubicMetersPerSecond(1).ToString()); Assert.Equal("1 N", Force.FromNewtons(1).ToString()); Assert.Equal("1 m", Length.FromMeters(1).ToString()); Assert.Equal("1 kg", Mass.FromKilograms(1).ToString()); @@ -359,6 +356,7 @@ public void AllUnitsImplementToStringForInvariantCulture() Assert.Equal("1 K", Temperature.FromKelvins(1).ToString()); Assert.Equal("1 N·m", Torque.FromNewtonMeters(1).ToString()); Assert.Equal("1 m³", Volume.FromCubicMeters(1).ToString()); + Assert.Equal("1 m³/s", VolumeFlow.FromCubicMetersPerSecond(1).ToString()); Assert.Equal("2 ft 3 in", Length.FromFeetInches(2, 3).FeetInches.ToString()); Assert.Equal("3 st 7 lb", Mass.FromStonePounds(3, 7).StonePounds.ToString()); @@ -464,14 +462,14 @@ public void Parse_AmbiguousUnitsThrowsException() UnitSystem unitSystem = UnitSystem.Default; // Act 1 - var exception1 = Assert.Throws(() => unitSystem.Parse("tsp")); + var exception1 = Assert.Throws(() => unitSystem.Parse("pt")); // Act 2 - var exception2 = Assert.Throws(() => Volume.Parse("1 tsp")); + var exception2 = Assert.Throws(() => Length.Parse("1 pt")); // Assert - Assert.Equal("Cannot parse \"tsp\" since it could be either of these: MetricTeaspoon, Teaspoon", exception1.Message); - Assert.Equal("Cannot parse \"tsp\" since it could be either of these: MetricTeaspoon, Teaspoon", exception2.Message); + Assert.Equal("Cannot parse \"pt\" since it could be either of these: DtpPoint, PrinterPoint", exception1.Message); + Assert.Equal("Cannot parse \"pt\" since it could be either of these: DtpPoint, PrinterPoint", exception2.Message); } [Fact] diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs deleted file mode 100644 index 2d92d5144b..0000000000 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs +++ /dev/null @@ -1,239 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Linq; -using JetBrains.Annotations; -using UnitsNet.Units; - -// ReSharper disable once CheckNamespace - -namespace UnitsNet -{ - /// - /// In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q. - /// - // ReSharper disable once PartialTypeWithSinglePart - - // 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 Flow - { - /// - /// The numeric value this quantity was constructed with. - /// - public double Value => Convert.ToDouble(_value); - - /// - /// Creates the quantity with a value of 0 in the base unit CubicMeterPerSecond. - /// - /// - /// Windows Runtime Component requires a default constructor. - /// - public Flow() - { - _value = 0; - _unit = BaseUnit; - } - - /// - /// Get unit abbreviation string. - /// - /// Unit to get abbreviation for. - /// Name of culture (ex: "en-US") to use for localization. Defaults to 's default culture. - /// Unit abbreviation string. - [UsedImplicitly] - public static string GetAbbreviation(FlowUnit unit, [CanBeNull] string cultureName) - { - // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx - IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName); - - return UnitSystem.GetCached(provider).GetDefaultAbbreviation(unit); - } - - #region Parsing - - /// - /// Parse a string with one or two quantities of the format "<quantity> <unit>". - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// 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 Flow Parse(string str, [CanBeNull] string cultureName) - { - if (str == null) throw new ArgumentNullException(nameof(str)); - - // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx - IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName); - - return QuantityParser.Parse(str, provider, - delegate(string value, string unit, IFormatProvider formatProvider2) - { - double parsedValue = double.Parse(value, formatProvider2); - FlowUnit parsedUnit = ParseUnit(unit, formatProvider2); - return From(parsedValue, parsedUnit); - }, (x, y) => FromCubicMetersPerSecond(x.CubicMetersPerSecond + y.CubicMetersPerSecond)); - } - - /// - /// Try to parse a string with one or two quantities of the format "<quantity> <unit>". - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// Resulting unit quantity if successful. - /// - /// Length.Parse("5.5 m", new CultureInfo("en-US")); - /// - public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureName, out Flow result) - { - try - { - result = Parse(str, cultureName); - return true; - } - catch - { - result = default(Flow); - return false; - } - } - - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Format to use when parsing number and unit. Defaults to . - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - internal static FlowUnit ParseUnit(string str, IFormatProvider provider = null) - { - if (str == null) throw new ArgumentNullException(nameof(str)); - - var unitSystem = UnitSystem.GetCached(provider); - var unit = unitSystem.Parse(str.Trim()); - - if (unit == FlowUnit.Undefined) - { - var newEx = new UnitsNetException("Error parsing string. The unit is not a recognized FlowUnit."); - newEx.Data["input"] = str; - newEx.Data["provider"] = provider?.ToString() ?? "(null)"; - throw newEx; - } - - return unit; - } - - #endregion - - #region ToString Methods - - /// - /// Get string representation of value and unit. Using two significant digits after radix. - /// - /// Unit representation to use. - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture. - /// String representation. - public string ToString(FlowUnit unit, [CanBeNull] string cultureName) - { - return ToString(unit, cultureName, 2); - } - - /// - /// Get string representation of value and unit. - /// - /// Unit representation to use. - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture. - /// The number of significant digits after the radix point. - /// String representation. - [UsedImplicitly] - public string ToString(FlowUnit unit, [CanBeNull] string cultureName, int significantDigitsAfterRadix) - { - double value = As(unit); - string format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); - return ToString(unit, cultureName, format); - } - - /// - /// Get string representation of value and unit. - /// - /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture. - /// Unit representation to use. - /// 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. - [UsedImplicitly] - public string ToString(FlowUnit unit, [CanBeNull] string cultureName, [NotNull] string format, [NotNull] params object[] args) - { - if (format == null) throw new ArgumentNullException(nameof(format)); - if (args == null) throw new ArgumentNullException(nameof(args)); - - // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx - IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName); - - double value = As(unit); - object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, provider, args); - return string.Format(provider, format, formatArgs); - } - - #endregion - } -} diff --git a/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs b/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs index 4395200509..ba34a2e828 100644 --- a/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs +++ b/UnitsNet/CustomCode/Quantities/LapseRate.extra.cs @@ -35,14 +35,14 @@ public partial struct LapseRate #if !WINDOWS_UWP public static Length operator /(TemperatureDelta left, LapseRate right) { - return Length.FromKilometers(left.KelvinsDelta / right.DegreesCelciusPerKilometer); + 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.FromDegreesCelsiusDelta(left.DegreesCelciusPerKilometer * right.Kilometers); + return TemperatureDelta.FromDegreesCelsius(left.DegreesCelciusPerKilometer * right.Kilometers); } #endif } diff --git a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs index 6f422283ce..ec0234a55c 100644 --- a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs @@ -42,7 +42,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator +(Temperature left, TemperatureDelta right) { - return new Temperature(left.Kelvins + right.KelvinsDelta); + return new Temperature(left.Kelvins + right.Kelvins); } /// @@ -52,7 +52,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator +(TemperatureDelta left, Temperature right) { - return new Temperature(left.KelvinsDelta + right.Kelvins); + return new Temperature(left.Kelvins + right.Kelvins); } /// @@ -62,7 +62,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator -(Temperature left, TemperatureDelta right) { - return new Temperature(left.Kelvins - right.KelvinsDelta); + return new Temperature(left.Kelvins - right.Kelvins); } /// @@ -111,4 +111,4 @@ public Temperature Divide(double divisor, TemperatureUnit unit) return From(resultInUnit, unit); } } -} \ No newline at end of file +} diff --git a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs index 88d598e747..4ec7201483 100644 --- a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs +++ b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs @@ -35,7 +35,7 @@ public partial struct TemperatureDelta #if !WINDOWS_UWP public static LapseRate operator /(TemperatureDelta left, Length right) { - return LapseRate.FromDegreesCelciusPerKilometer(left.DegreesCelsiusDelta / right.Kilometers); + return LapseRate.FromDegreesCelciusPerKilometer(left.DegreesCelsius / right.Kilometers); } public static SpecificEnergy operator *(SpecificEntropy specificEntropy, TemperatureDelta temperatureDelta) diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs index 48e1ccab1a..dafbb1e1a8 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs @@ -99,18 +99,6 @@ public static class NumberToDurationExtensions #endregion - #region Month - - /// - [System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")] - public static Duration Months(this T value) => Duration.FromMonths(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Months(this T? value) where T : struct => Duration.FromMonths(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region Month30 /// @@ -155,18 +143,6 @@ public static class NumberToDurationExtensions #endregion - #region Year - - /// - [System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")] - public static Duration Years(this T value) => Duration.FromYears(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Years(this T? value) where T : struct => Duration.FromYears(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region Year365 /// diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs deleted file mode 100644 index 6fdb1b2fa7..0000000000 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs +++ /dev/null @@ -1,331 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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; - -// Windows Runtime Component does not support extension methods and method overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx -#if !WINDOWS_UWP -namespace UnitsNet.Extensions.NumberToFlow -{ - public static class NumberToFlowExtensions - { - #region CentilitersPerMinute - - /// - public static Flow CentilitersPerMinute(this T value) => Flow.FromCentilitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CentilitersPerMinute(this T? value) where T : struct => Flow.FromCentilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicDecimeterPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicDecimetersPerMinute(this T value) => Flow.FromCubicDecimetersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicDecimetersPerMinute(this T? value) where T : struct => Flow.FromCubicDecimetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerHour - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicFeetPerHour(this T value) => Flow.FromCubicFeetPerHour(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerHour(this T? value) where T : struct => Flow.FromCubicFeetPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicFeetPerMinute(this T value) => Flow.FromCubicFeetPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerMinute(this T? value) where T : struct => Flow.FromCubicFeetPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerSecond - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicFeetPerSecond(this T value) => Flow.FromCubicFeetPerSecond(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerSecond(this T? value) where T : struct => Flow.FromCubicFeetPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerHour - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicMetersPerHour(this T value) => Flow.FromCubicMetersPerHour(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerHour(this T? value) where T : struct => Flow.FromCubicMetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicMetersPerMinute(this T value) => Flow.FromCubicMetersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerMinute(this T? value) where T : struct => Flow.FromCubicMetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerSecond - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicMetersPerSecond(this T value) => Flow.FromCubicMetersPerSecond(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerSecond(this T? value) where T : struct => Flow.FromCubicMetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerHour - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicYardsPerHour(this T value) => Flow.FromCubicYardsPerHour(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerHour(this T? value) where T : struct => Flow.FromCubicYardsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicYardsPerMinute(this T value) => Flow.FromCubicYardsPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerMinute(this T? value) where T : struct => Flow.FromCubicYardsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerSecond - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow CubicYardsPerSecond(this T value) => Flow.FromCubicYardsPerSecond(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerSecond(this T? value) where T : struct => Flow.FromCubicYardsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecilitersPerMinute - - /// - public static Flow DecilitersPerMinute(this T value) => Flow.FromDecilitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? DecilitersPerMinute(this T? value) where T : struct => Flow.FromDecilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilolitersPerMinute - - /// - public static Flow KilolitersPerMinute(this T value) => Flow.FromKilolitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? KilolitersPerMinute(this T? value) where T : struct => Flow.FromKilolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerHour - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow LitersPerHour(this T value) => Flow.FromLitersPerHour(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerHour(this T? value) where T : struct => Flow.FromLitersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow LitersPerMinute(this T value) => Flow.FromLitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerMinute(this T? value) where T : struct => Flow.FromLitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerSecond - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow LitersPerSecond(this T value) => Flow.FromLitersPerSecond(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerSecond(this T? value) where T : struct => Flow.FromLitersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrolitersPerMinute - - /// - public static Flow MicrolitersPerMinute(this T value) => Flow.FromMicrolitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MicrolitersPerMinute(this T? value) where T : struct => Flow.FromMicrolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillilitersPerMinute - - /// - public static Flow MillilitersPerMinute(this T value) => Flow.FromMillilitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MillilitersPerMinute(this T? value) where T : struct => Flow.FromMillilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillionUsGallonsPerDay - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow MillionUsGallonsPerDay(this T value) => Flow.FromMillionUsGallonsPerDay(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MillionUsGallonsPerDay(this T? value) where T : struct => Flow.FromMillionUsGallonsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanolitersPerMinute - - /// - public static Flow NanolitersPerMinute(this T value) => Flow.FromNanolitersPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? NanolitersPerMinute(this T? value) where T : struct => Flow.FromNanolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrelsPerDay - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow OilBarrelsPerDay(this T value) => Flow.FromOilBarrelsPerDay(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? OilBarrelsPerDay(this T? value) where T : struct => Flow.FromOilBarrelsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerHour - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow UsGallonsPerHour(this T value) => Flow.FromUsGallonsPerHour(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerHour(this T? value) where T : struct => Flow.FromUsGallonsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerMinute - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow UsGallonsPerMinute(this T value) => Flow.FromUsGallonsPerMinute(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerMinute(this T? value) where T : struct => Flow.FromUsGallonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerSecond - - /// - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - public static Flow UsGallonsPerSecond(this T value) => Flow.FromUsGallonsPerSecond(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerSecond(this T? value) where T : struct => Flow.FromUsGallonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - } -} -#endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs index 3a81e40518..31775e6ab4 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs @@ -396,18 +396,6 @@ public static class NumberToPressureExtensions #endregion - #region Psi - - /// - [System.Obsolete("Deprecated due to github issue #215, please use PoundForcePerSquareInch instead")] - public static Pressure Psi(this T value) => Pressure.FromPsi(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Psi(this T? value) where T : struct => Pressure.FromPsi(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region TechnicalAtmosphere /// diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs index 1b2559ee15..1e0f241ffd 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs @@ -55,18 +55,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeCelsiusDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeCelsius instead")] - public static TemperatureDelta DegreesCelsiusDelta(this T value) => TemperatureDelta.FromDegreesCelsiusDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesCelsiusDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesCelsiusDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeDelisle /// @@ -78,18 +66,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeDelisleDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeDelisle instead")] - public static TemperatureDelta DegreesDelisleDelta(this T value) => TemperatureDelta.FromDegreesDelisleDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesDelisleDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesDelisleDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeFahrenheit /// @@ -101,18 +77,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeFahrenheitDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeFahrenheit instead")] - public static TemperatureDelta DegreesFahrenheitDelta(this T value) => TemperatureDelta.FromDegreesFahrenheitDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesFahrenheitDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesFahrenheitDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeNewton /// @@ -124,18 +88,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeNewtonDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeNewton instead")] - public static TemperatureDelta DegreesNewtonDelta(this T value) => TemperatureDelta.FromDegreesNewtonDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesNewtonDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesNewtonDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeRankine /// @@ -147,18 +99,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeRankineDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRankine instead")] - public static TemperatureDelta DegreesRankineDelta(this T value) => TemperatureDelta.FromDegreesRankineDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRankineDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesRankineDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeReaumur /// @@ -170,18 +110,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeReaumurDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeReaumur instead")] - public static TemperatureDelta DegreesReaumurDelta(this T value) => TemperatureDelta.FromDegreesReaumurDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesReaumurDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesReaumurDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region DegreeRoemer /// @@ -193,18 +121,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region DegreeRoemerDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRoemer instead")] - public static TemperatureDelta DegreesRoemerDelta(this T value) => TemperatureDelta.FromDegreesRoemerDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRoemerDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesRoemerDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region Kelvin /// @@ -216,18 +132,6 @@ public static class NumberToTemperatureDeltaExtensions #endregion - #region KelvinDelta - - /// - [System.Obsolete("Deprecated due to github issue #180, please use Kelvin instead")] - public static TemperatureDelta KelvinsDelta(this T value) => TemperatureDelta.FromKelvinsDelta(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? KelvinsDelta(this T? value) where T : struct => TemperatureDelta.FromKelvinsDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs index 26c05e3625..7f51e84537 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs @@ -396,30 +396,6 @@ public static class NumberToVolumeExtensions #endregion - #region Tablespoon - - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTablespoon instead")] - public static Volume Tablespoons(this T value) => Volume.FromTablespoons(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Tablespoons(this T? value) where T : struct => Volume.FromTablespoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Teaspoon - - /// - [System.Obsolete("Deprecated due to github issue #134, please use UsTeaspoon instead")] - public static Volume Teaspoons(this T value) => Volume.FromTeaspoons(Convert.ToDouble(value)); - - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Teaspoons(this T? value) where T : struct => Volume.FromTeaspoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region UkTablespoon /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 351f373794..5a6de28e1c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -107,15 +107,6 @@ public partial struct Duration : IComparable, IComparable return minutes.HasValue ? FromMinutes(minutes.Value) : default(Duration?); } - /// - /// Get nullable Duration from nullable Months. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMonths(QuantityValue? months) - { - return months.HasValue ? FromMonths(months.Value) : default(Duration?); - } - /// /// Get nullable Duration from nullable Months30. /// @@ -152,15 +143,6 @@ public partial struct Duration : IComparable, IComparable return weeks.HasValue ? FromWeeks(weeks.Value) : default(Duration?); } - /// - /// Get nullable Duration from nullable Years. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromYears(QuantityValue? years) - { - return years.HasValue ? FromYears(years.Value) : default(Duration?); - } - /// /// Get nullable Duration from nullable Years365. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs deleted file mode 100644 index 1530fa6888..0000000000 --- a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs +++ /dev/null @@ -1,528 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Linq; -using JetBrains.Annotations; -using UnitsNet.Units; - -// ReSharper disable once CheckNamespace - -namespace UnitsNet -{ - /// - /// In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q. - /// - // ReSharper disable once PartialTypeWithSinglePart - - public partial struct Flow : IComparable, IComparable - { - /// - /// The numeric value this quantity was constructed with. - /// - public double Value => _value; - - #region Nullable From Methods - - /// - /// Get nullable Flow from nullable CentilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCentilitersPerMinute(QuantityValue? centilitersperminute) - { - return centilitersperminute.HasValue ? FromCentilitersPerMinute(centilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicDecimetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicDecimetersPerMinute(QuantityValue? cubicdecimetersperminute) - { - return cubicdecimetersperminute.HasValue ? FromCubicDecimetersPerMinute(cubicdecimetersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerHour(QuantityValue? cubicfeetperhour) - { - return cubicfeetperhour.HasValue ? FromCubicFeetPerHour(cubicfeetperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerMinute(QuantityValue? cubicfeetperminute) - { - return cubicfeetperminute.HasValue ? FromCubicFeetPerMinute(cubicfeetperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerSecond(QuantityValue? cubicfeetpersecond) - { - return cubicfeetpersecond.HasValue ? FromCubicFeetPerSecond(cubicfeetpersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerHour(QuantityValue? cubicmetersperhour) - { - return cubicmetersperhour.HasValue ? FromCubicMetersPerHour(cubicmetersperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerMinute(QuantityValue? cubicmetersperminute) - { - return cubicmetersperminute.HasValue ? FromCubicMetersPerMinute(cubicmetersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerSecond(QuantityValue? cubicmeterspersecond) - { - return cubicmeterspersecond.HasValue ? FromCubicMetersPerSecond(cubicmeterspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerHour(QuantityValue? cubicyardsperhour) - { - return cubicyardsperhour.HasValue ? FromCubicYardsPerHour(cubicyardsperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerMinute(QuantityValue? cubicyardsperminute) - { - return cubicyardsperminute.HasValue ? FromCubicYardsPerMinute(cubicyardsperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerSecond(QuantityValue? cubicyardspersecond) - { - return cubicyardspersecond.HasValue ? FromCubicYardsPerSecond(cubicyardspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable DecilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromDecilitersPerMinute(QuantityValue? decilitersperminute) - { - return decilitersperminute.HasValue ? FromDecilitersPerMinute(decilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable KilolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromKilolitersPerMinute(QuantityValue? kilolitersperminute) - { - return kilolitersperminute.HasValue ? FromKilolitersPerMinute(kilolitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerHour(QuantityValue? litersperhour) - { - return litersperhour.HasValue ? FromLitersPerHour(litersperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerMinute(QuantityValue? litersperminute) - { - return litersperminute.HasValue ? FromLitersPerMinute(litersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerSecond(QuantityValue? literspersecond) - { - return literspersecond.HasValue ? FromLitersPerSecond(literspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MicrolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMicrolitersPerMinute(QuantityValue? microlitersperminute) - { - return microlitersperminute.HasValue ? FromMicrolitersPerMinute(microlitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MillilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMillilitersPerMinute(QuantityValue? millilitersperminute) - { - return millilitersperminute.HasValue ? FromMillilitersPerMinute(millilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MillionUsGallonsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMillionUsGallonsPerDay(QuantityValue? millionusgallonsperday) - { - return millionusgallonsperday.HasValue ? FromMillionUsGallonsPerDay(millionusgallonsperday.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable NanolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromNanolitersPerMinute(QuantityValue? nanolitersperminute) - { - return nanolitersperminute.HasValue ? FromNanolitersPerMinute(nanolitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable OilBarrelsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromOilBarrelsPerDay(QuantityValue? oilbarrelsperday) - { - return oilbarrelsperday.HasValue ? FromOilBarrelsPerDay(oilbarrelsperday.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerHour(QuantityValue? usgallonsperhour) - { - return usgallonsperhour.HasValue ? FromUsGallonsPerHour(usgallonsperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerMinute(QuantityValue? usgallonsperminute) - { - return usgallonsperminute.HasValue ? FromUsGallonsPerMinute(usgallonsperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerSecond(QuantityValue? usgallonspersecond) - { - return usgallonspersecond.HasValue ? FromUsGallonsPerSecond(usgallonspersecond.Value) : default(Flow?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Flow unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? From(QuantityValue? value, FlowUnit fromUnit) - { - return value.HasValue ? new Flow((double)value.Value, fromUnit) : default(Flow?); - } - - #endregion - - /// - /// Get unit abbreviation string. - /// - /// Unit to get abbreviation for. - /// Format to use for localization. Defaults to . - /// Unit abbreviation string. - [UsedImplicitly] - public static string GetAbbreviation(FlowUnit unit, [CanBeNull] IFormatProvider provider) - { - provider = provider ?? UnitSystem.DefaultCulture; - - return UnitSystem.GetCached(provider).GetDefaultAbbreviation(unit); - } - - #region Arithmetic Operators - - public static Flow operator -(Flow right) - { - return new Flow(-right.Value, right.Unit); - } - - public static Flow operator +(Flow left, Flow right) - { - return new Flow(left.Value + right.AsBaseNumericType(left.Unit), left.Unit); - } - - public static Flow operator -(Flow left, Flow right) - { - return new Flow(left.Value - right.AsBaseNumericType(left.Unit), left.Unit); - } - - public static Flow operator *(double left, Flow right) - { - return new Flow(left * right.Value, right.Unit); - } - - public static Flow operator *(Flow left, double right) - { - return new Flow(left.Value * right, left.Unit); - } - - public static Flow operator /(Flow left, double right) - { - return new Flow(left.Value / right, left.Unit); - } - - public static double operator /(Flow left, Flow right) - { - return left.CubicMetersPerSecond / right.CubicMetersPerSecond; - } - - #endregion - - public static bool operator <=(Flow left, Flow right) - { - return left.Value <= right.AsBaseNumericType(left.Unit); - } - - public static bool operator >=(Flow left, Flow right) - { - return left.Value >= right.AsBaseNumericType(left.Unit); - } - - public static bool operator <(Flow left, Flow right) - { - return left.Value < right.AsBaseNumericType(left.Unit); - } - - public static bool operator >(Flow left, Flow right) - { - return left.Value > right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - - #region Parsing - - /// - /// Parse a string with one or two quantities of the format "<quantity> <unit>". - /// - /// String to parse. Typically in the form: {number} {unit} - /// Format to use when parsing number and unit. Defaults to . - /// - /// 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 Flow Parse(string str, [CanBeNull] IFormatProvider provider) - { - if (str == null) throw new ArgumentNullException(nameof(str)); - - provider = provider ?? UnitSystem.DefaultCulture; - - return QuantityParser.Parse(str, provider, - delegate(string value, string unit, IFormatProvider formatProvider2) - { - double parsedValue = double.Parse(value, formatProvider2); - FlowUnit parsedUnit = ParseUnit(unit, formatProvider2); - return From(parsedValue, parsedUnit); - }, (x, y) => FromCubicMetersPerSecond(x.CubicMetersPerSecond + y.CubicMetersPerSecond)); - } - - /// - /// Try to parse a string with one or two quantities of the format "<quantity> <unit>". - /// - /// String to parse. Typically in the form: {number} {unit} - /// Format to use when parsing number and unit. Defaults to . - /// Resulting unit quantity if successful. - /// - /// Length.Parse("5.5 m", new CultureInfo("en-US")); - /// - public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Flow result) - { - provider = provider ?? UnitSystem.DefaultCulture; - - try - { - result = Parse(str, provider); - return true; - } - catch - { - result = default(Flow); - return false; - } - } - - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Format to use when parsing number and unit. Defaults to . - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - public static FlowUnit ParseUnit(string str, IFormatProvider provider = null) - { - if (str == null) throw new ArgumentNullException(nameof(str)); - - var unitSystem = UnitSystem.GetCached(provider); - var unit = unitSystem.Parse(str.Trim()); - - if (unit == FlowUnit.Undefined) - { - var newEx = new UnitsNetException("Error parsing string. The unit is not a recognized FlowUnit."); - newEx.Data["input"] = str; - newEx.Data["provider"] = provider?.ToString() ?? "(null)"; - throw newEx; - } - - return unit; - } - - #endregion - - #region ToString Methods - - /// - /// Get string representation of value and unit. Using two significant digits after radix. - /// - /// Unit representation to use. - /// Format to use for localization and number formatting. Defaults to . - /// String representation. - public string ToString(FlowUnit unit, [CanBeNull] IFormatProvider provider) - { - return ToString(unit, provider, 2); - } - - /// - /// Get string representation of value and unit. - /// - /// Unit representation to use. - /// Format to use for localization and number formatting. Defaults to . - /// The number of significant digits after the radix point. - /// String representation. - [UsedImplicitly] - public string ToString(FlowUnit unit, [CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) - { - double value = As(unit); - string format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix); - return ToString(unit, provider, format); - } - - /// - /// Get string representation of value and unit. - /// - /// Format to use for localization and number formatting. Defaults to . - /// Unit representation to use. - /// 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. - [UsedImplicitly] - public string ToString(FlowUnit unit, [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 ?? UnitSystem.DefaultCulture; - - double value = As(unit); - object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, provider, args); - return string.Format(provider, format, formatArgs); - } - - #endregion - } -} diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 251ae0bce2..0a73b6efb5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -350,15 +350,6 @@ public partial struct Pressure : IComparable, IComparable return poundsforcepersquareinch.HasValue ? FromPoundsForcePerSquareInch(poundsforcepersquareinch.Value) : default(Pressure?); } - /// - /// Get nullable Pressure from nullable Psi. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromPsi(QuantityValue? psi) - { - return psi.HasValue ? FromPsi(psi.Value) : default(Pressure?); - } - /// /// Get nullable Pressure from nullable TechnicalAtmospheres. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1a85aa86c7..b0d857da0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -71,15 +71,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesCelsiusDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesCelsiusDelta(QuantityValue? degreescelsiusdelta) - { - return degreescelsiusdelta.HasValue ? FromDegreesCelsiusDelta(degreescelsiusdelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesDelisle. /// @@ -89,15 +80,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesDelisleDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesDelisleDelta(QuantityValue? degreesdelisledelta) - { - return degreesdelisledelta.HasValue ? FromDegreesDelisleDelta(degreesdelisledelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesFahrenheit. /// @@ -107,15 +89,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesFahrenheitDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesFahrenheitDelta(QuantityValue? degreesfahrenheitdelta) - { - return degreesfahrenheitdelta.HasValue ? FromDegreesFahrenheitDelta(degreesfahrenheitdelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesNewton. /// @@ -125,15 +98,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesNewtonDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesNewtonDelta(QuantityValue? degreesnewtondelta) - { - return degreesnewtondelta.HasValue ? FromDegreesNewtonDelta(degreesnewtondelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesRankine. /// @@ -143,15 +107,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesRankineDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRankineDelta(QuantityValue? degreesrankinedelta) - { - return degreesrankinedelta.HasValue ? FromDegreesRankineDelta(degreesrankinedelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesReaumur. /// @@ -161,15 +116,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesReaumurDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesReaumurDelta(QuantityValue? degreesreaumurdelta) - { - return degreesreaumurdelta.HasValue ? FromDegreesReaumurDelta(degreesreaumurdelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable DegreesRoemer. /// @@ -179,15 +125,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable DegreesRoemerDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRoemerDelta(QuantityValue? degreesroemerdelta) - { - return degreesroemerdelta.HasValue ? FromDegreesRoemerDelta(degreesroemerdelta.Value) : default(TemperatureDelta?); - } - /// /// Get nullable TemperatureDelta from nullable Kelvins. /// @@ -197,15 +134,6 @@ public partial struct TemperatureDelta : IComparable, IComparable - /// Get nullable TemperatureDelta from nullable KelvinsDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromKelvinsDelta(QuantityValue? kelvinsdelta) - { - return kelvinsdelta.HasValue ? FromKelvinsDelta(kelvinsdelta.Value) : default(TemperatureDelta?); - } - /// /// Dynamically convert from value and unit enum to . /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 17ec35b34f..777dd16aea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -350,24 +350,6 @@ public partial struct Volume : IComparable, IComparable return oilbarrels.HasValue ? FromOilBarrels(oilbarrels.Value) : default(Volume?); } - /// - /// Get nullable Volume from nullable Tablespoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromTablespoons(QuantityValue? tablespoons) - { - return tablespoons.HasValue ? FromTablespoons(tablespoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Teaspoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromTeaspoons(QuantityValue? teaspoons) - { - return teaspoons.HasValue ? FromTeaspoons(teaspoons.Value) : default(Volume?); - } - /// /// Get nullable Volume from nullable UkTablespoons. /// diff --git a/UnitsNet/GeneratedCode/QuantityType.g.cs b/UnitsNet/GeneratedCode/QuantityType.g.cs index cb098ee0bf..932cce055f 100644 --- a/UnitsNet/GeneratedCode/QuantityType.g.cs +++ b/UnitsNet/GeneratedCode/QuantityType.g.cs @@ -81,7 +81,6 @@ public enum QuantityType ElectricResistivity, Energy, Entropy, - Flow, Force, ForceChangeRate, ForcePerLength, diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs index b1bb2a1d23..e8d6492a90 100644 --- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs +++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs @@ -861,12 +861,6 @@ private static readonly ReadOnlyCollection DefaultLocalization new AbbreviationsForCulture("en-US", "m", "min", "minute", "minutes"), new AbbreviationsForCulture("ru-RU", "мин"), }), - new CulturesForEnumValue((int) DurationUnit.Month, - new[] - { - new AbbreviationsForCulture("en-US", "mo", "month", "months"), - new AbbreviationsForCulture("ru-RU", "месяц"), - }), new CulturesForEnumValue((int) DurationUnit.Month30, new[] { @@ -891,12 +885,6 @@ private static readonly ReadOnlyCollection DefaultLocalization new AbbreviationsForCulture("en-US", "wk", "week", "weeks"), new AbbreviationsForCulture("ru-RU", "мин"), }), - new CulturesForEnumValue((int) DurationUnit.Year, - new[] - { - new AbbreviationsForCulture("en-US", "yr", "year", "years"), - new AbbreviationsForCulture("ru-RU", "год"), - }), new CulturesForEnumValue((int) DurationUnit.Year365, new[] { @@ -1391,134 +1379,6 @@ private static readonly ReadOnlyCollection DefaultLocalization new AbbreviationsForCulture("en-US", "MJ/K"), }), }), - new UnitLocalization(typeof (FlowUnit), - new[] - { - new CulturesForEnumValue((int) FlowUnit.CentilitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "cLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicDecimeterPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "dm³/min"), - new AbbreviationsForCulture("ru-RU", "дм³/мин"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicFootPerHour, - new[] - { - new AbbreviationsForCulture("en-US", "ft³/h", "cf/hr"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicFootPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "ft³/min"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicFootPerSecond, - new[] - { - new AbbreviationsForCulture("en-US", "ft³/s"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicMeterPerHour, - new[] - { - new AbbreviationsForCulture("en-US", "m³/h"), - new AbbreviationsForCulture("ru-RU", "м³/ч"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicMeterPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "m³/min"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicMeterPerSecond, - new[] - { - new AbbreviationsForCulture("en-US", "m³/s"), - new AbbreviationsForCulture("ru-RU", "м³/с"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicYardPerHour, - new[] - { - new AbbreviationsForCulture("en-US", "yd³/h"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicYardPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "yd³/min"), - }), - new CulturesForEnumValue((int) FlowUnit.CubicYardPerSecond, - new[] - { - new AbbreviationsForCulture("en-US", "yd³/s"), - }), - new CulturesForEnumValue((int) FlowUnit.DecilitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "dLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.KilolitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "kLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.LitersPerHour, - new[] - { - new AbbreviationsForCulture("en-US", "LPH"), - new AbbreviationsForCulture("ru-RU", "л/ч"), - }), - new CulturesForEnumValue((int) FlowUnit.LitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "LPM"), - }), - new CulturesForEnumValue((int) FlowUnit.LitersPerSecond, - new[] - { - new AbbreviationsForCulture("en-US", "LPS"), - }), - new CulturesForEnumValue((int) FlowUnit.MicrolitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "µLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.MillilitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "mLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.MillionUsGallonsPerDay, - new[] - { - new AbbreviationsForCulture("en-US", "MGD"), - }), - new CulturesForEnumValue((int) FlowUnit.NanolitersPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "nLPM"), - }), - new CulturesForEnumValue((int) FlowUnit.OilBarrelsPerDay, - new[] - { - new AbbreviationsForCulture("en-US", "bbl/d", "BOPD"), - }), - new CulturesForEnumValue((int) FlowUnit.UsGallonsPerHour, - new[] - { - new AbbreviationsForCulture("en-US", "gal (U.S.)/h"), - }), - new CulturesForEnumValue((int) FlowUnit.UsGallonsPerMinute, - new[] - { - new AbbreviationsForCulture("en-US", "gal (U.S.)/min", "GPM"), - }), - new CulturesForEnumValue((int) FlowUnit.UsGallonsPerSecond, - new[] - { - new AbbreviationsForCulture("en-US", "gal (U.S.)/s"), - }), - }), new UnitLocalization(typeof (ForceUnit), new[] { @@ -3351,12 +3211,6 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "psi", "lb/in²"), }), - new CulturesForEnumValue((int) PressureUnit.Psi, - new[] - { - new AbbreviationsForCulture("en-US", "psi"), - new AbbreviationsForCulture("ru-RU", "psi"), - }), new CulturesForEnumValue((int) PressureUnit.TechnicalAtmosphere, new[] { @@ -4098,81 +3952,41 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "∆°C"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeCelsiusDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°C"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeDelisle, new[] { new AbbreviationsForCulture("en-US", "∆°De"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeDelisleDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°De"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeFahrenheit, new[] { new AbbreviationsForCulture("en-US", "∆°F"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeFahrenheitDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°F"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeNewton, new[] { new AbbreviationsForCulture("en-US", "∆°N"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeNewtonDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°N"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeRankine, new[] { new AbbreviationsForCulture("en-US", "∆°R"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeRankineDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°R"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeReaumur, new[] { new AbbreviationsForCulture("en-US", "∆°Ré"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeReaumurDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°Ré"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeRoemer, new[] { new AbbreviationsForCulture("en-US", "∆°Rø"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.DegreeRoemerDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆°Rø"), - }), new CulturesForEnumValue((int) TemperatureDeltaUnit.Kelvin, new[] { new AbbreviationsForCulture("en-US", "∆K"), }), - new CulturesForEnumValue((int) TemperatureDeltaUnit.KelvinDelta, - new[] - { - new AbbreviationsForCulture("en-US", "∆K"), - }), }), new UnitLocalization(typeof (ThermalConductivityUnit), new[] @@ -4532,20 +4346,6 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "bbl"), }), - new CulturesForEnumValue((int) VolumeUnit.Tablespoon, - new[] - { - new AbbreviationsForCulture("en-US", "Tbsp", "Tbs", "T", "tb", "tbs", "tbsp", "tblsp", "tblspn", "Tbsp.", "Tbs.", "T.", "tb.", "tbs.", "tbsp.", "tblsp.", "tblspn.", "tablespoon", "Tablespoon"), - new AbbreviationsForCulture("ru-RU", "столовая ложка"), - new AbbreviationsForCulture("nb-NO", "ss", "ss.", "SS", "SS."), - }), - new CulturesForEnumValue((int) VolumeUnit.Teaspoon, - new[] - { - new AbbreviationsForCulture("en-US", "tsp", "t", "ts", "tspn", "t.", "ts.", "tsp.", "tspn.", "teaspoon"), - new AbbreviationsForCulture("ru-RU", "чайная ложка"), - new AbbreviationsForCulture("nb-NO", "ts", "ts."), - }), new CulturesForEnumValue((int) VolumeUnit.UkTablespoon, new[] { diff --git a/UnitsNet/GeneratedCode/Units/DurationUnit.g.cs b/UnitsNet/GeneratedCode/Units/DurationUnit.g.cs index 5ac31e5143..8131bbf267 100644 --- a/UnitsNet/GeneratedCode/Units/DurationUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/DurationUnit.g.cs @@ -50,14 +50,10 @@ public enum DurationUnit Microsecond, Millisecond, Minute, - [System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")] - Month, Month30, Nanosecond, Second, Week, - [System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")] - Year, Year365, } diff --git a/UnitsNet/GeneratedCode/Units/FlowUnit.g.cs b/UnitsNet/GeneratedCode/Units/FlowUnit.g.cs deleted file mode 100644 index 1cf0e5b07c..0000000000 --- a/UnitsNet/GeneratedCode/Units/FlowUnit.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior. -// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.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 FlowUnit - { - Undefined = 0, - CentilitersPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicDecimeterPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicFootPerHour, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicFootPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicFootPerSecond, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicMeterPerHour, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicMeterPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicMeterPerSecond, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicYardPerHour, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicYardPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - CubicYardPerSecond, - DecilitersPerMinute, - KilolitersPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - LitersPerHour, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - LitersPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - LitersPerSecond, - MicrolitersPerMinute, - MillilitersPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - MillionUsGallonsPerDay, - NanolitersPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - OilBarrelsPerDay, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - UsGallonsPerHour, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - UsGallonsPerMinute, - [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] - UsGallonsPerSecond, - } - - #pragma warning restore 1591 -} diff --git a/UnitsNet/GeneratedCode/Units/PressureUnit.g.cs b/UnitsNet/GeneratedCode/Units/PressureUnit.g.cs index dd3633fc11..4077f28533 100644 --- a/UnitsNet/GeneratedCode/Units/PressureUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/PressureUnit.g.cs @@ -77,8 +77,6 @@ public enum PressureUnit Pascal, PoundForcePerSquareFoot, PoundForcePerSquareInch, - [System.Obsolete("Deprecated due to github issue #215, please use PoundForcePerSquareInch instead")] - Psi, TechnicalAtmosphere, TonneForcePerSquareCentimeter, TonneForcePerSquareMeter, diff --git a/UnitsNet/GeneratedCode/Units/TemperatureDeltaUnit.g.cs b/UnitsNet/GeneratedCode/Units/TemperatureDeltaUnit.g.cs index 20841be3dd..ef6299db7d 100644 --- a/UnitsNet/GeneratedCode/Units/TemperatureDeltaUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/TemperatureDeltaUnit.g.cs @@ -46,29 +46,13 @@ public enum TemperatureDeltaUnit { Undefined = 0, DegreeCelsius, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeCelsius instead")] - DegreeCelsiusDelta, DegreeDelisle, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeDelisle instead")] - DegreeDelisleDelta, DegreeFahrenheit, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeFahrenheit instead")] - DegreeFahrenheitDelta, DegreeNewton, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeNewton instead")] - DegreeNewtonDelta, DegreeRankine, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRankine instead")] - DegreeRankineDelta, DegreeReaumur, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeReaumur instead")] - DegreeReaumurDelta, DegreeRoemer, - [System.Obsolete("Deprecated due to github issue #180, please use DegreeRoemer instead")] - DegreeRoemerDelta, Kelvin, - [System.Obsolete("Deprecated due to github issue #180, please use Kelvin instead")] - KelvinDelta, } #pragma warning restore 1591 diff --git a/UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs b/UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs index 1dc0bbadc4..100a3162f3 100644 --- a/UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/VolumeUnit.g.cs @@ -77,10 +77,6 @@ public enum VolumeUnit Microliter, Milliliter, OilBarrel, - [System.Obsolete("Deprecated due to github issue #134, please use UsTablespoon instead")] - Tablespoon, - [System.Obsolete("Deprecated due to github issue #134, please use UsTeaspoon instead")] - Teaspoon, UkTablespoon, UsBeerBarrel, UsCustomaryCup, From 6752b26c9a381751c92ab64e7ae5ceeb2ec37252 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 27 Sep 2018 16:06:46 -0400 Subject: [PATCH 2/5] Removing equality methods/operators that do not accept a relative/absolute equality check. --- .../Quantities/Acceleration.Common.g.cs | 24 ------------------- .../Quantities/AmountOfSubstance.Common.g.cs | 24 ------------------- .../Quantities/AmplitudeRatio.Common.g.cs | 24 ------------------- .../Quantities/Angle.Common.g.cs | 24 ------------------- .../Quantities/ApparentEnergy.Common.g.cs | 24 ------------------- .../Quantities/ApparentPower.Common.g.cs | 24 ------------------- .../GeneratedCode/Quantities/Area.Common.g.cs | 24 ------------------- .../Quantities/AreaDensity.Common.g.cs | 24 ------------------- .../AreaMomentOfInertia.Common.g.cs | 24 ------------------- .../Quantities/BitRate.Common.g.cs | 23 ------------------ .../BrakeSpecificFuelConsumption.Common.g.cs | 24 ------------------- .../Quantities/Capacitance.Common.g.cs | 24 ------------------- .../Quantities/Density.Common.g.cs | 24 ------------------- .../Quantities/Duration.Common.g.cs | 24 ------------------- .../Quantities/DynamicViscosity.Common.g.cs | 24 ------------------- .../Quantities/ElectricAdmittance.Common.g.cs | 24 ------------------- .../Quantities/ElectricCharge.Common.g.cs | 24 ------------------- .../ElectricChargeDensity.Common.g.cs | 24 ------------------- .../ElectricConductance.Common.g.cs | 24 ------------------- .../ElectricConductivity.Common.g.cs | 24 ------------------- .../Quantities/ElectricCurrent.Common.g.cs | 24 ------------------- .../ElectricCurrentDensity.Common.g.cs | 24 ------------------- .../ElectricCurrentGradient.Common.g.cs | 24 ------------------- .../Quantities/ElectricField.Common.g.cs | 24 ------------------- .../Quantities/ElectricInductance.Common.g.cs | 24 ------------------- .../Quantities/ElectricPotential.Common.g.cs | 24 ------------------- .../ElectricPotentialAc.Common.g.cs | 24 ------------------- .../ElectricPotentialDc.Common.g.cs | 24 ------------------- .../Quantities/ElectricResistance.Common.g.cs | 24 ------------------- .../ElectricResistivity.Common.g.cs | 24 ------------------- .../Quantities/Energy.Common.g.cs | 24 ------------------- .../Quantities/Entropy.Common.g.cs | 24 ------------------- .../GeneratedCode/Quantities/Flow.Common.g.cs | 24 ------------------- .../Quantities/Force.Common.g.cs | 24 ------------------- .../Quantities/ForceChangeRate.Common.g.cs | 24 ------------------- .../Quantities/ForcePerLength.Common.g.cs | 24 ------------------- .../Quantities/Frequency.Common.g.cs | 24 ------------------- .../Quantities/HeatFlux.Common.g.cs | 24 ------------------- .../HeatTransferCoefficient.Common.g.cs | 24 ------------------- .../Quantities/Illuminance.Common.g.cs | 24 ------------------- .../Quantities/Information.Common.g.cs | 23 ------------------ .../Quantities/Irradiance.Common.g.cs | 24 ------------------- .../Quantities/Irradiation.Common.g.cs | 24 ------------------- .../Quantities/KinematicViscosity.Common.g.cs | 24 ------------------- .../Quantities/LapseRate.Common.g.cs | 24 ------------------- .../Quantities/Length.Common.g.cs | 24 ------------------- .../Quantities/Level.Common.g.cs | 24 ------------------- .../Quantities/LinearDensity.Common.g.cs | 24 ------------------- .../Quantities/LuminousFlux.Common.g.cs | 24 ------------------- .../Quantities/LuminousIntensity.Common.g.cs | 24 ------------------- .../Quantities/MagneticField.Common.g.cs | 24 ------------------- .../Quantities/MagneticFlux.Common.g.cs | 24 ------------------- .../Quantities/Magnetization.Common.g.cs | 24 ------------------- .../GeneratedCode/Quantities/Mass.Common.g.cs | 24 ------------------- .../Quantities/MassFlow.Common.g.cs | 24 ------------------- .../Quantities/MassFlux.Common.g.cs | 24 ------------------- .../MassMomentOfInertia.Common.g.cs | 24 ------------------- .../Quantities/MolarEnergy.Common.g.cs | 24 ------------------- .../Quantities/MolarEntropy.Common.g.cs | 24 ------------------- .../Quantities/MolarMass.Common.g.cs | 24 ------------------- .../Quantities/Molarity.Common.g.cs | 24 ------------------- .../Quantities/Permeability.Common.g.cs | 24 ------------------- .../Quantities/Permittivity.Common.g.cs | 24 ------------------- .../Quantities/Power.Common.g.cs | 23 ------------------ .../Quantities/PowerDensity.Common.g.cs | 24 ------------------- .../Quantities/PowerRatio.Common.g.cs | 24 ------------------- .../Quantities/Pressure.Common.g.cs | 24 ------------------- .../Quantities/PressureChangeRate.Common.g.cs | 24 ------------------- .../Quantities/Ratio.Common.g.cs | 24 ------------------- .../Quantities/ReactiveEnergy.Common.g.cs | 24 ------------------- .../Quantities/ReactivePower.Common.g.cs | 24 ------------------- .../RotationalAcceleration.Common.g.cs | 24 ------------------- .../Quantities/RotationalSpeed.Common.g.cs | 24 ------------------- .../RotationalStiffness.Common.g.cs | 24 ------------------- .../RotationalStiffnessPerLength.Common.g.cs | 24 ------------------- .../Quantities/SolidAngle.Common.g.cs | 24 ------------------- .../Quantities/SpecificEnergy.Common.g.cs | 24 ------------------- .../Quantities/SpecificEntropy.Common.g.cs | 24 ------------------- .../Quantities/SpecificVolume.Common.g.cs | 24 ------------------- .../Quantities/SpecificWeight.Common.g.cs | 24 ------------------- .../Quantities/Speed.Common.g.cs | 24 ------------------- .../Quantities/Temperature.Common.g.cs | 24 ------------------- .../TemperatureChangeRate.Common.g.cs | 24 ------------------- .../Quantities/TemperatureDelta.Common.g.cs | 24 ------------------- .../ThermalConductivity.Common.g.cs | 24 ------------------- .../Quantities/ThermalResistance.Common.g.cs | 24 ------------------- .../Quantities/Torque.Common.g.cs | 24 ------------------- .../Quantities/VitaminA.Common.g.cs | 24 ------------------- .../Quantities/Volume.Common.g.cs | 24 ------------------- .../Quantities/VolumeFlow.Common.g.cs | 24 ------------------- .../GeneratedCode/AccelerationTestsBase.g.cs | 20 ++-------------- .../AmountOfSubstanceTestsBase.g.cs | 20 ++-------------- .../AmplitudeRatioTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/AngleTestsBase.g.cs | 20 ++-------------- .../ApparentEnergyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/ApparentPowerTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/AreaDensityTestsBase.g.cs | 20 ++-------------- .../AreaMomentOfInertiaTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/AreaTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/BitRateTestsBase.g.cs | 20 ++-------------- ...BrakeSpecificFuelConsumptionTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/CapacitanceTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/DensityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/DurationTestsBase.g.cs | 20 ++-------------- .../DynamicViscosityTestsBase.g.cs | 20 ++-------------- .../ElectricAdmittanceTestsBase.g.cs | 20 ++-------------- .../ElectricChargeDensityTestsBase.g.cs | 20 ++-------------- .../ElectricChargeTestsBase.g.cs | 20 ++-------------- .../ElectricConductanceTestsBase.g.cs | 20 ++-------------- .../ElectricConductivityTestsBase.g.cs | 20 ++-------------- .../ElectricCurrentDensityTestsBase.g.cs | 20 ++-------------- .../ElectricCurrentGradientTestsBase.g.cs | 20 ++-------------- .../ElectricCurrentTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/ElectricFieldTestsBase.g.cs | 20 ++-------------- .../ElectricInductanceTestsBase.g.cs | 20 ++-------------- .../ElectricPotentialAcTestsBase.g.cs | 20 ++-------------- .../ElectricPotentialDcTestsBase.g.cs | 20 ++-------------- .../ElectricPotentialTestsBase.g.cs | 20 ++-------------- .../ElectricResistanceTestsBase.g.cs | 20 ++-------------- .../ElectricResistivityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/EnergyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/EntropyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/FlowTestsBase.g.cs | 20 ++-------------- .../ForceChangeRateTestsBase.g.cs | 20 ++-------------- .../ForcePerLengthTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/ForceTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/FrequencyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/HeatFluxTestsBase.g.cs | 20 ++-------------- .../HeatTransferCoefficientTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/IlluminanceTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/InformationTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/IrradianceTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/IrradiationTestsBase.g.cs | 20 ++-------------- .../KinematicViscosityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/LapseRateTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/LengthTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/LevelTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/LinearDensityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/LuminousFluxTestsBase.g.cs | 20 ++-------------- .../LuminousIntensityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MagneticFieldTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MagneticFluxTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MagnetizationTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MassFlowTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MassFluxTestsBase.g.cs | 20 ++-------------- .../MassMomentOfInertiaTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MassTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MolarEnergyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MolarEntropyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MolarMassTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/MolarityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PermeabilityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PermittivityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PowerDensityTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PowerRatioTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PowerTestsBase.g.cs | 20 ++-------------- .../PressureChangeRateTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/PressureTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/RatioTestsBase.g.cs | 20 ++-------------- .../ReactiveEnergyTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/ReactivePowerTestsBase.g.cs | 20 ++-------------- .../RotationalAccelerationTestsBase.g.cs | 20 ++-------------- .../RotationalSpeedTestsBase.g.cs | 20 ++-------------- ...RotationalStiffnessPerLengthTestsBase.g.cs | 20 ++-------------- .../RotationalStiffnessTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/SolidAngleTestsBase.g.cs | 20 ++-------------- .../SpecificEnergyTestsBase.g.cs | 20 ++-------------- .../SpecificEntropyTestsBase.g.cs | 20 ++-------------- .../SpecificVolumeTestsBase.g.cs | 20 ++-------------- .../SpecificWeightTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/SpeedTestsBase.g.cs | 20 ++-------------- .../TemperatureChangeRateTestsBase.g.cs | 20 ++-------------- .../TemperatureDeltaTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/TemperatureTestsBase.g.cs | 20 ++-------------- .../ThermalConductivityTestsBase.g.cs | 20 ++-------------- .../ThermalResistanceTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/TorqueTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/VitaminATestsBase.g.cs | 20 ++-------------- .../GeneratedCode/VolumeFlowTestsBase.g.cs | 20 ++-------------- .../GeneratedCode/VolumeTestsBase.g.cs | 20 ++-------------- UnitsNet.Tests/GeneratedQuantityCodeTests.cs | 13 +++++----- .../Quantities/Acceleration.NetFramework.g.cs | 14 ----------- .../AmountOfSubstance.NetFramework.g.cs | 14 ----------- .../AmplitudeRatio.NetFramework.g.cs | 14 ----------- .../Quantities/Angle.NetFramework.g.cs | 14 ----------- .../ApparentEnergy.NetFramework.g.cs | 14 ----------- .../ApparentPower.NetFramework.g.cs | 14 ----------- .../Quantities/Area.NetFramework.g.cs | 14 ----------- .../Quantities/AreaDensity.NetFramework.g.cs | 14 ----------- .../AreaMomentOfInertia.NetFramework.g.cs | 14 ----------- .../Quantities/BitRate.NetFramework.g.cs | 12 ---------- ...eSpecificFuelConsumption.NetFramework.g.cs | 14 ----------- .../Quantities/Capacitance.NetFramework.g.cs | 14 ----------- .../Quantities/Density.NetFramework.g.cs | 14 ----------- .../Quantities/Duration.NetFramework.g.cs | 14 ----------- .../DynamicViscosity.NetFramework.g.cs | 14 ----------- .../ElectricAdmittance.NetFramework.g.cs | 14 ----------- .../ElectricCharge.NetFramework.g.cs | 14 ----------- .../ElectricChargeDensity.NetFramework.g.cs | 14 ----------- .../ElectricConductance.NetFramework.g.cs | 14 ----------- .../ElectricConductivity.NetFramework.g.cs | 14 ----------- .../ElectricCurrent.NetFramework.g.cs | 14 ----------- .../ElectricCurrentDensity.NetFramework.g.cs | 14 ----------- .../ElectricCurrentGradient.NetFramework.g.cs | 14 ----------- .../ElectricField.NetFramework.g.cs | 14 ----------- .../ElectricInductance.NetFramework.g.cs | 14 ----------- .../ElectricPotential.NetFramework.g.cs | 14 ----------- .../ElectricPotentialAc.NetFramework.g.cs | 14 ----------- .../ElectricPotentialDc.NetFramework.g.cs | 14 ----------- .../ElectricResistance.NetFramework.g.cs | 14 ----------- .../ElectricResistivity.NetFramework.g.cs | 14 ----------- .../Quantities/Energy.NetFramework.g.cs | 14 ----------- .../Quantities/Entropy.NetFramework.g.cs | 14 ----------- .../Quantities/Flow.NetFramework.g.cs | 14 ----------- .../Quantities/Force.NetFramework.g.cs | 14 ----------- .../ForceChangeRate.NetFramework.g.cs | 14 ----------- .../ForcePerLength.NetFramework.g.cs | 14 ----------- .../Quantities/Frequency.NetFramework.g.cs | 14 ----------- .../Quantities/HeatFlux.NetFramework.g.cs | 14 ----------- .../HeatTransferCoefficient.NetFramework.g.cs | 14 ----------- .../Quantities/Illuminance.NetFramework.g.cs | 14 ----------- .../Quantities/Information.NetFramework.g.cs | 12 ---------- .../Quantities/Irradiance.NetFramework.g.cs | 14 ----------- .../Quantities/Irradiation.NetFramework.g.cs | 14 ----------- .../KinematicViscosity.NetFramework.g.cs | 14 ----------- .../Quantities/LapseRate.NetFramework.g.cs | 14 ----------- .../Quantities/Length.NetFramework.g.cs | 14 ----------- .../Quantities/Level.NetFramework.g.cs | 14 ----------- .../LinearDensity.NetFramework.g.cs | 14 ----------- .../Quantities/LuminousFlux.NetFramework.g.cs | 14 ----------- .../LuminousIntensity.NetFramework.g.cs | 14 ----------- .../MagneticField.NetFramework.g.cs | 14 ----------- .../Quantities/MagneticFlux.NetFramework.g.cs | 14 ----------- .../Magnetization.NetFramework.g.cs | 14 ----------- .../Quantities/Mass.NetFramework.g.cs | 14 ----------- .../Quantities/MassFlow.NetFramework.g.cs | 14 ----------- .../Quantities/MassFlux.NetFramework.g.cs | 14 ----------- .../MassMomentOfInertia.NetFramework.g.cs | 14 ----------- .../Quantities/MolarEnergy.NetFramework.g.cs | 14 ----------- .../Quantities/MolarEntropy.NetFramework.g.cs | 14 ----------- .../Quantities/MolarMass.NetFramework.g.cs | 14 ----------- .../Quantities/Molarity.NetFramework.g.cs | 14 ----------- .../Quantities/Permeability.NetFramework.g.cs | 14 ----------- .../Quantities/Permittivity.NetFramework.g.cs | 14 ----------- .../Quantities/Power.NetFramework.g.cs | 12 ---------- .../Quantities/PowerDensity.NetFramework.g.cs | 14 ----------- .../Quantities/PowerRatio.NetFramework.g.cs | 14 ----------- .../Quantities/Pressure.NetFramework.g.cs | 14 ----------- .../PressureChangeRate.NetFramework.g.cs | 14 ----------- .../Quantities/Ratio.NetFramework.g.cs | 14 ----------- .../ReactiveEnergy.NetFramework.g.cs | 14 ----------- .../ReactivePower.NetFramework.g.cs | 14 ----------- .../RotationalAcceleration.NetFramework.g.cs | 14 ----------- .../RotationalSpeed.NetFramework.g.cs | 14 ----------- .../RotationalStiffness.NetFramework.g.cs | 14 ----------- ...tionalStiffnessPerLength.NetFramework.g.cs | 14 ----------- .../Quantities/SolidAngle.NetFramework.g.cs | 14 ----------- .../SpecificEnergy.NetFramework.g.cs | 14 ----------- .../SpecificEntropy.NetFramework.g.cs | 14 ----------- .../SpecificVolume.NetFramework.g.cs | 14 ----------- .../SpecificWeight.NetFramework.g.cs | 14 ----------- .../Quantities/Speed.NetFramework.g.cs | 14 ----------- .../Quantities/Temperature.NetFramework.g.cs | 14 ----------- .../TemperatureChangeRate.NetFramework.g.cs | 14 ----------- .../TemperatureDelta.NetFramework.g.cs | 14 ----------- .../ThermalConductivity.NetFramework.g.cs | 14 ----------- .../ThermalResistance.NetFramework.g.cs | 14 ----------- .../Quantities/Torque.NetFramework.g.cs | 14 ----------- .../Quantities/VitaminA.NetFramework.g.cs | 14 ----------- .../Quantities/Volume.NetFramework.g.cs | 14 ----------- .../Quantities/VolumeFlow.NetFramework.g.cs | 14 ----------- ...clude-GenerateQuantitySourceCodeCommon.ps1 | 23 ------------------ ...GenerateQuantitySourceCodeNetFramework.ps1 | 12 ---------- ...de-GenerateUnitTestBaseClassSourceCode.ps1 | 20 ++-------------- 274 files changed, 189 insertions(+), 5090 deletions(-) diff --git a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs index 32ed95e2f8..7618439a36 100644 --- a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(Acceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Acceleration)) - return false; - - var objQuantity = (Acceleration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Acceleration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Acceleration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Acceleration other, Acceleration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs index e09c313bdc..87801e0450 100644 --- a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs @@ -488,16 +488,6 @@ int CompareTo(AmountOfSubstance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AmountOfSubstance)) - return false; - - var objQuantity = (AmountOfSubstance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. @@ -549,20 +539,6 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AmountOfSubstance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AmountOfSubstance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs index 8bb678bbd7..b4f5bea15a 100644 --- a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs @@ -297,16 +297,6 @@ int CompareTo(AmplitudeRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AmplitudeRatio)) - return false; - - var objQuantity = (AmplitudeRatio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. @@ -358,20 +348,6 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AmplitudeRatio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AmplitudeRatio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Angle.Common.g.cs b/Common/GeneratedCode/Quantities/Angle.Common.g.cs index 224eb7ae1d..87ac38f45f 100644 --- a/Common/GeneratedCode/Quantities/Angle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Angle.Common.g.cs @@ -487,16 +487,6 @@ int CompareTo(Angle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Angle)) - return false; - - var objQuantity = (Angle)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Angle within the given absolute or relative tolerance. @@ -548,20 +538,6 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Angle by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Angle, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Angle other, Angle maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs index b360e90d45..1f010471ec 100644 --- a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ApparentEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ApparentEnergy)) - return false; - - var objQuantity = (ApparentEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ApparentEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ApparentEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ApparentEnergy other, ApparentEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs index 20c782523c..0c1bf0f2b6 100644 --- a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ApparentPower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ApparentPower)) - return false; - - var objQuantity = (ApparentPower)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ApparentPower by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ApparentPower, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ApparentPower other, ApparentPower maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Area.Common.g.cs b/Common/GeneratedCode/Quantities/Area.Common.g.cs index cabdafbce9..083de4e91a 100644 --- a/Common/GeneratedCode/Quantities/Area.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Area.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(Area other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Area)) - return false; - - var objQuantity = (Area)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Area within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Area by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Area, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Area other, Area maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs index d016ade809..d5948045e0 100644 --- a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(AreaDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AreaDensity)) - return false; - - var objQuantity = (AreaDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AreaDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AreaDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AreaDensity other, AreaDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs index 1cee90c5dc..73aa0731ee 100644 --- a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs @@ -336,16 +336,6 @@ int CompareTo(AreaMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is AreaMomentOfInertia)) - return false; - - var objQuantity = (AreaMomentOfInertia)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. @@ -397,20 +387,6 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another AreaMomentOfInertia by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(AreaMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs index 7f7fb55004..ade3ac0f39 100644 --- a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs @@ -715,15 +715,6 @@ int CompareTo(BitRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is BitRate)) - return false; - - var objQuantity = (BitRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another BitRate within the given absolute or relative tolerance. @@ -775,20 +766,6 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another BitRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(BitRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(BitRate other, BitRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs index c762e6824c..bb650a987e 100644 --- a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(BrakeSpecificFuelConsumption other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is BrakeSpecificFuelConsumption)) - return false; - - var objQuantity = (BrakeSpecificFuelConsumption)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another BrakeSpecificFuelConsumption by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(BrakeSpecificFuelConsumption, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumption maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs index 97b3266b6b..830559f670 100644 --- a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Capacitance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Capacitance)) - return false; - - var objQuantity = (Capacitance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Capacitance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Capacitance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Capacitance other, Capacitance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Density.Common.g.cs b/Common/GeneratedCode/Quantities/Density.Common.g.cs index 23a093e167..dfe078ef1c 100644 --- a/Common/GeneratedCode/Quantities/Density.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Density.Common.g.cs @@ -944,16 +944,6 @@ int CompareTo(Density other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Density)) - return false; - - var objQuantity = (Density)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Density within the given absolute or relative tolerance. @@ -1005,20 +995,6 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Density by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Density, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Density other, Density maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Duration.Common.g.cs b/Common/GeneratedCode/Quantities/Duration.Common.g.cs index 58ea15708b..c881936bbe 100644 --- a/Common/GeneratedCode/Quantities/Duration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Duration.Common.g.cs @@ -454,16 +454,6 @@ int CompareTo(Duration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Duration)) - return false; - - var objQuantity = (Duration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Duration within the given absolute or relative tolerance. @@ -515,20 +505,6 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Duration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Duration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Duration other, Duration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs index 5f1007380f..fa2645cabb 100644 --- a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs @@ -336,16 +336,6 @@ int CompareTo(DynamicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is DynamicViscosity)) - return false; - - var objQuantity = (DynamicViscosity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. @@ -397,20 +387,6 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another DynamicViscosity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(DynamicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(DynamicViscosity other, DynamicViscosity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs index 4627181f9c..e2a8036f57 100644 --- a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricAdmittance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricAdmittance)) - return false; - - var objQuantity = (ElectricAdmittance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricAdmittance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricAdmittance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricAdmittance other, ElectricAdmittance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs index f011e1a311..9464bc59e4 100644 --- a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCharge other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCharge)) - return false; - - var objQuantity = (ElectricCharge)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCharge by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCharge, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCharge other, ElectricCharge maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs index 7e73beedd0..faa814abe8 100644 --- a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricChargeDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricChargeDensity)) - return false; - - var objQuantity = (ElectricChargeDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricChargeDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricChargeDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricChargeDensity other, ElectricChargeDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs index f3099fd9d3..58a0c1ea8f 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ElectricConductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricConductance)) - return false; - - var objQuantity = (ElectricConductance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricConductance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricConductance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricConductance other, ElectricConductance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs index 9487fe3df1..7240a0514e 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricConductivity)) - return false; - - var objQuantity = (ElectricConductivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricConductivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricConductivity other, ElectricConductivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs index 28fc1e4f78..3633dedb8b 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(ElectricCurrent other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrent)) - return false; - - var objQuantity = (ElectricCurrent)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrent by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrent, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrent other, ElectricCurrent maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs index 71a8cdcc34..06abed8ae5 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCurrentDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrentDensity)) - return false; - - var objQuantity = (ElectricCurrentDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrentDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrentDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrentDensity other, ElectricCurrentDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs index 3a777bb953..397a6d710e 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricCurrentGradient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricCurrentGradient)) - return false; - - var objQuantity = (ElectricCurrentGradient)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricCurrentGradient by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricCurrentGradient, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricCurrentGradient other, ElectricCurrentGradient maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs index 5f48bcba7a..a54ef6d65b 100644 --- a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricField)) - return false; - - var objQuantity = (ElectricField)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricField by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricField, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricField other, ElectricField maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs index dce93b68a0..9d39ac1ace 100644 --- a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(ElectricInductance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricInductance)) - return false; - - var objQuantity = (ElectricInductance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricInductance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricInductance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricInductance other, ElectricInductance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs index 8a90e4bc1f..9773cc9a38 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs @@ -317,16 +317,6 @@ int CompareTo(ElectricPotential other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotential)) - return false; - - var objQuantity = (ElectricPotential)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. @@ -378,20 +368,6 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotential by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotential, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotential other, ElectricPotential maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs index 452a3b6bab..1de05c17a4 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs @@ -316,16 +316,6 @@ int CompareTo(ElectricPotentialAc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotentialAc)) - return false; - - var objQuantity = (ElectricPotentialAc)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. @@ -377,20 +367,6 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotentialAc by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotentialAc, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotentialAc other, ElectricPotentialAc maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs index 7ad0595e08..bc0a23a4ee 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs @@ -316,16 +316,6 @@ int CompareTo(ElectricPotentialDc other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricPotentialDc)) - return false; - - var objQuantity = (ElectricPotentialDc)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. @@ -377,20 +367,6 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricPotentialDc by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricPotentialDc, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricPotentialDc other, ElectricPotentialDc maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs index 6985c1d234..65f6bbe0a9 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricResistance)) - return false; - - var objQuantity = (ElectricResistance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricResistance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricResistance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricResistance other, ElectricResistance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs index 6860758317..7bf7236425 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ElectricResistivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ElectricResistivity)) - return false; - - var objQuantity = (ElectricResistivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ElectricResistivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ElectricResistivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ElectricResistivity other, ElectricResistivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Energy.Common.g.cs b/Common/GeneratedCode/Quantities/Energy.Common.g.cs index 1d79af5c50..a06bafa83a 100644 --- a/Common/GeneratedCode/Quantities/Energy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Energy.Common.g.cs @@ -640,16 +640,6 @@ int CompareTo(Energy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Energy)) - return false; - - var objQuantity = (Energy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Energy within the given absolute or relative tolerance. @@ -701,20 +691,6 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Energy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Energy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Energy other, Energy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs index c5b077145d..2ef62b67d5 100644 --- a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs @@ -355,16 +355,6 @@ int CompareTo(Entropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Entropy)) - return false; - - var objQuantity = (Entropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Entropy within the given absolute or relative tolerance. @@ -416,20 +406,6 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Entropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Entropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Entropy other, Entropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Flow.Common.g.cs b/Common/GeneratedCode/Quantities/Flow.Common.g.cs index 92500edca9..c962748b8d 100644 --- a/Common/GeneratedCode/Quantities/Flow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Flow.Common.g.cs @@ -715,16 +715,6 @@ int CompareTo(Flow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Flow)) - return false; - - var objQuantity = (Flow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Flow within the given absolute or relative tolerance. @@ -776,20 +766,6 @@ public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Flow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Flow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Flow other, Flow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Force.Common.g.cs b/Common/GeneratedCode/Quantities/Force.Common.g.cs index 827cc1a107..d630d992e2 100644 --- a/Common/GeneratedCode/Quantities/Force.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Force.Common.g.cs @@ -412,16 +412,6 @@ int CompareTo(Force other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Force)) - return false; - - var objQuantity = (Force)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Force within the given absolute or relative tolerance. @@ -473,20 +463,6 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Force by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Force, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Force other, Force maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs index f3b7e04db9..a0abf55f95 100644 --- a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs @@ -431,16 +431,6 @@ int CompareTo(ForceChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ForceChangeRate)) - return false; - - var objQuantity = (ForceChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. @@ -492,20 +482,6 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ForceChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ForceChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ForceChangeRate other, ForceChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs index c60955e3c1..fb37493acd 100644 --- a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs @@ -393,16 +393,6 @@ int CompareTo(ForcePerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ForcePerLength)) - return false; - - var objQuantity = (ForcePerLength)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. @@ -454,20 +444,6 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ForcePerLength by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ForcePerLength, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ForcePerLength other, ForcePerLength maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs index 3814aaabb5..2de1c40d60 100644 --- a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Frequency other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Frequency)) - return false; - - var objQuantity = (Frequency)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Frequency within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Frequency by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Frequency, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Frequency other, Frequency maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs index af17a5b614..1e98dd0710 100644 --- a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs @@ -526,16 +526,6 @@ int CompareTo(HeatFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is HeatFlux)) - return false; - - var objQuantity = (HeatFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. @@ -587,20 +577,6 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another HeatFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(HeatFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(HeatFlux other, HeatFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs index 6c1e6e297b..f3e67e84d8 100644 --- a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(HeatTransferCoefficient other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is HeatTransferCoefficient)) - return false; - - var objQuantity = (HeatTransferCoefficient)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another HeatTransferCoefficient by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(HeatTransferCoefficient, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(HeatTransferCoefficient other, HeatTransferCoefficient maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs index abd8790909..eb57f3542e 100644 --- a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(Illuminance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Illuminance)) - return false; - - var objQuantity = (Illuminance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Illuminance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Illuminance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Illuminance other, Illuminance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Information.Common.g.cs b/Common/GeneratedCode/Quantities/Information.Common.g.cs index 9183d31d8f..2a368a9696 100644 --- a/Common/GeneratedCode/Quantities/Information.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Information.Common.g.cs @@ -715,15 +715,6 @@ int CompareTo(Information other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is Information)) - return false; - - var objQuantity = (Information)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Information within the given absolute or relative tolerance. @@ -775,20 +766,6 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Information by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Information, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Information other, Information maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs index 7f1b4252ad..1e02e27a79 100644 --- a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(Irradiance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Irradiance)) - return false; - - var objQuantity = (Irradiance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Irradiance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Irradiance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Irradiance other, Irradiance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs index 58db172b3f..c34d37be91 100644 --- a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(Irradiation other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Irradiation)) - return false; - - var objQuantity = (Irradiation)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Irradiation by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Irradiation, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Irradiation other, Irradiation maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs index fe75567216..3b050b5dfb 100644 --- a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(KinematicViscosity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is KinematicViscosity)) - return false; - - var objQuantity = (KinematicViscosity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another KinematicViscosity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(KinematicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(KinematicViscosity other, KinematicViscosity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs index 2c37adad8f..8b0a68cfa8 100644 --- a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LapseRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LapseRate)) - return false; - - var objQuantity = (LapseRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LapseRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LapseRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LapseRate other, LapseRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Length.Common.g.cs b/Common/GeneratedCode/Quantities/Length.Common.g.cs index 2e3d2a38d3..421b319095 100644 --- a/Common/GeneratedCode/Quantities/Length.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Length.Common.g.cs @@ -640,16 +640,6 @@ int CompareTo(Length other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Length)) - return false; - - var objQuantity = (Length)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Length within the given absolute or relative tolerance. @@ -701,20 +691,6 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Length by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Length, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Length other, Length maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Level.Common.g.cs b/Common/GeneratedCode/Quantities/Level.Common.g.cs index ad48a43d85..f8aa2f67f1 100644 --- a/Common/GeneratedCode/Quantities/Level.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Level.Common.g.cs @@ -259,16 +259,6 @@ int CompareTo(Level other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Level)) - return false; - - var objQuantity = (Level)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Level within the given absolute or relative tolerance. @@ -320,20 +310,6 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Level by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Level, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Level other, Level maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs index 4193003fb0..b88033a953 100644 --- a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(LinearDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LinearDensity)) - return false; - - var objQuantity = (LinearDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LinearDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LinearDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LinearDensity other, LinearDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs index a5b0e63900..69bec040a7 100644 --- a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LuminousFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LuminousFlux)) - return false; - - var objQuantity = (LuminousFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LuminousFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LuminousFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LuminousFlux other, LuminousFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs index b5fd94601d..36314d318a 100644 --- a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(LuminousIntensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is LuminousIntensity)) - return false; - - var objQuantity = (LuminousIntensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another LuminousIntensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(LuminousIntensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(LuminousIntensity other, LuminousIntensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs index b5f5d2dde5..7be8363c6c 100644 --- a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(MagneticField other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MagneticField)) - return false; - - var objQuantity = (MagneticField)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MagneticField by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MagneticField, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MagneticField other, MagneticField maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs index b09af34da0..60da01ca35 100644 --- a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(MagneticFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MagneticFlux)) - return false; - - var objQuantity = (MagneticFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MagneticFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MagneticFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MagneticFlux other, MagneticFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs index 0a04d5753e..f2b6b24a76 100644 --- a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Magnetization other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Magnetization)) - return false; - - var objQuantity = (Magnetization)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Magnetization by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Magnetization, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Magnetization other, Magnetization maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Mass.Common.g.cs b/Common/GeneratedCode/Quantities/Mass.Common.g.cs index 0e9f53d699..7f57cf1f55 100644 --- a/Common/GeneratedCode/Quantities/Mass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Mass.Common.g.cs @@ -621,16 +621,6 @@ int CompareTo(Mass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Mass)) - return false; - - var objQuantity = (Mass)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Mass within the given absolute or relative tolerance. @@ -682,20 +672,6 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Mass by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Mass, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Mass other, Mass maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs index c1f884aea2..cf8f9f038a 100644 --- a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs @@ -507,16 +507,6 @@ int CompareTo(MassFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassFlow)) - return false; - - var objQuantity = (MassFlow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. @@ -568,20 +558,6 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassFlow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassFlow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassFlow other, MassFlow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs index 12b507c25c..66b14d1c22 100644 --- a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(MassFlux other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassFlux)) - return false; - - var objQuantity = (MassFlux)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassFlux by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassFlux, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassFlux other, MassFlux maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs index 90e30652cb..ad89f69463 100644 --- a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs @@ -716,16 +716,6 @@ int CompareTo(MassMomentOfInertia other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MassMomentOfInertia)) - return false; - - var objQuantity = (MassMomentOfInertia)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. @@ -777,20 +767,6 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MassMomentOfInertia by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MassMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MassMomentOfInertia other, MassMomentOfInertia maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs index f4164e95c9..04824f0c43 100644 --- a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(MolarEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarEnergy)) - return false; - - var objQuantity = (MolarEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarEnergy other, MolarEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs index abb87a58f9..df7f68bbef 100644 --- a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(MolarEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarEntropy)) - return false; - - var objQuantity = (MolarEntropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarEntropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarEntropy other, MolarEntropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs index 6cbe02d28d..6a75f0bb95 100644 --- a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs @@ -450,16 +450,6 @@ int CompareTo(MolarMass other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is MolarMass)) - return false; - - var objQuantity = (MolarMass)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. @@ -511,20 +501,6 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another MolarMass by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(MolarMass, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(MolarMass other, MolarMass maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs index 19a4f20720..fd856010ee 100644 --- a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Molarity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Molarity)) - return false; - - var objQuantity = (Molarity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Molarity within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Molarity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Molarity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Molarity other, Molarity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs index 032dec27e5..2efe17735e 100644 --- a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Permeability other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Permeability)) - return false; - - var objQuantity = (Permeability)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Permeability within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Permeability by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Permeability, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Permeability other, Permeability maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs index a8a40f1c0a..30db6dcca2 100644 --- a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs @@ -241,16 +241,6 @@ int CompareTo(Permittivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Permittivity)) - return false; - - var objQuantity = (Permittivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. @@ -302,20 +292,6 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Permittivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Permittivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Permittivity other, Permittivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Power.Common.g.cs b/Common/GeneratedCode/Quantities/Power.Common.g.cs index ed9cbba62d..48b81568f3 100644 --- a/Common/GeneratedCode/Quantities/Power.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Power.Common.g.cs @@ -602,15 +602,6 @@ int CompareTo(Power other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - public override bool Equals(object obj) - { - if(obj is null || !(obj is Power)) - return false; - - var objQuantity = (Power)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Power within the given absolute or relative tolerance. @@ -662,20 +653,6 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Power by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Power, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Power other, Power maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs index 1acfabad4e..dd901c6004 100644 --- a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs @@ -1058,16 +1058,6 @@ int CompareTo(PowerDensity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PowerDensity)) - return false; - - var objQuantity = (PowerDensity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. @@ -1119,20 +1109,6 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PowerDensity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PowerDensity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PowerDensity other, PowerDensity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs index ab16e2fdc9..2937aa4cc9 100644 --- a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs @@ -259,16 +259,6 @@ int CompareTo(PowerRatio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PowerRatio)) - return false; - - var objQuantity = (PowerRatio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. @@ -320,20 +310,6 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PowerRatio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PowerRatio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PowerRatio other, PowerRatio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs index 26a39fe932..264db9c86c 100644 --- a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs @@ -946,16 +946,6 @@ int CompareTo(Pressure other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Pressure)) - return false; - - var objQuantity = (Pressure)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Pressure within the given absolute or relative tolerance. @@ -1007,20 +997,6 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Pressure by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Pressure, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Pressure other, Pressure maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs index 11c7fdc4a8..b95433a44e 100644 --- a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(PressureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is PressureChangeRate)) - return false; - - var objQuantity = (PressureChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another PressureChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(PressureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(PressureChangeRate other, PressureChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs index b3629babf9..255b7c181d 100644 --- a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs @@ -335,16 +335,6 @@ int CompareTo(Ratio other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Ratio)) - return false; - - var objQuantity = (Ratio)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Ratio within the given absolute or relative tolerance. @@ -396,20 +386,6 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Ratio by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Ratio, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Ratio other, Ratio maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs index fc1272c6f8..aa0db40964 100644 --- a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(ReactiveEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ReactiveEnergy)) - return false; - - var objQuantity = (ReactiveEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ReactiveEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ReactiveEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ReactiveEnergy other, ReactiveEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs index ba8679fd10..87de0e0958 100644 --- a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs @@ -298,16 +298,6 @@ int CompareTo(ReactivePower other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ReactivePower)) - return false; - - var objQuantity = (ReactivePower)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. @@ -359,20 +349,6 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ReactivePower by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ReactivePower, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ReactivePower other, ReactivePower maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs index 992d9acab6..93924c8645 100644 --- a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalAcceleration other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalAcceleration)) - return false; - - var objQuantity = (RotationalAcceleration)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalAcceleration by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalAcceleration, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalAcceleration other, RotationalAcceleration maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs index 430347c970..5643723cf3 100644 --- a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs @@ -469,16 +469,6 @@ int CompareTo(RotationalSpeed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalSpeed)) - return false; - - var objQuantity = (RotationalSpeed)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. @@ -530,20 +520,6 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalSpeed by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalSpeed, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalSpeed other, RotationalSpeed maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs index 5ec21ca384..69eab9468a 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalStiffness other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalStiffness)) - return false; - - var objQuantity = (RotationalStiffness)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalStiffness by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalStiffness, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalStiffness other, RotationalStiffness maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs index e994b6ed9b..737080f068 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs @@ -279,16 +279,6 @@ int CompareTo(RotationalStiffnessPerLength other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is RotationalStiffnessPerLength)) - return false; - - var objQuantity = (RotationalStiffnessPerLength)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. @@ -340,20 +330,6 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another RotationalStiffnessPerLength by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(RotationalStiffnessPerLength, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(RotationalStiffnessPerLength other, RotationalStiffnessPerLength maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs index 2f258256e0..c99667ae4b 100644 --- a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs @@ -240,16 +240,6 @@ int CompareTo(SolidAngle other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SolidAngle)) - return false; - - var objQuantity = (SolidAngle)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. @@ -301,20 +291,6 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SolidAngle by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SolidAngle, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SolidAngle other, SolidAngle maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs index 944ba7474b..4000d3e74f 100644 --- a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(SpecificEnergy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificEnergy)) - return false; - - var objQuantity = (SpecificEnergy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificEnergy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificEnergy other, SpecificEnergy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs index c31a618029..ab92be92c6 100644 --- a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(SpecificEntropy other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificEntropy)) - return false; - - var objQuantity = (SpecificEntropy)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificEntropy by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificEntropy other, SpecificEntropy maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs index 081afdbe8e..08d2504672 100644 --- a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(SpecificVolume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificVolume)) - return false; - - var objQuantity = (SpecificVolume)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificVolume by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificVolume, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificVolume other, SpecificVolume maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs index f3752b3ec5..ae08ee474a 100644 --- a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs @@ -545,16 +545,6 @@ int CompareTo(SpecificWeight other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is SpecificWeight)) - return false; - - var objQuantity = (SpecificWeight)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. @@ -606,20 +596,6 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another SpecificWeight by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(SpecificWeight, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(SpecificWeight other, SpecificWeight maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Speed.Common.g.cs b/Common/GeneratedCode/Quantities/Speed.Common.g.cs index 3bd6a717fd..d3504c1d30 100644 --- a/Common/GeneratedCode/Quantities/Speed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Speed.Common.g.cs @@ -830,16 +830,6 @@ int CompareTo(Speed other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Speed)) - return false; - - var objQuantity = (Speed)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Speed within the given absolute or relative tolerance. @@ -891,20 +881,6 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Speed by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Speed, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Speed other, Speed maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs index 3e5e6b2891..f332113b81 100644 --- a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs @@ -374,16 +374,6 @@ int CompareTo(Temperature other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Temperature)) - return false; - - var objQuantity = (Temperature)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Temperature within the given absolute or relative tolerance. @@ -435,20 +425,6 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Temperature by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Temperature, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Temperature other, Temperature maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs index 842e3a13bd..795ed4d603 100644 --- a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs @@ -412,16 +412,6 @@ int CompareTo(TemperatureChangeRate other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is TemperatureChangeRate)) - return false; - - var objQuantity = (TemperatureChangeRate)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. @@ -473,20 +463,6 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another TemperatureChangeRate by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(TemperatureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(TemperatureChangeRate other, TemperatureChangeRate maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs index f450738404..ba2df9fe97 100644 --- a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs @@ -541,16 +541,6 @@ int CompareTo(TemperatureDelta other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is TemperatureDelta)) - return false; - - var objQuantity = (TemperatureDelta)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. @@ -602,20 +592,6 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another TemperatureDelta by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(TemperatureDelta, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(TemperatureDelta other, TemperatureDelta maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs index 799d338c54..da68e4cdd8 100644 --- a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs @@ -260,16 +260,6 @@ int CompareTo(ThermalConductivity other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ThermalConductivity)) - return false; - - var objQuantity = (ThermalConductivity)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. @@ -321,20 +311,6 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ThermalConductivity by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ThermalConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ThermalConductivity other, ThermalConductivity maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs index 89f752dae9..a755023826 100644 --- a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs @@ -317,16 +317,6 @@ int CompareTo(ThermalResistance other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is ThermalResistance)) - return false; - - var objQuantity = (ThermalResistance)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. @@ -378,20 +368,6 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another ThermalResistance by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(ThermalResistance, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(ThermalResistance other, ThermalResistance maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Torque.Common.g.cs b/Common/GeneratedCode/Quantities/Torque.Common.g.cs index b81e935d7c..88a6fd4cf9 100644 --- a/Common/GeneratedCode/Quantities/Torque.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Torque.Common.g.cs @@ -621,16 +621,6 @@ int CompareTo(Torque other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Torque)) - return false; - - var objQuantity = (Torque)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Torque within the given absolute or relative tolerance. @@ -682,20 +672,6 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Torque by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Torque, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Torque other, Torque maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs index 5764238125..331c692468 100644 --- a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs @@ -240,16 +240,6 @@ int CompareTo(VitaminA other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is VitaminA)) - return false; - - var objQuantity = (VitaminA)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. @@ -301,20 +291,6 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another VitaminA by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(VitaminA, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(VitaminA other, VitaminA maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/Volume.Common.g.cs b/Common/GeneratedCode/Quantities/Volume.Common.g.cs index 7af8d0bd50..2f2fc68a08 100644 --- a/Common/GeneratedCode/Quantities/Volume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Volume.Common.g.cs @@ -1062,16 +1062,6 @@ int CompareTo(Volume other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is Volume)) - return false; - - var objQuantity = (Volume)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another Volume within the given absolute or relative tolerance. @@ -1123,20 +1113,6 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another Volume by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(Volume, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(Volume other, Volume maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs index 706449f20d..47e5cd648e 100644 --- a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs @@ -716,16 +716,6 @@ int CompareTo(VolumeFlow other) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] - public override bool Equals(object obj) - { - if(obj is null || !(obj is VolumeFlow)) - return false; - - var objQuantity = (VolumeFlow)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. @@ -777,20 +767,6 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another VolumeFlow by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals(VolumeFlow, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals(VolumeFlow other, VolumeFlow maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs index 6312872176..d5d8d54956 100644 --- a/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AccelerationTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meterpersecondsquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Acceleration a = Acceleration.FromMetersPerSecondSquared(1); - Acceleration b = Acceleration.FromMetersPerSecondSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Acceleration v = Acceleration.FromMetersPerSecondSquared(1); - Assert.True(v.Equals(Acceleration.FromMetersPerSecondSquared(1), Acceleration.FromMetersPerSecondSquared(MetersPerSecondSquaredTolerance))); - Assert.False(v.Equals(Acceleration.Zero, Acceleration.FromMetersPerSecondSquared(MetersPerSecondSquaredTolerance))); + Assert.True(v.Equals(Acceleration.FromMetersPerSecondSquared(1), MetersPerSecondSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Acceleration.Zero, MetersPerSecondSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs index ea9b263136..ad91ab381d 100644 --- a/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AmountOfSubstanceTestsBase.g.cs @@ -279,28 +279,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => mole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AmountOfSubstance a = AmountOfSubstance.FromMoles(1); - AmountOfSubstance b = AmountOfSubstance.FromMoles(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AmountOfSubstance v = AmountOfSubstance.FromMoles(1); - Assert.True(v.Equals(AmountOfSubstance.FromMoles(1), AmountOfSubstance.FromMoles(MolesTolerance))); - Assert.False(v.Equals(AmountOfSubstance.Zero, AmountOfSubstance.FromMoles(MolesTolerance))); + Assert.True(v.Equals(AmountOfSubstance.FromMoles(1), MolesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AmountOfSubstance.Zero, MolesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs index 5ef7153039..56400c05f3 100644 --- a/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AmplitudeRatioTestsBase.g.cs @@ -184,28 +184,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibelvolt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AmplitudeRatio a = AmplitudeRatio.FromDecibelVolts(1); - AmplitudeRatio b = AmplitudeRatio.FromDecibelVolts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AmplitudeRatio v = AmplitudeRatio.FromDecibelVolts(1); - Assert.True(v.Equals(AmplitudeRatio.FromDecibelVolts(1), AmplitudeRatio.FromDecibelVolts(DecibelVoltsTolerance))); - Assert.False(v.Equals(AmplitudeRatio.Zero, AmplitudeRatio.FromDecibelVolts(DecibelVoltsTolerance))); + Assert.True(v.Equals(AmplitudeRatio.FromDecibelVolts(1), DecibelVoltsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AmplitudeRatio.Zero, DecibelVoltsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs index 6589478a78..b024d92619 100644 --- a/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AngleTestsBase.g.cs @@ -279,28 +279,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degree.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Angle a = Angle.FromDegrees(1); - Angle b = Angle.FromDegrees(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Angle v = Angle.FromDegrees(1); - Assert.True(v.Equals(Angle.FromDegrees(1), Angle.FromDegrees(DegreesTolerance))); - Assert.False(v.Equals(Angle.Zero, Angle.FromDegrees(DegreesTolerance))); + Assert.True(v.Equals(Angle.FromDegrees(1), DegreesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Angle.Zero, DegreesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs index 7515f60b10..6fab19f62f 100644 --- a/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ApparentEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperehour.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ApparentEnergy a = ApparentEnergy.FromVoltampereHours(1); - ApparentEnergy b = ApparentEnergy.FromVoltampereHours(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ApparentEnergy v = ApparentEnergy.FromVoltampereHours(1); - Assert.True(v.Equals(ApparentEnergy.FromVoltampereHours(1), ApparentEnergy.FromVoltampereHours(VoltampereHoursTolerance))); - Assert.False(v.Equals(ApparentEnergy.Zero, ApparentEnergy.FromVoltampereHours(VoltampereHoursTolerance))); + Assert.True(v.Equals(ApparentEnergy.FromVoltampereHours(1), VoltampereHoursTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ApparentEnergy.Zero, VoltampereHoursTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs index 198401e9cd..91ad20b6c2 100644 --- a/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ApparentPowerTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltampere.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ApparentPower a = ApparentPower.FromVoltamperes(1); - ApparentPower b = ApparentPower.FromVoltamperes(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ApparentPower v = ApparentPower.FromVoltamperes(1); - Assert.True(v.Equals(ApparentPower.FromVoltamperes(1), ApparentPower.FromVoltamperes(VoltamperesTolerance))); - Assert.False(v.Equals(ApparentPower.Zero, ApparentPower.FromVoltamperes(VoltamperesTolerance))); + Assert.True(v.Equals(ApparentPower.FromVoltamperes(1), VoltamperesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ApparentPower.Zero, VoltamperesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs index bb580bc641..0d2dea3d1a 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AreaDensity a = AreaDensity.FromKilogramsPerSquareMeter(1); - AreaDensity b = AreaDensity.FromKilogramsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AreaDensity v = AreaDensity.FromKilogramsPerSquareMeter(1); - Assert.True(v.Equals(AreaDensity.FromKilogramsPerSquareMeter(1), AreaDensity.FromKilogramsPerSquareMeter(KilogramsPerSquareMeterTolerance))); - Assert.False(v.Equals(AreaDensity.Zero, AreaDensity.FromKilogramsPerSquareMeter(KilogramsPerSquareMeterTolerance))); + Assert.True(v.Equals(AreaDensity.FromKilogramsPerSquareMeter(1), KilogramsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AreaDensity.Zero, KilogramsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs index 0811084f53..95e82fc60a 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaMomentOfInertiaTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => metertothefourth.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - AreaMomentOfInertia a = AreaMomentOfInertia.FromMetersToTheFourth(1); - AreaMomentOfInertia b = AreaMomentOfInertia.FromMetersToTheFourth(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { AreaMomentOfInertia v = AreaMomentOfInertia.FromMetersToTheFourth(1); - Assert.True(v.Equals(AreaMomentOfInertia.FromMetersToTheFourth(1), AreaMomentOfInertia.FromMetersToTheFourth(MetersToTheFourthTolerance))); - Assert.False(v.Equals(AreaMomentOfInertia.Zero, AreaMomentOfInertia.FromMetersToTheFourth(MetersToTheFourthTolerance))); + Assert.True(v.Equals(AreaMomentOfInertia.FromMetersToTheFourth(1), MetersToTheFourthTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(AreaMomentOfInertia.Zero, MetersToTheFourthTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs index bc77c9e71f..fd609e9363 100644 --- a/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/AreaTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Area a = Area.FromSquareMeters(1); - Area b = Area.FromSquareMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Area v = Area.FromSquareMeters(1); - Assert.True(v.Equals(Area.FromSquareMeters(1), Area.FromSquareMeters(SquareMetersTolerance))); - Assert.False(v.Equals(Area.Zero, Area.FromSquareMeters(SquareMetersTolerance))); + Assert.True(v.Equals(Area.FromSquareMeters(1), SquareMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Area.Zero, SquareMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs index 6d249382a5..4ffd779db9 100644 --- a/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/BitRateTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => bitpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - BitRate a = BitRate.FromBitsPerSecond(1); - BitRate b = BitRate.FromBitsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { BitRate v = BitRate.FromBitsPerSecond(1); - Assert.True(v.Equals(BitRate.FromBitsPerSecond(1), BitRate.FromBitsPerSecond(BitsPerSecondTolerance))); - Assert.False(v.Equals(BitRate.Zero, BitRate.FromBitsPerSecond(BitsPerSecondTolerance))); + Assert.True(v.Equals(BitRate.FromBitsPerSecond(1), BitsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(BitRate.Zero, BitsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs index 04aa19ffc5..f6970db1c4 100644 --- a/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/BrakeSpecificFuelConsumptionTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogramperjoule.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - BrakeSpecificFuelConsumption a = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); - BrakeSpecificFuelConsumption b = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { BrakeSpecificFuelConsumption v = BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1); - Assert.True(v.Equals(BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1), BrakeSpecificFuelConsumption.FromKilogramsPerJoule(KilogramsPerJouleTolerance))); - Assert.False(v.Equals(BrakeSpecificFuelConsumption.Zero, BrakeSpecificFuelConsumption.FromKilogramsPerJoule(KilogramsPerJouleTolerance))); + Assert.True(v.Equals(BrakeSpecificFuelConsumption.FromKilogramsPerJoule(1), KilogramsPerJouleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(BrakeSpecificFuelConsumption.Zero, KilogramsPerJouleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs index 36e8413b89..bf1403edc7 100644 --- a/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/CapacitanceTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => farad.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Capacitance a = Capacitance.FromFarads(1); - Capacitance b = Capacitance.FromFarads(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Capacitance v = Capacitance.FromFarads(1); - Assert.True(v.Equals(Capacitance.FromFarads(1), Capacitance.FromFarads(FaradsTolerance))); - Assert.False(v.Equals(Capacitance.Zero, Capacitance.FromFarads(FaradsTolerance))); + Assert.True(v.Equals(Capacitance.FromFarads(1), FaradsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Capacitance.Zero, FaradsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs index 3a721ca51e..367edee704 100644 --- a/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DensityTestsBase.g.cs @@ -519,28 +519,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Density a = Density.FromKilogramsPerCubicMeter(1); - Density b = Density.FromKilogramsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Density v = Density.FromKilogramsPerCubicMeter(1); - Assert.True(v.Equals(Density.FromKilogramsPerCubicMeter(1), Density.FromKilogramsPerCubicMeter(KilogramsPerCubicMeterTolerance))); - Assert.False(v.Equals(Density.Zero, Density.FromKilogramsPerCubicMeter(KilogramsPerCubicMeterTolerance))); + Assert.True(v.Equals(Density.FromKilogramsPerCubicMeter(1), KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Density.Zero, KilogramsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs index 0c107c622b..46ffcb501f 100644 --- a/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DurationTestsBase.g.cs @@ -259,28 +259,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => second.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Duration a = Duration.FromSeconds(1); - Duration b = Duration.FromSeconds(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Duration v = Duration.FromSeconds(1); - Assert.True(v.Equals(Duration.FromSeconds(1), Duration.FromSeconds(SecondsTolerance))); - Assert.False(v.Equals(Duration.Zero, Duration.FromSeconds(SecondsTolerance))); + Assert.True(v.Equals(Duration.FromSeconds(1), SecondsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Duration.Zero, SecondsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs index fe80050f24..3d0034f8bd 100644 --- a/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/DynamicViscosityTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonsecondpermetersquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - DynamicViscosity a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); - DynamicViscosity b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { DynamicViscosity v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); - Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); - Assert.False(v.Equals(DynamicViscosity.Zero, DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); + Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(DynamicViscosity.Zero, NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs index 58097b5e01..52ce56c277 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricAdmittanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemens.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricAdmittance a = ElectricAdmittance.FromSiemens(1); - ElectricAdmittance b = ElectricAdmittance.FromSiemens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricAdmittance v = ElectricAdmittance.FromSiemens(1); - Assert.True(v.Equals(ElectricAdmittance.FromSiemens(1), ElectricAdmittance.FromSiemens(SiemensTolerance))); - Assert.False(v.Equals(ElectricAdmittance.Zero, ElectricAdmittance.FromSiemens(SiemensTolerance))); + Assert.True(v.Equals(ElectricAdmittance.FromSiemens(1), SiemensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricAdmittance.Zero, SiemensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs index 21589616fb..f8db7c5e41 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricChargeDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => coulombpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricChargeDensity a = ElectricChargeDensity.FromCoulombsPerCubicMeter(1); - ElectricChargeDensity b = ElectricChargeDensity.FromCoulombsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricChargeDensity v = ElectricChargeDensity.FromCoulombsPerCubicMeter(1); - Assert.True(v.Equals(ElectricChargeDensity.FromCoulombsPerCubicMeter(1), ElectricChargeDensity.FromCoulombsPerCubicMeter(CoulombsPerCubicMeterTolerance))); - Assert.False(v.Equals(ElectricChargeDensity.Zero, ElectricChargeDensity.FromCoulombsPerCubicMeter(CoulombsPerCubicMeterTolerance))); + Assert.True(v.Equals(ElectricChargeDensity.FromCoulombsPerCubicMeter(1), CoulombsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricChargeDensity.Zero, CoulombsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs index e867eb01ab..dca2f01ccc 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricChargeTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => coulomb.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCharge a = ElectricCharge.FromCoulombs(1); - ElectricCharge b = ElectricCharge.FromCoulombs(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCharge v = ElectricCharge.FromCoulombs(1); - Assert.True(v.Equals(ElectricCharge.FromCoulombs(1), ElectricCharge.FromCoulombs(CoulombsTolerance))); - Assert.False(v.Equals(ElectricCharge.Zero, ElectricCharge.FromCoulombs(CoulombsTolerance))); + Assert.True(v.Equals(ElectricCharge.FromCoulombs(1), CoulombsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCharge.Zero, CoulombsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs index e6e565c53f..dc0bf955c7 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricConductanceTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemens.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricConductance a = ElectricConductance.FromSiemens(1); - ElectricConductance b = ElectricConductance.FromSiemens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricConductance v = ElectricConductance.FromSiemens(1); - Assert.True(v.Equals(ElectricConductance.FromSiemens(1), ElectricConductance.FromSiemens(SiemensTolerance))); - Assert.False(v.Equals(ElectricConductance.Zero, ElectricConductance.FromSiemens(SiemensTolerance))); + Assert.True(v.Equals(ElectricConductance.FromSiemens(1), SiemensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricConductance.Zero, SiemensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs index afa9552ae4..e2b68f3af9 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricConductivityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => siemenspermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricConductivity a = ElectricConductivity.FromSiemensPerMeter(1); - ElectricConductivity b = ElectricConductivity.FromSiemensPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricConductivity v = ElectricConductivity.FromSiemensPerMeter(1); - Assert.True(v.Equals(ElectricConductivity.FromSiemensPerMeter(1), ElectricConductivity.FromSiemensPerMeter(SiemensPerMeterTolerance))); - Assert.False(v.Equals(ElectricConductivity.Zero, ElectricConductivity.FromSiemensPerMeter(SiemensPerMeterTolerance))); + Assert.True(v.Equals(ElectricConductivity.FromSiemensPerMeter(1), SiemensPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricConductivity.Zero, SiemensPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs index 4f28d50282..ec9b3c9491 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentDensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrentDensity a = ElectricCurrentDensity.FromAmperesPerSquareMeter(1); - ElectricCurrentDensity b = ElectricCurrentDensity.FromAmperesPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrentDensity v = ElectricCurrentDensity.FromAmperesPerSquareMeter(1); - Assert.True(v.Equals(ElectricCurrentDensity.FromAmperesPerSquareMeter(1), ElectricCurrentDensity.FromAmperesPerSquareMeter(AmperesPerSquareMeterTolerance))); - Assert.False(v.Equals(ElectricCurrentDensity.Zero, ElectricCurrentDensity.FromAmperesPerSquareMeter(AmperesPerSquareMeterTolerance))); + Assert.True(v.Equals(ElectricCurrentDensity.FromAmperesPerSquareMeter(1), AmperesPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrentDensity.Zero, AmperesPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs index 066f847fa9..87a2096ef1 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentGradientTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrentGradient a = ElectricCurrentGradient.FromAmperesPerSecond(1); - ElectricCurrentGradient b = ElectricCurrentGradient.FromAmperesPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrentGradient v = ElectricCurrentGradient.FromAmperesPerSecond(1); - Assert.True(v.Equals(ElectricCurrentGradient.FromAmperesPerSecond(1), ElectricCurrentGradient.FromAmperesPerSecond(AmperesPerSecondTolerance))); - Assert.False(v.Equals(ElectricCurrentGradient.Zero, ElectricCurrentGradient.FromAmperesPerSecond(AmperesPerSecondTolerance))); + Assert.True(v.Equals(ElectricCurrentGradient.FromAmperesPerSecond(1), AmperesPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrentGradient.Zero, AmperesPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs index 44e66c1490..fbdc010cd2 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricCurrentTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ampere.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricCurrent a = ElectricCurrent.FromAmperes(1); - ElectricCurrent b = ElectricCurrent.FromAmperes(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricCurrent v = ElectricCurrent.FromAmperes(1); - Assert.True(v.Equals(ElectricCurrent.FromAmperes(1), ElectricCurrent.FromAmperes(AmperesTolerance))); - Assert.False(v.Equals(ElectricCurrent.Zero, ElectricCurrent.FromAmperes(AmperesTolerance))); + Assert.True(v.Equals(ElectricCurrent.FromAmperes(1), AmperesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricCurrent.Zero, AmperesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs index 559f971e51..ee0f64934c 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricFieldTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricField a = ElectricField.FromVoltsPerMeter(1); - ElectricField b = ElectricField.FromVoltsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricField v = ElectricField.FromVoltsPerMeter(1); - Assert.True(v.Equals(ElectricField.FromVoltsPerMeter(1), ElectricField.FromVoltsPerMeter(VoltsPerMeterTolerance))); - Assert.False(v.Equals(ElectricField.Zero, ElectricField.FromVoltsPerMeter(VoltsPerMeterTolerance))); + Assert.True(v.Equals(ElectricField.FromVoltsPerMeter(1), VoltsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricField.Zero, VoltsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs index ad2bfe300a..21cb45fb10 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricInductanceTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => henry.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricInductance a = ElectricInductance.FromHenries(1); - ElectricInductance b = ElectricInductance.FromHenries(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricInductance v = ElectricInductance.FromHenries(1); - Assert.True(v.Equals(ElectricInductance.FromHenries(1), ElectricInductance.FromHenries(HenriesTolerance))); - Assert.False(v.Equals(ElectricInductance.Zero, ElectricInductance.FromHenries(HenriesTolerance))); + Assert.True(v.Equals(ElectricInductance.FromHenries(1), HenriesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricInductance.Zero, HenriesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs index 382dca9c20..4e00d0f1d4 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialAcTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltac.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotentialAc a = ElectricPotentialAc.FromVoltsAc(1); - ElectricPotentialAc b = ElectricPotentialAc.FromVoltsAc(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotentialAc v = ElectricPotentialAc.FromVoltsAc(1); - Assert.True(v.Equals(ElectricPotentialAc.FromVoltsAc(1), ElectricPotentialAc.FromVoltsAc(VoltsAcTolerance))); - Assert.False(v.Equals(ElectricPotentialAc.Zero, ElectricPotentialAc.FromVoltsAc(VoltsAcTolerance))); + Assert.True(v.Equals(ElectricPotentialAc.FromVoltsAc(1), VoltsAcTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotentialAc.Zero, VoltsAcTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs index d87ca1945b..31ae99171d 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialDcTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltdc.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotentialDc a = ElectricPotentialDc.FromVoltsDc(1); - ElectricPotentialDc b = ElectricPotentialDc.FromVoltsDc(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotentialDc v = ElectricPotentialDc.FromVoltsDc(1); - Assert.True(v.Equals(ElectricPotentialDc.FromVoltsDc(1), ElectricPotentialDc.FromVoltsDc(VoltsDcTolerance))); - Assert.False(v.Equals(ElectricPotentialDc.Zero, ElectricPotentialDc.FromVoltsDc(VoltsDcTolerance))); + Assert.True(v.Equals(ElectricPotentialDc.FromVoltsDc(1), VoltsDcTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotentialDc.Zero, VoltsDcTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs index b3f20c8c98..3418f8e556 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricPotentialTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => volt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricPotential a = ElectricPotential.FromVolts(1); - ElectricPotential b = ElectricPotential.FromVolts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricPotential v = ElectricPotential.FromVolts(1); - Assert.True(v.Equals(ElectricPotential.FromVolts(1), ElectricPotential.FromVolts(VoltsTolerance))); - Assert.False(v.Equals(ElectricPotential.Zero, ElectricPotential.FromVolts(VoltsTolerance))); + Assert.True(v.Equals(ElectricPotential.FromVolts(1), VoltsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricPotential.Zero, VoltsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs index 503519f667..58d093de1f 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricResistanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ohm.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricResistance a = ElectricResistance.FromOhms(1); - ElectricResistance b = ElectricResistance.FromOhms(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricResistance v = ElectricResistance.FromOhms(1); - Assert.True(v.Equals(ElectricResistance.FromOhms(1), ElectricResistance.FromOhms(OhmsTolerance))); - Assert.False(v.Equals(ElectricResistance.Zero, ElectricResistance.FromOhms(OhmsTolerance))); + Assert.True(v.Equals(ElectricResistance.FromOhms(1), OhmsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricResistance.Zero, OhmsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs index af17382b28..e3f152c82d 100644 --- a/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ElectricResistivityTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => ohmmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ElectricResistivity a = ElectricResistivity.FromOhmMeters(1); - ElectricResistivity b = ElectricResistivity.FromOhmMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ElectricResistivity v = ElectricResistivity.FromOhmMeters(1); - Assert.True(v.Equals(ElectricResistivity.FromOhmMeters(1), ElectricResistivity.FromOhmMeters(OhmMetersTolerance))); - Assert.False(v.Equals(ElectricResistivity.Zero, ElectricResistivity.FromOhmMeters(OhmMetersTolerance))); + Assert.True(v.Equals(ElectricResistivity.FromOhmMeters(1), OhmMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ElectricResistivity.Zero, OhmMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs index 9b33409387..185cb209b8 100644 --- a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs @@ -359,28 +359,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joule.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Energy a = Energy.FromJoules(1); - Energy b = Energy.FromJoules(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Energy v = Energy.FromJoules(1); - Assert.True(v.Equals(Energy.FromJoules(1), Energy.FromJoules(JoulesTolerance))); - Assert.False(v.Equals(Energy.Zero, Energy.FromJoules(JoulesTolerance))); + Assert.True(v.Equals(Energy.FromJoules(1), JoulesTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Energy.Zero, JoulesTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs index 0e56dca59c..9be160a987 100644 --- a/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/EntropyTestsBase.g.cs @@ -209,28 +209,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Entropy a = Entropy.FromJoulesPerKelvin(1); - Entropy b = Entropy.FromJoulesPerKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Entropy v = Entropy.FromJoulesPerKelvin(1); - Assert.True(v.Equals(Entropy.FromJoulesPerKelvin(1), Entropy.FromJoulesPerKelvin(JoulesPerKelvinTolerance))); - Assert.False(v.Equals(Entropy.Zero, Entropy.FromJoulesPerKelvin(JoulesPerKelvinTolerance))); + Assert.True(v.Equals(Entropy.FromJoulesPerKelvin(1), JoulesPerKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Entropy.Zero, JoulesPerKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs index 3b2b44ce5e..aa810042a6 100644 --- a/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs @@ -379,28 +379,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Flow a = Flow.FromCubicMetersPerSecond(1); - Flow b = Flow.FromCubicMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Flow v = Flow.FromCubicMetersPerSecond(1); - Assert.True(v.Equals(Flow.FromCubicMetersPerSecond(1), Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - Assert.False(v.Equals(Flow.Zero, Flow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); + Assert.True(v.Equals(Flow.FromCubicMetersPerSecond(1), CubicMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Flow.Zero, CubicMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs index c7cc526d7e..71a10c50cd 100644 --- a/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForceChangeRateTestsBase.g.cs @@ -249,28 +249,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ForceChangeRate a = ForceChangeRate.FromNewtonsPerSecond(1); - ForceChangeRate b = ForceChangeRate.FromNewtonsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ForceChangeRate v = ForceChangeRate.FromNewtonsPerSecond(1); - Assert.True(v.Equals(ForceChangeRate.FromNewtonsPerSecond(1), ForceChangeRate.FromNewtonsPerSecond(NewtonsPerSecondTolerance))); - Assert.False(v.Equals(ForceChangeRate.Zero, ForceChangeRate.FromNewtonsPerSecond(NewtonsPerSecondTolerance))); + Assert.True(v.Equals(ForceChangeRate.FromNewtonsPerSecond(1), NewtonsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ForceChangeRate.Zero, NewtonsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs index df43843b85..475ba70f58 100644 --- a/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForcePerLengthTestsBase.g.cs @@ -229,28 +229,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ForcePerLength a = ForcePerLength.FromNewtonsPerMeter(1); - ForcePerLength b = ForcePerLength.FromNewtonsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ForcePerLength v = ForcePerLength.FromNewtonsPerMeter(1); - Assert.True(v.Equals(ForcePerLength.FromNewtonsPerMeter(1), ForcePerLength.FromNewtonsPerMeter(NewtonsPerMeterTolerance))); - Assert.False(v.Equals(ForcePerLength.Zero, ForcePerLength.FromNewtonsPerMeter(NewtonsPerMeterTolerance))); + Assert.True(v.Equals(ForcePerLength.FromNewtonsPerMeter(1), NewtonsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ForcePerLength.Zero, NewtonsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs index 72f36a6078..675e78b0aa 100644 --- a/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ForceTestsBase.g.cs @@ -239,28 +239,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newton.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Force a = Force.FromNewtons(1); - Force b = Force.FromNewtons(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Force v = Force.FromNewtons(1); - Assert.True(v.Equals(Force.FromNewtons(1), Force.FromNewtons(NewtonsTolerance))); - Assert.False(v.Equals(Force.Zero, Force.FromNewtons(NewtonsTolerance))); + Assert.True(v.Equals(Force.FromNewtons(1), NewtonsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Force.Zero, NewtonsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs index 095f12058a..57829de236 100644 --- a/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/FrequencyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => hertz.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Frequency a = Frequency.FromHertz(1); - Frequency b = Frequency.FromHertz(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Frequency v = Frequency.FromHertz(1); - Assert.True(v.Equals(Frequency.FromHertz(1), Frequency.FromHertz(HertzTolerance))); - Assert.False(v.Equals(Frequency.Zero, Frequency.FromHertz(HertzTolerance))); + Assert.True(v.Equals(Frequency.FromHertz(1), HertzTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Frequency.Zero, HertzTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs index f704b9faff..745ab078d4 100644 --- a/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs @@ -299,28 +299,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - HeatFlux a = HeatFlux.FromWattsPerSquareMeter(1); - HeatFlux b = HeatFlux.FromWattsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { HeatFlux v = HeatFlux.FromWattsPerSquareMeter(1); - Assert.True(v.Equals(HeatFlux.FromWattsPerSquareMeter(1), HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); - Assert.False(v.Equals(HeatFlux.Zero, HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); + Assert.True(v.Equals(HeatFlux.FromWattsPerSquareMeter(1), WattsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(HeatFlux.Zero, WattsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs index 38c513a17a..fbb8dfae1a 100644 --- a/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/HeatTransferCoefficientTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeterkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - HeatTransferCoefficient a = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); - HeatTransferCoefficient b = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { HeatTransferCoefficient v = HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1); - Assert.True(v.Equals(HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1), HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(WattsPerSquareMeterKelvinTolerance))); - Assert.False(v.Equals(HeatTransferCoefficient.Zero, HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(WattsPerSquareMeterKelvinTolerance))); + Assert.True(v.Equals(HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(1), WattsPerSquareMeterKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(HeatTransferCoefficient.Zero, WattsPerSquareMeterKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs index 19d2830557..bb41e712c1 100644 --- a/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IlluminanceTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => lux.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Illuminance a = Illuminance.FromLux(1); - Illuminance b = Illuminance.FromLux(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Illuminance v = Illuminance.FromLux(1); - Assert.True(v.Equals(Illuminance.FromLux(1), Illuminance.FromLux(LuxTolerance))); - Assert.False(v.Equals(Illuminance.Zero, Illuminance.FromLux(LuxTolerance))); + Assert.True(v.Equals(Illuminance.FromLux(1), LuxTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Illuminance.Zero, LuxTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs index 635c68699f..9838aae21a 100644 --- a/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/InformationTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => bit.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Information a = Information.FromBits(1); - Information b = Information.FromBits(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Information v = Information.FromBits(1); - Assert.True(v.Equals(Information.FromBits(1), Information.FromBits(BitsTolerance))); - Assert.False(v.Equals(Information.Zero, Information.FromBits(BitsTolerance))); + Assert.True(v.Equals(Information.FromBits(1), BitsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Information.Zero, BitsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs index 2fef8007e2..abafe1662d 100644 --- a/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IrradianceTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Irradiance a = Irradiance.FromWattsPerSquareMeter(1); - Irradiance b = Irradiance.FromWattsPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Irradiance v = Irradiance.FromWattsPerSquareMeter(1); - Assert.True(v.Equals(Irradiance.FromWattsPerSquareMeter(1), Irradiance.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); - Assert.False(v.Equals(Irradiance.Zero, Irradiance.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance))); + Assert.True(v.Equals(Irradiance.FromWattsPerSquareMeter(1), WattsPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Irradiance.Zero, WattsPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs index f77c29779f..9beaf2316b 100644 --- a/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/IrradiationTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Irradiation a = Irradiation.FromJoulesPerSquareMeter(1); - Irradiation b = Irradiation.FromJoulesPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Irradiation v = Irradiation.FromJoulesPerSquareMeter(1); - Assert.True(v.Equals(Irradiation.FromJoulesPerSquareMeter(1), Irradiation.FromJoulesPerSquareMeter(JoulesPerSquareMeterTolerance))); - Assert.False(v.Equals(Irradiation.Zero, Irradiation.FromJoulesPerSquareMeter(JoulesPerSquareMeterTolerance))); + Assert.True(v.Equals(Irradiation.FromJoulesPerSquareMeter(1), JoulesPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Irradiation.Zero, JoulesPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs index 1182770b7b..8658aff7ea 100644 --- a/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/KinematicViscosityTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - KinematicViscosity a = KinematicViscosity.FromSquareMetersPerSecond(1); - KinematicViscosity b = KinematicViscosity.FromSquareMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { KinematicViscosity v = KinematicViscosity.FromSquareMetersPerSecond(1); - Assert.True(v.Equals(KinematicViscosity.FromSquareMetersPerSecond(1), KinematicViscosity.FromSquareMetersPerSecond(SquareMetersPerSecondTolerance))); - Assert.False(v.Equals(KinematicViscosity.Zero, KinematicViscosity.FromSquareMetersPerSecond(SquareMetersPerSecondTolerance))); + Assert.True(v.Equals(KinematicViscosity.FromSquareMetersPerSecond(1), SquareMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(KinematicViscosity.Zero, SquareMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs index 10c3f138ff..7d2fcf1f37 100644 --- a/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LapseRateTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degreecelsiusperkilometer.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LapseRate a = LapseRate.FromDegreesCelciusPerKilometer(1); - LapseRate b = LapseRate.FromDegreesCelciusPerKilometer(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LapseRate v = LapseRate.FromDegreesCelciusPerKilometer(1); - Assert.True(v.Equals(LapseRate.FromDegreesCelciusPerKilometer(1), LapseRate.FromDegreesCelciusPerKilometer(DegreesCelciusPerKilometerTolerance))); - Assert.False(v.Equals(LapseRate.Zero, LapseRate.FromDegreesCelciusPerKilometer(DegreesCelciusPerKilometerTolerance))); + Assert.True(v.Equals(LapseRate.FromDegreesCelciusPerKilometer(1), DegreesCelciusPerKilometerTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LapseRate.Zero, DegreesCelciusPerKilometerTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs index 6db53d0741..3b3e68c55a 100644 --- a/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LengthTestsBase.g.cs @@ -359,28 +359,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Length a = Length.FromMeters(1); - Length b = Length.FromMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Length v = Length.FromMeters(1); - Assert.True(v.Equals(Length.FromMeters(1), Length.FromMeters(MetersTolerance))); - Assert.False(v.Equals(Length.Zero, Length.FromMeters(MetersTolerance))); + Assert.True(v.Equals(Length.FromMeters(1), MetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Length.Zero, MetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs index 361a62038e..3bb2e29d6e 100644 --- a/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LevelTestsBase.g.cs @@ -164,28 +164,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibel.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Level a = Level.FromDecibels(1); - Level b = Level.FromDecibels(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Level v = Level.FromDecibels(1); - Assert.True(v.Equals(Level.FromDecibels(1), Level.FromDecibels(DecibelsTolerance))); - Assert.False(v.Equals(Level.Zero, Level.FromDecibels(DecibelsTolerance))); + Assert.True(v.Equals(Level.FromDecibels(1), DecibelsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Level.Zero, DecibelsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs index 1efda1e3cc..f539cd5237 100644 --- a/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LinearDensityTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LinearDensity a = LinearDensity.FromKilogramsPerMeter(1); - LinearDensity b = LinearDensity.FromKilogramsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LinearDensity v = LinearDensity.FromKilogramsPerMeter(1); - Assert.True(v.Equals(LinearDensity.FromKilogramsPerMeter(1), LinearDensity.FromKilogramsPerMeter(KilogramsPerMeterTolerance))); - Assert.False(v.Equals(LinearDensity.Zero, LinearDensity.FromKilogramsPerMeter(KilogramsPerMeterTolerance))); + Assert.True(v.Equals(LinearDensity.FromKilogramsPerMeter(1), KilogramsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LinearDensity.Zero, KilogramsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs index acc5cbb383..1d8377c939 100644 --- a/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LuminousFluxTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => lumen.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LuminousFlux a = LuminousFlux.FromLumens(1); - LuminousFlux b = LuminousFlux.FromLumens(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LuminousFlux v = LuminousFlux.FromLumens(1); - Assert.True(v.Equals(LuminousFlux.FromLumens(1), LuminousFlux.FromLumens(LumensTolerance))); - Assert.False(v.Equals(LuminousFlux.Zero, LuminousFlux.FromLumens(LumensTolerance))); + Assert.True(v.Equals(LuminousFlux.FromLumens(1), LumensTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LuminousFlux.Zero, LumensTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs index 51855d73cc..43a3f8571f 100644 --- a/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/LuminousIntensityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => candela.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - LuminousIntensity a = LuminousIntensity.FromCandela(1); - LuminousIntensity b = LuminousIntensity.FromCandela(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { LuminousIntensity v = LuminousIntensity.FromCandela(1); - Assert.True(v.Equals(LuminousIntensity.FromCandela(1), LuminousIntensity.FromCandela(CandelaTolerance))); - Assert.False(v.Equals(LuminousIntensity.Zero, LuminousIntensity.FromCandela(CandelaTolerance))); + Assert.True(v.Equals(LuminousIntensity.FromCandela(1), CandelaTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(LuminousIntensity.Zero, CandelaTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs index 2245cd6973..aa8c49db3f 100644 --- a/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagneticFieldTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => tesla.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MagneticField a = MagneticField.FromTeslas(1); - MagneticField b = MagneticField.FromTeslas(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MagneticField v = MagneticField.FromTeslas(1); - Assert.True(v.Equals(MagneticField.FromTeslas(1), MagneticField.FromTeslas(TeslasTolerance))); - Assert.False(v.Equals(MagneticField.Zero, MagneticField.FromTeslas(TeslasTolerance))); + Assert.True(v.Equals(MagneticField.FromTeslas(1), TeslasTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MagneticField.Zero, TeslasTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs index 9a67e75476..0324d949a3 100644 --- a/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagneticFluxTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => weber.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MagneticFlux a = MagneticFlux.FromWebers(1); - MagneticFlux b = MagneticFlux.FromWebers(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MagneticFlux v = MagneticFlux.FromWebers(1); - Assert.True(v.Equals(MagneticFlux.FromWebers(1), MagneticFlux.FromWebers(WebersTolerance))); - Assert.False(v.Equals(MagneticFlux.Zero, MagneticFlux.FromWebers(WebersTolerance))); + Assert.True(v.Equals(MagneticFlux.FromWebers(1), WebersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MagneticFlux.Zero, WebersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs index 7e3f1aeae2..9d0205fa94 100644 --- a/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MagnetizationTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => amperepermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Magnetization a = Magnetization.FromAmperesPerMeter(1); - Magnetization b = Magnetization.FromAmperesPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Magnetization v = Magnetization.FromAmperesPerMeter(1); - Assert.True(v.Equals(Magnetization.FromAmperesPerMeter(1), Magnetization.FromAmperesPerMeter(AmperesPerMeterTolerance))); - Assert.False(v.Equals(Magnetization.Zero, Magnetization.FromAmperesPerMeter(AmperesPerMeterTolerance))); + Assert.True(v.Equals(Magnetization.FromAmperesPerMeter(1), AmperesPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Magnetization.Zero, AmperesPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs index 8f6aa826ea..9fd4c1d834 100644 --- a/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassFlowTestsBase.g.cs @@ -289,28 +289,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => grampersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassFlow a = MassFlow.FromGramsPerSecond(1); - MassFlow b = MassFlow.FromGramsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassFlow v = MassFlow.FromGramsPerSecond(1); - Assert.True(v.Equals(MassFlow.FromGramsPerSecond(1), MassFlow.FromGramsPerSecond(GramsPerSecondTolerance))); - Assert.False(v.Equals(MassFlow.Zero, MassFlow.FromGramsPerSecond(GramsPerSecondTolerance))); + Assert.True(v.Equals(MassFlow.FromGramsPerSecond(1), GramsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassFlow.Zero, GramsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs index d1a1e0acc2..d8edec8a0b 100644 --- a/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassFluxTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampersecondpersquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassFlux a = MassFlux.FromKilogramsPerSecondPerSquareMeter(1); - MassFlux b = MassFlux.FromKilogramsPerSecondPerSquareMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassFlux v = MassFlux.FromKilogramsPerSecondPerSquareMeter(1); - Assert.True(v.Equals(MassFlux.FromKilogramsPerSecondPerSquareMeter(1), MassFlux.FromKilogramsPerSecondPerSquareMeter(KilogramsPerSecondPerSquareMeterTolerance))); - Assert.False(v.Equals(MassFlux.Zero, MassFlux.FromKilogramsPerSecondPerSquareMeter(KilogramsPerSecondPerSquareMeterTolerance))); + Assert.True(v.Equals(MassFlux.FromKilogramsPerSecondPerSquareMeter(1), KilogramsPerSecondPerSquareMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassFlux.Zero, KilogramsPerSecondPerSquareMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs index 33f518a927..ab3adee533 100644 --- a/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassMomentOfInertiaTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogramsquaremeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MassMomentOfInertia a = MassMomentOfInertia.FromKilogramSquareMeters(1); - MassMomentOfInertia b = MassMomentOfInertia.FromKilogramSquareMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MassMomentOfInertia v = MassMomentOfInertia.FromKilogramSquareMeters(1); - Assert.True(v.Equals(MassMomentOfInertia.FromKilogramSquareMeters(1), MassMomentOfInertia.FromKilogramSquareMeters(KilogramSquareMetersTolerance))); - Assert.False(v.Equals(MassMomentOfInertia.Zero, MassMomentOfInertia.FromKilogramSquareMeters(KilogramSquareMetersTolerance))); + Assert.True(v.Equals(MassMomentOfInertia.FromKilogramSquareMeters(1), KilogramSquareMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MassMomentOfInertia.Zero, KilogramSquareMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs index 1e15593177..13586290ae 100644 --- a/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MassTestsBase.g.cs @@ -349,28 +349,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Mass a = Mass.FromKilograms(1); - Mass b = Mass.FromKilograms(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Mass v = Mass.FromKilograms(1); - Assert.True(v.Equals(Mass.FromKilograms(1), Mass.FromKilograms(KilogramsTolerance))); - Assert.False(v.Equals(Mass.Zero, Mass.FromKilograms(KilogramsTolerance))); + Assert.True(v.Equals(Mass.FromKilograms(1), KilogramsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Mass.Zero, KilogramsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs index 920f219a95..d513b87f1d 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepermole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarEnergy a = MolarEnergy.FromJoulesPerMole(1); - MolarEnergy b = MolarEnergy.FromJoulesPerMole(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarEnergy v = MolarEnergy.FromJoulesPerMole(1); - Assert.True(v.Equals(MolarEnergy.FromJoulesPerMole(1), MolarEnergy.FromJoulesPerMole(JoulesPerMoleTolerance))); - Assert.False(v.Equals(MolarEnergy.Zero, MolarEnergy.FromJoulesPerMole(JoulesPerMoleTolerance))); + Assert.True(v.Equals(MolarEnergy.FromJoulesPerMole(1), JoulesPerMoleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarEnergy.Zero, JoulesPerMoleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs index 7892dcd4e6..fc31da2b01 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarEntropyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => joulepermolekelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarEntropy a = MolarEntropy.FromJoulesPerMoleKelvin(1); - MolarEntropy b = MolarEntropy.FromJoulesPerMoleKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarEntropy v = MolarEntropy.FromJoulesPerMoleKelvin(1); - Assert.True(v.Equals(MolarEntropy.FromJoulesPerMoleKelvin(1), MolarEntropy.FromJoulesPerMoleKelvin(JoulesPerMoleKelvinTolerance))); - Assert.False(v.Equals(MolarEntropy.Zero, MolarEntropy.FromJoulesPerMoleKelvin(JoulesPerMoleKelvinTolerance))); + Assert.True(v.Equals(MolarEntropy.FromJoulesPerMoleKelvin(1), JoulesPerMoleKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarEntropy.Zero, JoulesPerMoleKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs index 83f82c605b..fd8a848e71 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarMassTestsBase.g.cs @@ -259,28 +259,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kilogrampermole.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - MolarMass a = MolarMass.FromKilogramsPerMole(1); - MolarMass b = MolarMass.FromKilogramsPerMole(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { MolarMass v = MolarMass.FromKilogramsPerMole(1); - Assert.True(v.Equals(MolarMass.FromKilogramsPerMole(1), MolarMass.FromKilogramsPerMole(KilogramsPerMoleTolerance))); - Assert.False(v.Equals(MolarMass.Zero, MolarMass.FromKilogramsPerMole(KilogramsPerMoleTolerance))); + Assert.True(v.Equals(MolarMass.FromKilogramsPerMole(1), KilogramsPerMoleTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(MolarMass.Zero, KilogramsPerMoleTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs index d918cebc4f..2d0bdd0d89 100644 --- a/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/MolarityTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => molespercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Molarity a = Molarity.FromMolesPerCubicMeter(1); - Molarity b = Molarity.FromMolesPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Molarity v = Molarity.FromMolesPerCubicMeter(1); - Assert.True(v.Equals(Molarity.FromMolesPerCubicMeter(1), Molarity.FromMolesPerCubicMeter(MolesPerCubicMeterTolerance))); - Assert.False(v.Equals(Molarity.Zero, Molarity.FromMolesPerCubicMeter(MolesPerCubicMeterTolerance))); + Assert.True(v.Equals(Molarity.FromMolesPerCubicMeter(1), MolesPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Molarity.Zero, MolesPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs index 0826bfbfdd..f307316701 100644 --- a/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PermeabilityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => henrypermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Permeability a = Permeability.FromHenriesPerMeter(1); - Permeability b = Permeability.FromHenriesPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Permeability v = Permeability.FromHenriesPerMeter(1); - Assert.True(v.Equals(Permeability.FromHenriesPerMeter(1), Permeability.FromHenriesPerMeter(HenriesPerMeterTolerance))); - Assert.False(v.Equals(Permeability.Zero, Permeability.FromHenriesPerMeter(HenriesPerMeterTolerance))); + Assert.True(v.Equals(Permeability.FromHenriesPerMeter(1), HenriesPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Permeability.Zero, HenriesPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs index f3137f003a..2ab368854a 100644 --- a/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PermittivityTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => faradpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Permittivity a = Permittivity.FromFaradsPerMeter(1); - Permittivity b = Permittivity.FromFaradsPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Permittivity v = Permittivity.FromFaradsPerMeter(1); - Assert.True(v.Equals(Permittivity.FromFaradsPerMeter(1), Permittivity.FromFaradsPerMeter(FaradsPerMeterTolerance))); - Assert.False(v.Equals(Permittivity.Zero, Permittivity.FromFaradsPerMeter(FaradsPerMeterTolerance))); + Assert.True(v.Equals(Permittivity.FromFaradsPerMeter(1), FaradsPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Permittivity.Zero, FaradsPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs index 7ec8597875..8bc82409e1 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs @@ -579,28 +579,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PowerDensity a = PowerDensity.FromWattsPerCubicMeter(1); - PowerDensity b = PowerDensity.FromWattsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PowerDensity v = PowerDensity.FromWattsPerCubicMeter(1); - Assert.True(v.Equals(PowerDensity.FromWattsPerCubicMeter(1), PowerDensity.FromWattsPerCubicMeter(WattsPerCubicMeterTolerance))); - Assert.False(v.Equals(PowerDensity.Zero, PowerDensity.FromWattsPerCubicMeter(WattsPerCubicMeterTolerance))); + Assert.True(v.Equals(PowerDensity.FromWattsPerCubicMeter(1), WattsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PowerDensity.Zero, WattsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs index 9ee129a240..998f067817 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerRatioTestsBase.g.cs @@ -164,28 +164,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decibelwatt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PowerRatio a = PowerRatio.FromDecibelWatts(1); - PowerRatio b = PowerRatio.FromDecibelWatts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PowerRatio v = PowerRatio.FromDecibelWatts(1); - Assert.True(v.Equals(PowerRatio.FromDecibelWatts(1), PowerRatio.FromDecibelWatts(DecibelWattsTolerance))); - Assert.False(v.Equals(PowerRatio.Zero, PowerRatio.FromDecibelWatts(DecibelWattsTolerance))); + Assert.True(v.Equals(PowerRatio.FromDecibelWatts(1), DecibelWattsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PowerRatio.Zero, DecibelWattsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs index 894accc13a..965e63128c 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerTestsBase.g.cs @@ -339,28 +339,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => watt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Power a = Power.FromWatts(1); - Power b = Power.FromWatts(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Power v = Power.FromWatts(1); - Assert.True(v.Equals(Power.FromWatts(1), Power.FromWatts(WattsTolerance))); - Assert.False(v.Equals(Power.Zero, Power.FromWatts(WattsTolerance))); + Assert.True(v.Equals(Power.FromWatts(1), WattsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Power.Zero, WattsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs index a682b11362..879d0f0cd0 100644 --- a/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PressureChangeRateTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => pascalpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - PressureChangeRate a = PressureChangeRate.FromPascalsPerSecond(1); - PressureChangeRate b = PressureChangeRate.FromPascalsPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { PressureChangeRate v = PressureChangeRate.FromPascalsPerSecond(1); - Assert.True(v.Equals(PressureChangeRate.FromPascalsPerSecond(1), PressureChangeRate.FromPascalsPerSecond(PascalsPerSecondTolerance))); - Assert.False(v.Equals(PressureChangeRate.Zero, PressureChangeRate.FromPascalsPerSecond(PascalsPerSecondTolerance))); + Assert.True(v.Equals(PressureChangeRate.FromPascalsPerSecond(1), PascalsPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(PressureChangeRate.Zero, PascalsPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs index fad6f6b86e..900ee1ffe5 100644 --- a/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PressureTestsBase.g.cs @@ -519,28 +519,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => pascal.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Pressure a = Pressure.FromPascals(1); - Pressure b = Pressure.FromPascals(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Pressure v = Pressure.FromPascals(1); - Assert.True(v.Equals(Pressure.FromPascals(1), Pressure.FromPascals(PascalsTolerance))); - Assert.False(v.Equals(Pressure.Zero, Pressure.FromPascals(PascalsTolerance))); + Assert.True(v.Equals(Pressure.FromPascals(1), PascalsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Pressure.Zero, PascalsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs index 0b1e156e0d..2c2397753a 100644 --- a/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RatioTestsBase.g.cs @@ -199,28 +199,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => decimalfraction.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Ratio a = Ratio.FromDecimalFractions(1); - Ratio b = Ratio.FromDecimalFractions(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Ratio v = Ratio.FromDecimalFractions(1); - Assert.True(v.Equals(Ratio.FromDecimalFractions(1), Ratio.FromDecimalFractions(DecimalFractionsTolerance))); - Assert.False(v.Equals(Ratio.Zero, Ratio.FromDecimalFractions(DecimalFractionsTolerance))); + Assert.True(v.Equals(Ratio.FromDecimalFractions(1), DecimalFractionsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Ratio.Zero, DecimalFractionsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs index d0deaa44aa..78212a0e1f 100644 --- a/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ReactiveEnergyTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperereactivehour.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ReactiveEnergy a = ReactiveEnergy.FromVoltampereReactiveHours(1); - ReactiveEnergy b = ReactiveEnergy.FromVoltampereReactiveHours(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ReactiveEnergy v = ReactiveEnergy.FromVoltampereReactiveHours(1); - Assert.True(v.Equals(ReactiveEnergy.FromVoltampereReactiveHours(1), ReactiveEnergy.FromVoltampereReactiveHours(VoltampereReactiveHoursTolerance))); - Assert.False(v.Equals(ReactiveEnergy.Zero, ReactiveEnergy.FromVoltampereReactiveHours(VoltampereReactiveHoursTolerance))); + Assert.True(v.Equals(ReactiveEnergy.FromVoltampereReactiveHours(1), VoltampereReactiveHoursTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ReactiveEnergy.Zero, VoltampereReactiveHoursTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs index 627bdaa5d3..9b325f9183 100644 --- a/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ReactivePowerTestsBase.g.cs @@ -179,28 +179,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => voltamperereactive.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ReactivePower a = ReactivePower.FromVoltamperesReactive(1); - ReactivePower b = ReactivePower.FromVoltamperesReactive(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ReactivePower v = ReactivePower.FromVoltamperesReactive(1); - Assert.True(v.Equals(ReactivePower.FromVoltamperesReactive(1), ReactivePower.FromVoltamperesReactive(VoltamperesReactiveTolerance))); - Assert.False(v.Equals(ReactivePower.Zero, ReactivePower.FromVoltamperesReactive(VoltamperesReactiveTolerance))); + Assert.True(v.Equals(ReactivePower.FromVoltamperesReactive(1), VoltamperesReactiveTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ReactivePower.Zero, VoltamperesReactiveTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs index c22d688973..3e23884d1c 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalAccelerationTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => radianpersecondsquared.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalAcceleration a = RotationalAcceleration.FromRadiansPerSecondSquared(1); - RotationalAcceleration b = RotationalAcceleration.FromRadiansPerSecondSquared(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalAcceleration v = RotationalAcceleration.FromRadiansPerSecondSquared(1); - Assert.True(v.Equals(RotationalAcceleration.FromRadiansPerSecondSquared(1), RotationalAcceleration.FromRadiansPerSecondSquared(RadiansPerSecondSquaredTolerance))); - Assert.False(v.Equals(RotationalAcceleration.Zero, RotationalAcceleration.FromRadiansPerSecondSquared(RadiansPerSecondSquaredTolerance))); + Assert.True(v.Equals(RotationalAcceleration.FromRadiansPerSecondSquared(1), RadiansPerSecondSquaredTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalAcceleration.Zero, RadiansPerSecondSquaredTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs index 3ad5a6df0d..c031eebfde 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalSpeedTestsBase.g.cs @@ -269,28 +269,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => radianpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalSpeed a = RotationalSpeed.FromRadiansPerSecond(1); - RotationalSpeed b = RotationalSpeed.FromRadiansPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalSpeed v = RotationalSpeed.FromRadiansPerSecond(1); - Assert.True(v.Equals(RotationalSpeed.FromRadiansPerSecond(1), RotationalSpeed.FromRadiansPerSecond(RadiansPerSecondTolerance))); - Assert.False(v.Equals(RotationalSpeed.Zero, RotationalSpeed.FromRadiansPerSecond(RadiansPerSecondTolerance))); + Assert.True(v.Equals(RotationalSpeed.FromRadiansPerSecond(1), RadiansPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalSpeed.Zero, RadiansPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs index 333b1b1c5d..2d0dab215e 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessPerLengthTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeterperradianpermeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalStiffnessPerLength a = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1); - RotationalStiffnessPerLength b = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalStiffnessPerLength v = RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1); - Assert.True(v.Equals(RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1), RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(NewtonMetersPerRadianPerMeterTolerance))); - Assert.False(v.Equals(RotationalStiffnessPerLength.Zero, RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(NewtonMetersPerRadianPerMeterTolerance))); + Assert.True(v.Equals(RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(1), NewtonMetersPerRadianPerMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalStiffnessPerLength.Zero, NewtonMetersPerRadianPerMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs index 0dba2bc6c5..cf8e152fa6 100644 --- a/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/RotationalStiffnessTestsBase.g.cs @@ -169,28 +169,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeterperradian.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - RotationalStiffness a = RotationalStiffness.FromNewtonMetersPerRadian(1); - RotationalStiffness b = RotationalStiffness.FromNewtonMetersPerRadian(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { RotationalStiffness v = RotationalStiffness.FromNewtonMetersPerRadian(1); - Assert.True(v.Equals(RotationalStiffness.FromNewtonMetersPerRadian(1), RotationalStiffness.FromNewtonMetersPerRadian(NewtonMetersPerRadianTolerance))); - Assert.False(v.Equals(RotationalStiffness.Zero, RotationalStiffness.FromNewtonMetersPerRadian(NewtonMetersPerRadianTolerance))); + Assert.True(v.Equals(RotationalStiffness.FromNewtonMetersPerRadian(1), NewtonMetersPerRadianTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(RotationalStiffness.Zero, NewtonMetersPerRadianTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs index 9a8ce58204..f673e26e4e 100644 --- a/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SolidAngleTestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => steradian.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SolidAngle a = SolidAngle.FromSteradians(1); - SolidAngle b = SolidAngle.FromSteradians(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SolidAngle v = SolidAngle.FromSteradians(1); - Assert.True(v.Equals(SolidAngle.FromSteradians(1), SolidAngle.FromSteradians(SteradiansTolerance))); - Assert.False(v.Equals(SolidAngle.Zero, SolidAngle.FromSteradians(SteradiansTolerance))); + Assert.True(v.Equals(SolidAngle.FromSteradians(1), SteradiansTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SolidAngle.Zero, SteradiansTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs index 21f5e5a664..1072b5c4a3 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificEnergyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificEnergy a = SpecificEnergy.FromJoulesPerKilogram(1); - SpecificEnergy b = SpecificEnergy.FromJoulesPerKilogram(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificEnergy v = SpecificEnergy.FromJoulesPerKilogram(1); - Assert.True(v.Equals(SpecificEnergy.FromJoulesPerKilogram(1), SpecificEnergy.FromJoulesPerKilogram(JoulesPerKilogramTolerance))); - Assert.False(v.Equals(SpecificEnergy.Zero, SpecificEnergy.FromJoulesPerKilogram(JoulesPerKilogramTolerance))); + Assert.True(v.Equals(SpecificEnergy.FromJoulesPerKilogram(1), JoulesPerKilogramTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificEnergy.Zero, JoulesPerKilogramTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs index 484e9ad12b..9c49f40558 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificEntropyTestsBase.g.cs @@ -219,28 +219,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => jouleperkilogramkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificEntropy a = SpecificEntropy.FromJoulesPerKilogramKelvin(1); - SpecificEntropy b = SpecificEntropy.FromJoulesPerKilogramKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificEntropy v = SpecificEntropy.FromJoulesPerKilogramKelvin(1); - Assert.True(v.Equals(SpecificEntropy.FromJoulesPerKilogramKelvin(1), SpecificEntropy.FromJoulesPerKilogramKelvin(JoulesPerKilogramKelvinTolerance))); - Assert.False(v.Equals(SpecificEntropy.Zero, SpecificEntropy.FromJoulesPerKilogramKelvin(JoulesPerKilogramKelvinTolerance))); + Assert.True(v.Equals(SpecificEntropy.FromJoulesPerKilogramKelvin(1), JoulesPerKilogramKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificEntropy.Zero, JoulesPerKilogramKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs index 8ad46ec812..8a91d36863 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificVolumeTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterperkilogram.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificVolume a = SpecificVolume.FromCubicMetersPerKilogram(1); - SpecificVolume b = SpecificVolume.FromCubicMetersPerKilogram(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificVolume v = SpecificVolume.FromCubicMetersPerKilogram(1); - Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance))); - Assert.False(v.Equals(SpecificVolume.Zero, SpecificVolume.FromCubicMetersPerKilogram(CubicMetersPerKilogramTolerance))); + Assert.True(v.Equals(SpecificVolume.FromCubicMetersPerKilogram(1), CubicMetersPerKilogramTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificVolume.Zero, CubicMetersPerKilogramTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs index 6ce9860bf4..6221a093a1 100644 --- a/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpecificWeightTestsBase.g.cs @@ -309,28 +309,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonpercubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - SpecificWeight a = SpecificWeight.FromNewtonsPerCubicMeter(1); - SpecificWeight b = SpecificWeight.FromNewtonsPerCubicMeter(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { SpecificWeight v = SpecificWeight.FromNewtonsPerCubicMeter(1); - Assert.True(v.Equals(SpecificWeight.FromNewtonsPerCubicMeter(1), SpecificWeight.FromNewtonsPerCubicMeter(NewtonsPerCubicMeterTolerance))); - Assert.False(v.Equals(SpecificWeight.Zero, SpecificWeight.FromNewtonsPerCubicMeter(NewtonsPerCubicMeterTolerance))); + Assert.True(v.Equals(SpecificWeight.FromNewtonsPerCubicMeter(1), NewtonsPerCubicMeterTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(SpecificWeight.Zero, NewtonsPerCubicMeterTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs index 44c1e91ab3..b26aec893d 100644 --- a/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/SpeedTestsBase.g.cs @@ -459,28 +459,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => meterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Speed a = Speed.FromMetersPerSecond(1); - Speed b = Speed.FromMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Speed v = Speed.FromMetersPerSecond(1); - Assert.True(v.Equals(Speed.FromMetersPerSecond(1), Speed.FromMetersPerSecond(MetersPerSecondTolerance))); - Assert.False(v.Equals(Speed.Zero, Speed.FromMetersPerSecond(MetersPerSecondTolerance))); + Assert.True(v.Equals(Speed.FromMetersPerSecond(1), MetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Speed.Zero, MetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs index a5d3503dc7..7d5d3aea7f 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureChangeRateTestsBase.g.cs @@ -239,28 +239,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => degreecelsiuspersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - TemperatureChangeRate a = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1); - TemperatureChangeRate b = TemperatureChangeRate.FromDegreesCelsiusPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { TemperatureChangeRate v = TemperatureChangeRate.FromDegreesCelsiusPerSecond(1); - Assert.True(v.Equals(TemperatureChangeRate.FromDegreesCelsiusPerSecond(1), TemperatureChangeRate.FromDegreesCelsiusPerSecond(DegreesCelsiusPerSecondTolerance))); - Assert.False(v.Equals(TemperatureChangeRate.Zero, TemperatureChangeRate.FromDegreesCelsiusPerSecond(DegreesCelsiusPerSecondTolerance))); + Assert.True(v.Equals(TemperatureChangeRate.FromDegreesCelsiusPerSecond(1), DegreesCelsiusPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(TemperatureChangeRate.Zero, DegreesCelsiusPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs index 3fd5e0a093..7e856964cf 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureDeltaTestsBase.g.cs @@ -299,28 +299,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - TemperatureDelta a = TemperatureDelta.FromKelvins(1); - TemperatureDelta b = TemperatureDelta.FromKelvins(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { TemperatureDelta v = TemperatureDelta.FromKelvins(1); - Assert.True(v.Equals(TemperatureDelta.FromKelvins(1), TemperatureDelta.FromKelvins(KelvinsTolerance))); - Assert.False(v.Equals(TemperatureDelta.Zero, TemperatureDelta.FromKelvins(KelvinsTolerance))); + Assert.True(v.Equals(TemperatureDelta.FromKelvins(1), KelvinsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(TemperatureDelta.Zero, KelvinsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs index e855ea235c..43f99b4864 100644 --- a/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TemperatureTestsBase.g.cs @@ -207,28 +207,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => kelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Temperature a = Temperature.FromKelvins(1); - Temperature b = Temperature.FromKelvins(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Temperature v = Temperature.FromKelvins(1); - Assert.True(v.Equals(Temperature.FromKelvins(1), Temperature.FromKelvins(KelvinsTolerance))); - Assert.False(v.Equals(Temperature.Zero, Temperature.FromKelvins(KelvinsTolerance))); + Assert.True(v.Equals(Temperature.FromKelvins(1), KelvinsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Temperature.Zero, KelvinsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs index 0f59b697b8..8c8c4384b2 100644 --- a/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ThermalConductivityTestsBase.g.cs @@ -159,28 +159,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => wattpermeterkelvin.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ThermalConductivity a = ThermalConductivity.FromWattsPerMeterKelvin(1); - ThermalConductivity b = ThermalConductivity.FromWattsPerMeterKelvin(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ThermalConductivity v = ThermalConductivity.FromWattsPerMeterKelvin(1); - Assert.True(v.Equals(ThermalConductivity.FromWattsPerMeterKelvin(1), ThermalConductivity.FromWattsPerMeterKelvin(WattsPerMeterKelvinTolerance))); - Assert.False(v.Equals(ThermalConductivity.Zero, ThermalConductivity.FromWattsPerMeterKelvin(WattsPerMeterKelvinTolerance))); + Assert.True(v.Equals(ThermalConductivity.FromWattsPerMeterKelvin(1), WattsPerMeterKelvinTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ThermalConductivity.Zero, WattsPerMeterKelvinTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs index b2f1989ed0..5a7b6d6e70 100644 --- a/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/ThermalResistanceTestsBase.g.cs @@ -189,28 +189,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => squaremeterkelvinperkilowatt.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - ThermalResistance a = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1); - ThermalResistance b = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { ThermalResistance v = ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1); - Assert.True(v.Equals(ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1), ThermalResistance.FromSquareMeterKelvinsPerKilowatt(SquareMeterKelvinsPerKilowattTolerance))); - Assert.False(v.Equals(ThermalResistance.Zero, ThermalResistance.FromSquareMeterKelvinsPerKilowatt(SquareMeterKelvinsPerKilowattTolerance))); + Assert.True(v.Equals(ThermalResistance.FromSquareMeterKelvinsPerKilowatt(1), SquareMeterKelvinsPerKilowattTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(ThermalResistance.Zero, SquareMeterKelvinsPerKilowattTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs index 908ec3f2f0..297647516e 100644 --- a/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/TorqueTestsBase.g.cs @@ -349,28 +349,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => newtonmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Torque a = Torque.FromNewtonMeters(1); - Torque b = Torque.FromNewtonMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Torque v = Torque.FromNewtonMeters(1); - Assert.True(v.Equals(Torque.FromNewtonMeters(1), Torque.FromNewtonMeters(NewtonMetersTolerance))); - Assert.False(v.Equals(Torque.Zero, Torque.FromNewtonMeters(NewtonMetersTolerance))); + Assert.True(v.Equals(Torque.FromNewtonMeters(1), NewtonMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Torque.Zero, NewtonMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs index 8d75f4a4cc..8d5d86f2e6 100644 --- a/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VitaminATestsBase.g.cs @@ -149,28 +149,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => internationalunit.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - VitaminA a = VitaminA.FromInternationalUnits(1); - VitaminA b = VitaminA.FromInternationalUnits(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { VitaminA v = VitaminA.FromInternationalUnits(1); - Assert.True(v.Equals(VitaminA.FromInternationalUnits(1), VitaminA.FromInternationalUnits(InternationalUnitsTolerance))); - Assert.False(v.Equals(VitaminA.Zero, VitaminA.FromInternationalUnits(InternationalUnitsTolerance))); + Assert.True(v.Equals(VitaminA.FromInternationalUnits(1), InternationalUnitsTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(VitaminA.Zero, InternationalUnitsTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs index 30cdffaf77..e7f4484e3f 100644 --- a/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VolumeFlowTestsBase.g.cs @@ -399,28 +399,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeterpersecond.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - VolumeFlow a = VolumeFlow.FromCubicMetersPerSecond(1); - VolumeFlow b = VolumeFlow.FromCubicMetersPerSecond(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { VolumeFlow v = VolumeFlow.FromCubicMetersPerSecond(1); - Assert.True(v.Equals(VolumeFlow.FromCubicMetersPerSecond(1), VolumeFlow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); - Assert.False(v.Equals(VolumeFlow.Zero, VolumeFlow.FromCubicMetersPerSecond(CubicMetersPerSecondTolerance))); + Assert.True(v.Equals(VolumeFlow.FromCubicMetersPerSecond(1), CubicMetersPerSecondTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(VolumeFlow.Zero, CubicMetersPerSecondTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs index feecaf0831..561e1a70a0 100644 --- a/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/VolumeTestsBase.g.cs @@ -579,28 +579,12 @@ public void CompareToThrowsOnNull() Assert.Throws(() => cubicmeter.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - Volume a = Volume.FromCubicMeters(1); - Volume b = Volume.FromCubicMeters(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { Volume v = Volume.FromCubicMeters(1); - Assert.True(v.Equals(Volume.FromCubicMeters(1), Volume.FromCubicMeters(CubicMetersTolerance))); - Assert.False(v.Equals(Volume.Zero, Volume.FromCubicMeters(CubicMetersTolerance))); + Assert.True(v.Equals(Volume.FromCubicMeters(1), CubicMetersTolerance, ComparisonType.Relative)); + Assert.False(v.Equals(Volume.Zero, CubicMetersTolerance, ComparisonType.Relative)); } [Fact] diff --git a/UnitsNet.Tests/GeneratedQuantityCodeTests.cs b/UnitsNet.Tests/GeneratedQuantityCodeTests.cs index 501c0c5675..4f188897f4 100644 --- a/UnitsNet.Tests/GeneratedQuantityCodeTests.cs +++ b/UnitsNet.Tests/GeneratedQuantityCodeTests.cs @@ -18,14 +18,15 @@ public class QuantitiesWithDouble [Fact] public void LengthEquals_GivenMaxError_ReturnsTrueIfWithinError() { - Length smallError = Length.FromMeters(1e-5); - Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), Length.Zero), "Integer values have zero difference."); - Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), smallError), "Using a max difference value should not change that fact."); + var smallError = 1e-5; - Assert.False(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), Length.Zero), + Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), 0, ComparisonType.Relative), "Integer values have zero difference."); + Assert.True(Length.FromMeters(1).Equals(Length.FromMeters(1), smallError, ComparisonType.Relative), "Using a max difference value should not change that fact."); + + Assert.False(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), 0, ComparisonType.Relative), "Example of floating precision arithmetic that produces slightly different results."); - Assert.True(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), smallError), "But the difference is very small"); + Assert.True(Length.FromMeters(1 + 0.39).Equals(Length.FromMeters(1.39), smallError, ComparisonType.Relative), "But the difference is very small"); } } } -} \ No newline at end of file +} diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index afe7bad3d2..8ff4509d11 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(AccelerationUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Acceleration left, Acceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Acceleration left, Acceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 61e24dca68..b3d268d9ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -275,20 +275,6 @@ public static string GetAbbreviation(AmountOfSubstanceUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AmountOfSubstance left, AmountOfSubstance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AmountOfSubstance left, AmountOfSubstance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 23c643afd5..ca79c35eeb 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -193,20 +193,6 @@ public static string GetAbbreviation(AmplitudeRatioUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AmplitudeRatio left, AmplitudeRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AmplitudeRatio left, AmplitudeRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index ca02498de4..26fa2a5282 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -275,20 +275,6 @@ public static string GetAbbreviation(AngleUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Angle left, Angle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Angle left, Angle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 05dfc23e9d..b74eb3e4c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ApparentEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ApparentEnergy left, ApparentEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ApparentEnergy left, ApparentEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index aea8d678f7..86196917d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ApparentPowerUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ApparentPower left, ApparentPower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ApparentPower left, ApparentPower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 5235e24c0d..b20482542a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(AreaUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Area left, Area right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Area left, Area right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 842a74b281..159a5b6241 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(AreaDensityUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AreaDensity left, AreaDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AreaDensity left, AreaDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 76f090fc9d..e0aea1f48c 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(AreaMomentOfInertiaUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(AreaMomentOfInertia left, AreaMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(AreaMomentOfInertia left, AreaMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 222a886e70..d1c325eb33 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -383,18 +383,6 @@ public static string GetAbbreviation(BitRateUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(BitRate left, BitRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(BitRate left, BitRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 9de58b5023..c92b6de956 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit, [Can return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 1a0f3a3dd9..592a0dc187 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(CapacitanceUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Capacitance left, Capacitance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Capacitance left, Capacitance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index adc1b74e5f..d7cfe1e654 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -491,20 +491,6 @@ public static string GetAbbreviation(DensityUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Density left, Density right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Density left, Density right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 351f373794..e70f240e05 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -257,20 +257,6 @@ public static string GetAbbreviation(DurationUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Duration left, Duration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Duration left, Duration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 40c15616e8..71ea9a2b70 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(DynamicViscosityUnit unit, [CanBeNull] IFor return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(DynamicViscosity left, DynamicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(DynamicViscosity left, DynamicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index d1814b926c..cc4f9f96f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricAdmittanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricAdmittance left, ElectricAdmittance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricAdmittance left, ElectricAdmittance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index de311c02d2..79a455ea2b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricChargeUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCharge left, ElectricCharge right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCharge left, ElectricCharge right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index e5ac919058..8d9add2e54 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricChargeDensityUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricChargeDensity left, ElectricChargeDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricChargeDensity left, ElectricChargeDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index c8e5ee97db..af78377c84 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ElectricConductanceUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricConductance left, ElectricConductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricConductance left, ElectricConductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d74de9be33..6500618905 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricConductivityUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricConductivity left, ElectricConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricConductivity left, ElectricConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 0f5858fe1b..4aceb2c5ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(ElectricCurrentUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrent left, ElectricCurrent right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrent left, ElectricCurrent right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4ac621d58f..becc8ec8a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricCurrentDensityUnit unit, [CanBeNull return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrentDensity left, ElectricCurrentDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrentDensity left, ElectricCurrentDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 1bdea233a1..e3bc19a99c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricCurrentGradientUnit unit, [CanBeNul return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricCurrentGradient left, ElectricCurrentGradient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricCurrentGradient left, ElectricCurrentGradient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 5f7b4d55cd..39452e92ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricFieldUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricField left, ElectricField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricField left, ElectricField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 8b8e0060e5..79980fef27 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(ElectricInductanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricInductance left, ElectricInductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricInductance left, ElectricInductance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index f9cebf55a4..9994c173c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotential left, ElectricPotential right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotential left, ElectricPotential right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index f3df5f0762..cb3dd8ab0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialAcUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotentialAc left, ElectricPotentialAc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotentialAc left, ElectricPotentialAc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index ea6f85c7ae..9292794555 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ElectricPotentialDcUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricPotentialDc left, ElectricPotentialDc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricPotentialDc left, ElectricPotentialDc right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index df944cce7a..a3ec5546fd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricResistanceUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricResistance left, ElectricResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricResistance left, ElectricResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index e909be0ec1..32c54bfb66 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ElectricResistivityUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ElectricResistivity left, ElectricResistivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ElectricResistivity left, ElectricResistivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 0aab5ee9a9..77a86e561b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -347,20 +347,6 @@ public static string GetAbbreviation(EnergyUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Energy left, Energy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Energy left, Energy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 1e174a2486..cf8dbb9521 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -212,20 +212,6 @@ public static string GetAbbreviation(EntropyUnit unit, [CanBeNull] IFormatProvid return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Entropy left, Entropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Entropy left, Entropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs index 1530fa6888..3feb3a5a62 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs @@ -365,20 +365,6 @@ public static string GetAbbreviation(FlowUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Flow left, Flow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index d741260a28..9ebb6099de 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -239,20 +239,6 @@ public static string GetAbbreviation(ForceUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Force left, Force right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Force left, Force right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 1c5ec27ce0..1830a881da 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -248,20 +248,6 @@ public static string GetAbbreviation(ForceChangeRateUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ForceChangeRate left, ForceChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ForceChangeRate left, ForceChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index a221b700b4..f725f96d81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -230,20 +230,6 @@ public static string GetAbbreviation(ForcePerLengthUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ForcePerLength left, ForcePerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ForcePerLength left, ForcePerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 649b2a2c52..871f03d11f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(FrequencyUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Frequency left, Frequency right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Frequency left, Frequency right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 3e1fdde1d7..f1c0910311 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -293,20 +293,6 @@ public static string GetAbbreviation(HeatFluxUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(HeatFlux left, HeatFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(HeatFlux left, HeatFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index cf0bf1e253..4acb91b185 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(HeatTransferCoefficientUnit unit, [CanBeNul return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(HeatTransferCoefficient left, HeatTransferCoefficient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(HeatTransferCoefficient left, HeatTransferCoefficient right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 16e9931409..22a3ac2e3f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(IlluminanceUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Illuminance left, Illuminance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Illuminance left, Illuminance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index bf562afe24..f7c313d6f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -383,18 +383,6 @@ public static string GetAbbreviation(InformationUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(Information left, Information right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(Information left, Information right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 8a1ef1ab60..0c1c4e8f7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(IrradianceUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Irradiance left, Irradiance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Irradiance left, Irradiance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 486da8cd88..1c5a322dac 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(IrradiationUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Irradiation left, Irradiation right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Irradiation left, Irradiation right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index c9d49d1d19..7b0dd7d370 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(KinematicViscosityUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(KinematicViscosity left, KinematicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(KinematicViscosity left, KinematicViscosity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1cd3e7621f..5064f495a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LapseRateUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LapseRate left, LapseRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LapseRate left, LapseRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index f15c49f2f5..35b75bd61b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -347,20 +347,6 @@ public static string GetAbbreviation(LengthUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Length left, Length right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Length left, Length right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 75bab150c4..17214b7202 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -175,20 +175,6 @@ public static string GetAbbreviation(LevelUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Level left, Level right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Level left, Level right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index b2c1100816..a5ce6de6f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(LinearDensityUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LinearDensity left, LinearDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LinearDensity left, LinearDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 778aabad6d..6f418ef2d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LuminousFluxUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LuminousFlux left, LuminousFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LuminousFlux left, LuminousFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 56388d68d1..626e4293b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(LuminousIntensityUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(LuminousIntensity left, LuminousIntensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(LuminousIntensity left, LuminousIntensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 636e0610cb..c2c14df516 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagneticFieldUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MagneticField left, MagneticField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MagneticField left, MagneticField right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index f3f3eefdb3..a390959ed0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagneticFluxUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MagneticFlux left, MagneticFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MagneticFlux left, MagneticFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 9ee47929f2..a66a45d478 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(MagnetizationUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Magnetization left, Magnetization right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Magnetization left, Magnetization right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index a2aff8b53e..0ffc4ce043 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -338,20 +338,6 @@ public static string GetAbbreviation(MassUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Mass left, Mass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Mass left, Mass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index e90181d29f..2e7158bdc1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -284,20 +284,6 @@ public static string GetAbbreviation(MassFlowUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassFlow left, MassFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassFlow left, MassFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index ff966c6ddb..708514cb02 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(MassFluxUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassFlux left, MassFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassFlux left, MassFlux right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 009ea8b31d..c45d040c61 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -383,20 +383,6 @@ public static string GetAbbreviation(MassMomentOfInertiaUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MassMomentOfInertia left, MassMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MassMomentOfInertia left, MassMomentOfInertia right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 0eedd254a6..c471ecff0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(MolarEnergyUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarEnergy left, MolarEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarEnergy left, MolarEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 854cf36bea..7c9a6617dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(MolarEntropyUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarEntropy left, MolarEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarEntropy left, MolarEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index a04598777e..791565bf01 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -257,20 +257,6 @@ public static string GetAbbreviation(MolarMassUnit unit, [CanBeNull] IFormatProv return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(MolarMass left, MolarMass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(MolarMass left, MolarMass right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index c431a9a647..f8ba36dc26 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(MolarityUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Molarity left, Molarity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Molarity left, Molarity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index d767808955..1e5c230ea6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(PermeabilityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Permeability left, Permeability right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Permeability left, Permeability right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 4891ceb3de..0a27fa02f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(PermittivityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Permittivity left, Permittivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Permittivity left, Permittivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 9287d3cbb3..6d9af936d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -329,18 +329,6 @@ public static string GetAbbreviation(PowerUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - public static bool operator ==(Power left, Power right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - public static bool operator !=(Power left, Power right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index c1612bea8f..bee5470e28 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -545,20 +545,6 @@ public static string GetAbbreviation(PowerDensityUnit unit, [CanBeNull] IFormatP return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PowerDensity left, PowerDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PowerDensity left, PowerDensity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index fb8b9b3639..1a3cbfe419 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -175,20 +175,6 @@ public static string GetAbbreviation(PowerRatioUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PowerRatio left, PowerRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PowerRatio left, PowerRatio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 251ae0bce2..246c0248d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -491,20 +491,6 @@ public static string GetAbbreviation(PressureUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Pressure left, Pressure right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Pressure left, Pressure right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index e9133a77a8..cd0a41f8a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(PressureChangeRateUnit unit, [CanBeNull] IF return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(PressureChangeRate left, PressureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(PressureChangeRate left, PressureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 993c2015d3..8862c5769f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -203,20 +203,6 @@ public static string GetAbbreviation(RatioUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Ratio left, Ratio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Ratio left, Ratio right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 390183475b..e8207d067e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(ReactiveEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ReactiveEnergy left, ReactiveEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ReactiveEnergy left, ReactiveEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 086effb16a..160e450433 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -185,20 +185,6 @@ public static string GetAbbreviation(ReactivePowerUnit unit, [CanBeNull] IFormat return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ReactivePower left, ReactivePower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ReactivePower left, ReactivePower right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 16b0a47185..c1aac79709 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalAccelerationUnit unit, [CanBeNull return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalAcceleration left, RotationalAcceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalAcceleration left, RotationalAcceleration right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index baf25cc9cf..d80bcd0c84 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -266,20 +266,6 @@ public static string GetAbbreviation(RotationalSpeedUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalSpeed left, RotationalSpeed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalSpeed left, RotationalSpeed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index db4b15e846..635fe64fdf 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalStiffnessUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalStiffness left, RotationalStiffness right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalStiffness left, RotationalStiffness right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 0a41d0fef4..3185bd92f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -176,20 +176,6 @@ public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit, [Can return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 802e37b63a..3c23ce20e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(SolidAngleUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SolidAngle left, SolidAngle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SolidAngle left, SolidAngle right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 5d6fd503d4..88300d9590 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(SpecificEnergyUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificEnergy left, SpecificEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificEnergy left, SpecificEnergy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index df6ff742b1..d20600f5ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -221,20 +221,6 @@ public static string GetAbbreviation(SpecificEntropyUnit unit, [CanBeNull] IForm return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificEntropy left, SpecificEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificEntropy left, SpecificEntropy right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 1e06b97f10..695f5eaa54 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(SpecificVolumeUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificVolume left, SpecificVolume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificVolume left, SpecificVolume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 417b4170e6..e863c6c3b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -302,20 +302,6 @@ public static string GetAbbreviation(SpecificWeightUnit unit, [CanBeNull] IForma return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(SpecificWeight left, SpecificWeight right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(SpecificWeight left, SpecificWeight right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index daf8ab45d8..f6aede04a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -437,20 +437,6 @@ public static string GetAbbreviation(SpeedUnit unit, [CanBeNull] IFormatProvider return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Speed left, Speed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Speed left, Speed right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 920828df1b..a368122031 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -182,20 +182,6 @@ public static string GetAbbreviation(TemperatureUnit unit, [CanBeNull] IFormatPr return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Temperature left, Temperature right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Temperature left, Temperature right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 87c254bb63..de51fe0be5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -239,20 +239,6 @@ public static string GetAbbreviation(TemperatureChangeRateUnit unit, [CanBeNull] return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(TemperatureChangeRate left, TemperatureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(TemperatureChangeRate left, TemperatureChangeRate right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1a85aa86c7..03c02671a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -293,20 +293,6 @@ public static string GetAbbreviation(TemperatureDeltaUnit unit, [CanBeNull] IFor return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(TemperatureDelta left, TemperatureDelta right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(TemperatureDelta left, TemperatureDelta right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 9d4eb1d11e..78c5f00e09 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -167,20 +167,6 @@ public static string GetAbbreviation(ThermalConductivityUnit unit, [CanBeNull] I return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ThermalConductivity left, ThermalConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ThermalConductivity left, ThermalConductivity right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 8924ea7ab4..8cd0081ba2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -194,20 +194,6 @@ public static string GetAbbreviation(ThermalResistanceUnit unit, [CanBeNull] IFo return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(ThermalResistance left, ThermalResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(ThermalResistance left, ThermalResistance right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 3f03228011..ee7d3746d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -338,20 +338,6 @@ public static string GetAbbreviation(TorqueUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Torque left, Torque right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Torque left, Torque right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index b8ff7ad03b..eb5a2f0284 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -158,20 +158,6 @@ public static string GetAbbreviation(VitaminAUnit unit, [CanBeNull] IFormatProvi return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(VitaminA left, VitaminA right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(VitaminA left, VitaminA right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 17ec35b34f..d310e85923 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -545,20 +545,6 @@ public static string GetAbbreviation(VolumeUnit unit, [CanBeNull] IFormatProvide return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(Volume left, Volume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(Volume left, Volume right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index c4f7944647..13211f2989 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -383,20 +383,6 @@ public static string GetAbbreviation(VolumeFlowUnit unit, [CanBeNull] IFormatPro return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator ==(VolumeFlow left, VolumeFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] - public static bool operator !=(VolumeFlow left, VolumeFlow right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 index a95f59ca75..c57ca8574c 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 @@ -315,15 +315,6 @@ if ($obsoleteAttribute) return _value.CompareTo(other.AsBaseNumericType(this.Unit)); } - $($obsoleteEqualityIfDouble)public override bool Equals(object obj) - { - if(obj is null || !(obj is $quantityName)) - return false; - - var objQuantity = ($quantityName)obj; - return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); - } - /// /// /// Compare equality to another $quantityName within the given absolute or relative tolerance. @@ -375,20 +366,6 @@ if ($obsoleteAttribute) return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } - /// - /// Compare equality to another $quantityName by specifying a max allowed difference. - /// Note that it is advised against specifying zero difference, due to the nature - /// of floating point operations and using System.Double internally. - /// - /// Other quantity to compare to. - /// Max error allowed. - /// True if the difference between the two values is not greater than the specified max. - [Obsolete("Please use the Equals($quantityName, double, ComparisonType) overload. This method will be removed in a future version.")] - public bool Equals($quantityName other, $quantityName maxError) - { - return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); - } - /// /// Returns the hash code for this instance. /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 6baf780cb9..25a72ef097 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -209,18 +209,6 @@ namespace UnitsNet return left.Value > right.AsBaseNumericType(left.Unit); } - $($obsoleteEqualityIfDouble)public static bool operator ==($quantityName left, $quantityName right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value == right.AsBaseNumericType(left.Unit); - } - - $($obsoleteEqualityIfDouble)public static bool operator !=($quantityName left, $quantityName right) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - return left.Value != right.AsBaseNumericType(left.Unit); - } - #region Parsing /// diff --git a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 index 37e87d401d..a1ae92fc08 100644 --- a/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateUnitTestBaseClassSourceCode.ps1 @@ -198,28 +198,12 @@ namespace UnitsNet.Tests Assert.Throws(() => $baseUnitVariableName.CompareTo(null)); } - - [Fact] - public void EqualityOperators() - { - $quantityName a = $quantityName.From$baseUnitPluralName(1); - $quantityName b = $quantityName.From$baseUnitPluralName(2); - -// ReSharper disable EqualExpressionComparison - Assert.True(a == a); - Assert.True(a != b); - - Assert.False(a == b); - Assert.False(a != a); -// ReSharper restore EqualExpressionComparison - } - [Fact] public void EqualsIsImplemented() { $quantityName v = $quantityName.From$baseUnitPluralName(1); - Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $quantityName.From$baseUnitPluralName($($baseUnitPluralName)Tolerance))); - Assert.False(v.Equals($quantityName.Zero, $quantityName.From$baseUnitPluralName($($baseUnitPluralName)Tolerance))); + Assert.True(v.Equals($quantityName.From$baseUnitPluralName(1), $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); + Assert.False(v.Equals($quantityName.Zero, $($baseUnitPluralName)Tolerance, ComparisonType.Relative)); } [Fact] From f59e55aa14351e7679f6611b7e34a1768f79baa9 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 24 Sep 2018 14:09:35 -0400 Subject: [PATCH 3/5] Removing nullable methods from quantity classes as well as extension methods --- UnitsNet.Tests/DecimalOverloadTests.cs | 68 --- UnitsNet.Tests/IntOverloadTests.cs | 68 --- UnitsNet.Tests/LongOverloadTests.cs | 68 --- UnitsNet.Tests/NullableConstructors.cs | 90 ---- .../NumberToAccelerationExtensions.g.cs | 104 ----- .../NumberToAmountOfSubstanceExtensions.g.cs | 112 ----- .../NumberToAmplitudeRatioExtensions.g.cs | 32 -- .../Number/NumberToAngleExtensions.g.cs | 112 ----- .../NumberToApparentEnergyExtensions.g.cs | 24 - .../NumberToApparentPowerExtensions.g.cs | 32 -- .../Number/NumberToAreaDensityExtensions.g.cs | 8 - .../Number/NumberToAreaExtensions.g.cs | 104 ----- ...NumberToAreaMomentOfInertiaExtensions.g.cs | 48 -- .../Number/NumberToBitRateExtensions.g.cs | 208 --------- ...rakeSpecificFuelConsumptionExtensions.g.cs | 24 - .../Number/NumberToCapacitanceExtensions.g.cs | 8 - .../Number/NumberToDensityExtensions.g.cs | 304 ------------- .../Number/NumberToDurationExtensions.g.cs | 96 ---- .../NumberToDynamicViscosityExtensions.g.cs | 48 -- .../NumberToElectricAdmittanceExtensions.g.cs | 32 -- ...mberToElectricChargeDensityExtensions.g.cs | 8 - .../NumberToElectricChargeExtensions.g.cs | 8 - ...NumberToElectricConductanceExtensions.g.cs | 24 - ...umberToElectricConductivityExtensions.g.cs | 8 - ...berToElectricCurrentDensityExtensions.g.cs | 8 - .../NumberToElectricCurrentExtensions.g.cs | 64 --- ...erToElectricCurrentGradientExtensions.g.cs | 8 - .../NumberToElectricFieldExtensions.g.cs | 8 - .../NumberToElectricInductanceExtensions.g.cs | 8 - ...NumberToElectricPotentialAcExtensions.g.cs | 40 -- ...NumberToElectricPotentialDcExtensions.g.cs | 40 -- .../NumberToElectricPotentialExtensions.g.cs | 40 -- .../NumberToElectricResistanceExtensions.g.cs | 32 -- ...NumberToElectricResistivityExtensions.g.cs | 32 -- .../Number/NumberToEnergyExtensions.g.cs | 176 -------- .../Number/NumberToEntropyExtensions.g.cs | 56 --- .../Number/NumberToFlowExtensions.g.cs | 192 -------- .../NumberToForceChangeRateExtensions.g.cs | 88 ---- .../Number/NumberToForceExtensions.g.cs | 80 ---- .../NumberToForcePerLengthExtensions.g.cs | 72 --- .../Number/NumberToFrequencyExtensions.g.cs | 56 --- .../Number/NumberToHeatFluxExtensions.g.cs | 128 ------ ...erToHeatTransferCoefficientExtensions.g.cs | 16 - .../Number/NumberToIlluminanceExtensions.g.cs | 32 -- .../Number/NumberToInformationExtensions.g.cs | 208 --------- .../Number/NumberToIrradianceExtensions.g.cs | 16 - .../Number/NumberToIrradiationExtensions.g.cs | 24 - .../NumberToKinematicViscosityExtensions.g.cs | 64 --- .../Number/NumberToLapseRateExtensions.g.cs | 8 - .../Number/NumberToLengthExtensions.g.cs | 176 -------- .../Number/NumberToLevelExtensions.g.cs | 16 - .../NumberToLinearDensityExtensions.g.cs | 24 - .../NumberToLuminousFluxExtensions.g.cs | 8 - .../NumberToLuminousIntensityExtensions.g.cs | 8 - .../NumberToMagneticFieldExtensions.g.cs | 8 - .../NumberToMagneticFluxExtensions.g.cs | 8 - .../NumberToMagnetizationExtensions.g.cs | 8 - .../Number/NumberToMassExtensions.g.cs | 168 ------- .../Number/NumberToMassFlowExtensions.g.cs | 120 ----- .../Number/NumberToMassFluxExtensions.g.cs | 16 - ...NumberToMassMomentOfInertiaExtensions.g.cs | 208 --------- .../Number/NumberToMolarEnergyExtensions.g.cs | 24 - .../NumberToMolarEntropyExtensions.g.cs | 24 - .../Number/NumberToMolarMassExtensions.g.cs | 96 ---- .../Number/NumberToMolarityExtensions.g.cs | 64 --- .../NumberToPermeabilityExtensions.g.cs | 8 - .../NumberToPermittivityExtensions.g.cs | 8 - .../NumberToPowerDensityExtensions.g.cs | 352 --------------- .../Number/NumberToPowerExtensions.g.cs | 160 ------- .../Number/NumberToPowerRatioExtensions.g.cs | 16 - .../NumberToPressureChangeRateExtensions.g.cs | 32 -- .../Number/NumberToPressureExtensions.g.cs | 304 ------------- .../Number/NumberToRatioExtensions.g.cs | 48 -- .../NumberToReactiveEnergyExtensions.g.cs | 24 - .../NumberToReactivePowerExtensions.g.cs | 32 -- ...berToRotationalAccelerationExtensions.g.cs | 24 - .../NumberToRotationalSpeedExtensions.g.cs | 104 ----- ...NumberToRotationalStiffnessExtensions.g.cs | 24 - ...otationalStiffnessPerLengthExtensions.g.cs | 24 - .../Number/NumberToSolidAngleExtensions.g.cs | 8 - .../NumberToSpecificEnergyExtensions.g.cs | 64 --- .../NumberToSpecificEntropyExtensions.g.cs | 64 --- .../NumberToSpecificVolumeExtensions.g.cs | 16 - .../NumberToSpecificWeightExtensions.g.cs | 136 ------ .../Number/NumberToSpeedExtensions.g.cs | 256 ----------- ...mberToTemperatureChangeRateExtensions.g.cs | 80 ---- .../NumberToTemperatureDeltaExtensions.g.cs | 128 ------ .../Number/NumberToTemperatureExtensions.g.cs | 64 --- ...NumberToThermalConductivityExtensions.g.cs | 16 - .../NumberToThermalResistanceExtensions.g.cs | 40 -- .../Number/NumberToTorqueExtensions.g.cs | 168 ------- .../Number/NumberToVitaminAExtensions.g.cs | 8 - .../Number/NumberToVolumeExtensions.g.cs | 352 --------------- .../Number/NumberToVolumeFlowExtensions.g.cs | 208 --------- .../Quantities/Acceleration.NetFramework.g.cs | 133 ------ .../AmountOfSubstance.NetFramework.g.cs | 142 ------ .../AmplitudeRatio.NetFramework.g.cs | 52 --- .../Quantities/Angle.NetFramework.g.cs | 142 ------ .../ApparentEnergy.NetFramework.g.cs | 43 -- .../ApparentPower.NetFramework.g.cs | 52 --- .../Quantities/Area.NetFramework.g.cs | 133 ------ .../Quantities/AreaDensity.NetFramework.g.cs | 25 -- .../AreaMomentOfInertia.NetFramework.g.cs | 70 --- .../Quantities/BitRate.NetFramework.g.cs | 250 ----------- ...eSpecificFuelConsumption.NetFramework.g.cs | 43 -- .../Quantities/Capacitance.NetFramework.g.cs | 25 -- .../Quantities/Density.NetFramework.g.cs | 358 --------------- .../Quantities/Duration.NetFramework.g.cs | 124 ------ .../DynamicViscosity.NetFramework.g.cs | 70 --- .../ElectricAdmittance.NetFramework.g.cs | 52 --- .../ElectricCharge.NetFramework.g.cs | 25 -- .../ElectricChargeDensity.NetFramework.g.cs | 25 -- .../ElectricConductance.NetFramework.g.cs | 43 -- .../ElectricConductivity.NetFramework.g.cs | 25 -- .../ElectricCurrent.NetFramework.g.cs | 88 ---- .../ElectricCurrentDensity.NetFramework.g.cs | 25 -- .../ElectricCurrentGradient.NetFramework.g.cs | 25 -- .../ElectricField.NetFramework.g.cs | 25 -- .../ElectricInductance.NetFramework.g.cs | 25 -- .../ElectricPotential.NetFramework.g.cs | 61 --- .../ElectricPotentialAc.NetFramework.g.cs | 61 --- .../ElectricPotentialDc.NetFramework.g.cs | 61 --- .../ElectricResistance.NetFramework.g.cs | 52 --- .../ElectricResistivity.NetFramework.g.cs | 52 --- .../Quantities/Energy.NetFramework.g.cs | 214 --------- .../Quantities/Entropy.NetFramework.g.cs | 79 ---- .../Quantities/Flow.NetFramework.g.cs | 232 ---------- .../Quantities/Force.NetFramework.g.cs | 106 ----- .../ForceChangeRate.NetFramework.g.cs | 115 ----- .../ForcePerLength.NetFramework.g.cs | 97 ----- .../Quantities/Frequency.NetFramework.g.cs | 88 ---- .../Quantities/HeatFlux.NetFramework.g.cs | 160 ------- .../HeatTransferCoefficient.NetFramework.g.cs | 34 -- .../Quantities/Illuminance.NetFramework.g.cs | 52 --- .../Quantities/Information.NetFramework.g.cs | 250 ----------- .../Quantities/Irradiance.NetFramework.g.cs | 34 -- .../Quantities/Irradiation.NetFramework.g.cs | 43 -- .../KinematicViscosity.NetFramework.g.cs | 88 ---- .../Quantities/LapseRate.NetFramework.g.cs | 25 -- .../Quantities/Length.NetFramework.g.cs | 214 --------- .../Quantities/Level.NetFramework.g.cs | 34 -- .../LinearDensity.NetFramework.g.cs | 43 -- .../Quantities/LuminousFlux.NetFramework.g.cs | 25 -- .../LuminousIntensity.NetFramework.g.cs | 25 -- .../MagneticField.NetFramework.g.cs | 25 -- .../Quantities/MagneticFlux.NetFramework.g.cs | 25 -- .../Magnetization.NetFramework.g.cs | 25 -- .../Quantities/Mass.NetFramework.g.cs | 205 --------- .../Quantities/MassFlow.NetFramework.g.cs | 151 ------- .../Quantities/MassFlux.NetFramework.g.cs | 34 -- .../MassMomentOfInertia.NetFramework.g.cs | 250 ----------- .../Quantities/MolarEnergy.NetFramework.g.cs | 43 -- .../Quantities/MolarEntropy.NetFramework.g.cs | 43 -- .../Quantities/MolarMass.NetFramework.g.cs | 124 ------ .../Quantities/Molarity.NetFramework.g.cs | 88 ---- .../Quantities/Permeability.NetFramework.g.cs | 25 -- .../Quantities/Permittivity.NetFramework.g.cs | 25 -- .../Quantities/Power.NetFramework.g.cs | 196 --------- .../Quantities/PowerDensity.NetFramework.g.cs | 412 ------------------ .../Quantities/PowerRatio.NetFramework.g.cs | 34 -- .../Quantities/Pressure.NetFramework.g.cs | 358 --------------- .../PressureChangeRate.NetFramework.g.cs | 52 --- .../Quantities/Ratio.NetFramework.g.cs | 70 --- .../ReactiveEnergy.NetFramework.g.cs | 43 -- .../ReactivePower.NetFramework.g.cs | 52 --- .../RotationalAcceleration.NetFramework.g.cs | 43 -- .../RotationalSpeed.NetFramework.g.cs | 133 ------ .../RotationalStiffness.NetFramework.g.cs | 43 -- ...tionalStiffnessPerLength.NetFramework.g.cs | 43 -- .../Quantities/SolidAngle.NetFramework.g.cs | 25 -- .../SpecificEnergy.NetFramework.g.cs | 88 ---- .../SpecificEntropy.NetFramework.g.cs | 88 ---- .../SpecificVolume.NetFramework.g.cs | 34 -- .../SpecificWeight.NetFramework.g.cs | 169 ------- .../Quantities/Speed.NetFramework.g.cs | 304 ------------- .../Quantities/Temperature.NetFramework.g.cs | 88 ---- .../TemperatureChangeRate.NetFramework.g.cs | 106 ----- .../TemperatureDelta.NetFramework.g.cs | 160 ------- .../ThermalConductivity.NetFramework.g.cs | 34 -- .../ThermalResistance.NetFramework.g.cs | 61 --- .../Quantities/Torque.NetFramework.g.cs | 205 --------- .../Quantities/VitaminA.NetFramework.g.cs | 25 -- .../Quantities/Volume.NetFramework.g.cs | 412 ------------------ .../Quantities/VolumeFlow.NetFramework.g.cs | 250 ----------- ...ude-GenerateNumberExtensionsSourceCode.ps1 | 8 - ...GenerateQuantitySourceCodeNetFramework.ps1 | 28 -- 186 files changed, 15770 deletions(-) delete mode 100644 UnitsNet.Tests/NullableConstructors.cs diff --git a/UnitsNet.Tests/DecimalOverloadTests.cs b/UnitsNet.Tests/DecimalOverloadTests.cs index f19e131a14..3b38d2e36e 100644 --- a/UnitsNet.Tests/DecimalOverloadTests.cs +++ b/UnitsNet.Tests/DecimalOverloadTests.cs @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromDecimalReturnsCorre Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalReturnsCorrectValue() - { - decimal? oneMeterPerSecondSquared = 1m; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalReturnsNullWhenGivenNull() - { - decimal? nullDecimal = null; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullDecimal); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithDoubleBackingFieldFromDecimalWithExtensionMethodReturnsCorrectValue() { @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromDecimalWithExtensio Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalWithExtensionMethodReturnsCorrectValue() - { - decimal? oneMeterPerSecondSquared = 1m; - Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared(); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalWithExtensionMethodReturnsNullWhenGivenNull() - { - decimal? nullDecimal = null; - Acceleration? acceleration = nullDecimal.MetersPerSecondSquared(); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithDecimalBackingFieldFromDecimalReturnsCorrectValue() { @@ -85,23 +51,6 @@ public static void CreatingQuantityWithDecimalBackingFieldFromDecimalReturnsCorr Assert.Equal(1.0, power.Watts); } - [Fact] - public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalReturnsCorrectValue() - { - decimal? oneWatt = 1m; - Power? power = Power.FromWatts(oneWatt); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalReturnsNullWhenGivenNull() - { - decimal? nullDecimal = null; - Power? power = Power.FromWatts(nullDecimal); - Assert.Null(power); - } - [Fact] public static void CreatingQuantityWithDecimalBackingFieldFromDecimalWithExtensionMethodReturnsCorrectValue() { @@ -109,22 +58,5 @@ public static void CreatingQuantityWithDecimalBackingFieldFromDecimalWithExtensi Power power = oneWatt.Watts(); Assert.Equal(1.0, power.Watts); } - - [Fact] - public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalWithExtensionMethodReturnsCorrectValue() - { - decimal? oneWatt = 1m; - Power? power = oneWatt.Watts(); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalWithExtensionMethodReturnsNullWhenGivenNull() - { - decimal? nullDecimal = null; - Power? power = nullDecimal.Watts(); - Assert.Null(power); - } } } diff --git a/UnitsNet.Tests/IntOverloadTests.cs b/UnitsNet.Tests/IntOverloadTests.cs index 3a762ecb54..1ffc8c75fa 100644 --- a/UnitsNet.Tests/IntOverloadTests.cs +++ b/UnitsNet.Tests/IntOverloadTests.cs @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromIntReturnsCorrectVa Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntReturnsCorrectValue() - { - int? oneMeterPerSecondSquared = 1; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntReturnsNullWhenGivenNull() - { - int? nullInt = null; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullInt); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithDoubleBackingFieldFromIntWithExtensionMethodReturnsCorrectValue() { @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromIntWithExtensionMet Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntWithExtensionMethodReturnsCorrectValue() - { - int? oneMeterPerSecondSquared = 1; - Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared(); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntWithExtensionMethodReturnsNullWhenGivenNull() - { - int? nullInt = null; - Acceleration? acceleration = nullInt.MetersPerSecondSquared(); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithIntBackingFieldFromIntReturnsCorrectValue() { @@ -85,23 +51,6 @@ public static void CreatingQuantityWithIntBackingFieldFromIntReturnsCorrectValue Assert.Equal(1.0, power.Watts); } - [Fact] - public static void CreatingQuantityWithIntBackingFieldFromNullableIntReturnsCorrectValue() - { - int? oneWatt = 1; - Power? power = Power.FromWatts(oneWatt); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithIntBackingFieldFromNullableIntReturnsNullWhenGivenNull() - { - int? nullInt = null; - Power? power = Power.FromWatts(nullInt); - Assert.Null(power); - } - [Fact] public static void CreatingQuantityWithIntBackingFieldFromIntWithExtensionMethodReturnsCorrectValue() { @@ -109,22 +58,5 @@ public static void CreatingQuantityWithIntBackingFieldFromIntWithExtensionMethod Power power = oneWatt.Watts(); Assert.Equal(1.0, power.Watts); } - - [Fact] - public static void CreatingQuantityWithIntBackingFieldFromNullableIntWithExtensionMethodReturnsCorrectValue() - { - int? oneWatt = 1; - Power? power = oneWatt.Watts(); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithIntBackingFieldFromNullableIntWithExtensionMethodReturnsNullWhenGivenNull() - { - int? nullInt = null; - Power? power = nullInt.Watts(); - Assert.Null(power); - } } } diff --git a/UnitsNet.Tests/LongOverloadTests.cs b/UnitsNet.Tests/LongOverloadTests.cs index d64ee9fa03..97851720bf 100644 --- a/UnitsNet.Tests/LongOverloadTests.cs +++ b/UnitsNet.Tests/LongOverloadTests.cs @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromLongReturnsCorrectV Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongReturnsCorrectValue() - { - long? oneMeterPerSecondSquared = 1; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongReturnsNullWhenGivenNull() - { - long? nullLong = null; - Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullLong); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithDoubleBackingFieldFromLongWithExtensionMethodReturnsCorrectValue() { @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromLongWithExtensionMe Assert.Equal(1.0, acceleration.MetersPerSecondSquared); } - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongWithExtensionMethodReturnsCorrectValue() - { - long? oneMeterPerSecondSquared = 1; - Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared(); - Assert.NotNull(acceleration); - Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared); - } - - [Fact] - public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongWithExtensionMethodReturnsNullWhenGivenNull() - { - long? nullLong = null; - Acceleration? acceleration = nullLong.MetersPerSecondSquared(); - Assert.Null(acceleration); - } - [Fact] public static void CreatingQuantityWithLongBackingFieldFromLongReturnsCorrectValue() { @@ -85,23 +51,6 @@ public static void CreatingQuantityWithLongBackingFieldFromLongReturnsCorrectVal Assert.Equal(1.0, power.Watts); } - [Fact] - public static void CreatingQuantityWithLongBackingFieldFromNullableLongReturnsCorrectValue() - { - long? oneWatt = 1; - Power? power = Power.FromWatts(oneWatt); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithLongBackingFieldFromNullableLongReturnsNullWhenGivenNull() - { - long? nullLong = null; - Power? power = Power.FromWatts(nullLong); - Assert.Null(power); - } - [Fact] public static void CreatingQuantityWithLongBackingFieldFromLongWithExtensionMethodReturnsCorrectValue() { @@ -109,22 +58,5 @@ public static void CreatingQuantityWithLongBackingFieldFromLongWithExtensionMeth Power power = oneWatt.Watts(); Assert.Equal(1.0, power.Watts); } - - [Fact] - public static void CreatingQuantityWithLongBackingFieldFromNullableLongWithExtensionMethodReturnsCorrectValue() - { - long? oneWatt = 1; - Power? power = oneWatt.Watts(); - Assert.NotNull(power); - Assert.Equal(1.0, power.Value.Watts); - } - - [Fact] - public static void CreatingQuantityWithLongBackingFieldFromNullableLongWithExtensionMethodReturnsNullWhenGivenNull() - { - long? nullLong = null; - Power? power = nullLong.Watts(); - Assert.Null(power); - } } } diff --git a/UnitsNet.Tests/NullableConstructors.cs b/UnitsNet.Tests/NullableConstructors.cs deleted file mode 100644 index 1322b96956..0000000000 --- a/UnitsNet.Tests/NullableConstructors.cs +++ /dev/null @@ -1,90 +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 Xunit; -using UnitsNet.Units; - -namespace UnitsNet.Tests -{ - public class NullableConstructors - { - [Fact] - public void StaticConstructorWithNullReturnsNullWhenBackingTypeIsDouble() - { - Length? meter = Length.FromMeters(null); - Assert.False(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullAndEnumReturnsNullWhenBackingTypeIsDouble() - { - Length? meter = Length.From(null, LengthUnit.Meter); - Assert.False(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullAndEnumArgumentReturnsValueWhenInputArgumentHasValueWhenBackingTypeIsDouble() - { - double? value = 1.0; - Length? meter = Length.From(value, LengthUnit.Meter); - Assert.True(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullArgumentReturnsValueWhenInputArgumentHasValueWhenBackingTypeIsDouble() - { - double? value = 1.0; - Length? meter = Length.FromMeters(value); - Assert.True(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullReturnsNullWhenBackingTypeIsDecimal() - { - Information? meter = Information.FromBytes(null); - Assert.False(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullAndEnumReturnsNullWhenBackingTypeIsDecimal() - { - Information? meter = Information.From(null, InformationUnit.Byte); - Assert.False(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullAndEnumArgumentReturnsValueWhenInputArgumentHasValueWhenBackingTypeIsDecimal() - { - double? value = 1.0; - Information? meter = Information.From(value, InformationUnit.Byte); - Assert.True(meter.HasValue); - } - - [Fact] - public void StaticConstructorWithNullArgumentReturnsValueWhenInputArgumentHasValueWhenBackingTypeIsDecimal() - { - double? value = 1.0; - Information? meter = Information.FromBytes(value); - Assert.True(meter.HasValue); - } - } -} \ No newline at end of file diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAccelerationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAccelerationExtensions.g.cs index 9fc9b9cc5b..7cede6880d 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAccelerationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAccelerationExtensions.g.cs @@ -44,149 +44,45 @@ namespace UnitsNet.Extensions.NumberToAcceleration { public static class NumberToAccelerationExtensions { - #region CentimeterPerSecondSquared - /// public static Acceleration CentimetersPerSecondSquared(this T value) => Acceleration.FromCentimetersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? CentimetersPerSecondSquared(this T? value) where T : struct => Acceleration.FromCentimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecimeterPerSecondSquared - /// public static Acceleration DecimetersPerSecondSquared(this T value) => Acceleration.FromDecimetersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? DecimetersPerSecondSquared(this T? value) where T : struct => Acceleration.FromDecimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootPerSecondSquared - /// public static Acceleration FeetPerSecondSquared(this T value) => Acceleration.FromFeetPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? FeetPerSecondSquared(this T? value) where T : struct => Acceleration.FromFeetPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchPerSecondSquared - /// public static Acceleration InchesPerSecondSquared(this T value) => Acceleration.FromInchesPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? InchesPerSecondSquared(this T? value) where T : struct => Acceleration.FromInchesPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilometerPerSecondSquared - /// public static Acceleration KilometersPerSecondSquared(this T value) => Acceleration.FromKilometersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? KilometersPerSecondSquared(this T? value) where T : struct => Acceleration.FromKilometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KnotPerHour - /// public static Acceleration KnotsPerHour(this T value) => Acceleration.FromKnotsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? KnotsPerHour(this T? value) where T : struct => Acceleration.FromKnotsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KnotPerMinute - /// public static Acceleration KnotsPerMinute(this T value) => Acceleration.FromKnotsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? KnotsPerMinute(this T? value) where T : struct => Acceleration.FromKnotsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KnotPerSecond - /// public static Acceleration KnotsPerSecond(this T value) => Acceleration.FromKnotsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? KnotsPerSecond(this T? value) where T : struct => Acceleration.FromKnotsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterPerSecondSquared - /// public static Acceleration MetersPerSecondSquared(this T value) => Acceleration.FromMetersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? MetersPerSecondSquared(this T? value) where T : struct => Acceleration.FromMetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrometerPerSecondSquared - /// public static Acceleration MicrometersPerSecondSquared(this T value) => Acceleration.FromMicrometersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? MicrometersPerSecondSquared(this T? value) where T : struct => Acceleration.FromMicrometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterPerSecondSquared - /// public static Acceleration MillimetersPerSecondSquared(this T value) => Acceleration.FromMillimetersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? MillimetersPerSecondSquared(this T? value) where T : struct => Acceleration.FromMillimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanometerPerSecondSquared - /// public static Acceleration NanometersPerSecondSquared(this T value) => Acceleration.FromNanometersPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? NanometersPerSecondSquared(this T? value) where T : struct => Acceleration.FromNanometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region StandardGravity - /// public static Acceleration StandardGravity(this T value) => Acceleration.FromStandardGravity(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? StandardGravity(this T? value) where T : struct => Acceleration.FromStandardGravity(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmountOfSubstanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmountOfSubstanceExtensions.g.cs index f51cf4316b..8a00acba39 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmountOfSubstanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmountOfSubstanceExtensions.g.cs @@ -44,160 +44,48 @@ namespace UnitsNet.Extensions.NumberToAmountOfSubstance { public static class NumberToAmountOfSubstanceExtensions { - #region Centimole - /// public static AmountOfSubstance Centimoles(this T value) => AmountOfSubstance.FromCentimoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Centimoles(this T? value) where T : struct => AmountOfSubstance.FromCentimoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentipoundMole - /// public static AmountOfSubstance CentipoundMoles(this T value) => AmountOfSubstance.FromCentipoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? CentipoundMoles(this T? value) where T : struct => AmountOfSubstance.FromCentipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decimole - /// public static AmountOfSubstance Decimoles(this T value) => AmountOfSubstance.FromDecimoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Decimoles(this T? value) where T : struct => AmountOfSubstance.FromDecimoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecipoundMole - /// public static AmountOfSubstance DecipoundMoles(this T value) => AmountOfSubstance.FromDecipoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? DecipoundMoles(this T? value) where T : struct => AmountOfSubstance.FromDecipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilomole - /// public static AmountOfSubstance Kilomoles(this T value) => AmountOfSubstance.FromKilomoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Kilomoles(this T? value) where T : struct => AmountOfSubstance.FromKilomoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundMole - /// public static AmountOfSubstance KilopoundMoles(this T value) => AmountOfSubstance.FromKilopoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? KilopoundMoles(this T? value) where T : struct => AmountOfSubstance.FromKilopoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Micromole - /// public static AmountOfSubstance Micromoles(this T value) => AmountOfSubstance.FromMicromoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Micromoles(this T? value) where T : struct => AmountOfSubstance.FromMicromoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicropoundMole - /// public static AmountOfSubstance MicropoundMoles(this T value) => AmountOfSubstance.FromMicropoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? MicropoundMoles(this T? value) where T : struct => AmountOfSubstance.FromMicropoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millimole - /// public static AmountOfSubstance Millimoles(this T value) => AmountOfSubstance.FromMillimoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Millimoles(this T? value) where T : struct => AmountOfSubstance.FromMillimoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillipoundMole - /// public static AmountOfSubstance MillipoundMoles(this T value) => AmountOfSubstance.FromMillipoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? MillipoundMoles(this T? value) where T : struct => AmountOfSubstance.FromMillipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Mole - /// public static AmountOfSubstance Moles(this T value) => AmountOfSubstance.FromMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Moles(this T? value) where T : struct => AmountOfSubstance.FromMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanomole - /// public static AmountOfSubstance Nanomoles(this T value) => AmountOfSubstance.FromNanomoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? Nanomoles(this T? value) where T : struct => AmountOfSubstance.FromNanomoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanopoundMole - /// public static AmountOfSubstance NanopoundMoles(this T value) => AmountOfSubstance.FromNanopoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? NanopoundMoles(this T? value) where T : struct => AmountOfSubstance.FromNanopoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundMole - /// public static AmountOfSubstance PoundMoles(this T value) => AmountOfSubstance.FromPoundMoles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? PoundMoles(this T? value) where T : struct => AmountOfSubstance.FromPoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmplitudeRatioExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmplitudeRatioExtensions.g.cs index c65efd7352..7b6ccbc891 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmplitudeRatioExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAmplitudeRatioExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToAmplitudeRatio { public static class NumberToAmplitudeRatioExtensions { - #region DecibelMicrovolt - /// public static AmplitudeRatio DecibelMicrovolts(this T value) => AmplitudeRatio.FromDecibelMicrovolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmplitudeRatio? DecibelMicrovolts(this T? value) where T : struct => AmplitudeRatio.FromDecibelMicrovolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecibelMillivolt - /// public static AmplitudeRatio DecibelMillivolts(this T value) => AmplitudeRatio.FromDecibelMillivolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmplitudeRatio? DecibelMillivolts(this T? value) where T : struct => AmplitudeRatio.FromDecibelMillivolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecibelUnloaded - /// public static AmplitudeRatio DecibelsUnloaded(this T value) => AmplitudeRatio.FromDecibelsUnloaded(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmplitudeRatio? DecibelsUnloaded(this T? value) where T : struct => AmplitudeRatio.FromDecibelsUnloaded(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecibelVolt - /// public static AmplitudeRatio DecibelVolts(this T value) => AmplitudeRatio.FromDecibelVolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmplitudeRatio? DecibelVolts(this T? value) where T : struct => AmplitudeRatio.FromDecibelVolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAngleExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAngleExtensions.g.cs index 7a6a5ef36a..0b34dcbc7f 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAngleExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAngleExtensions.g.cs @@ -44,160 +44,48 @@ namespace UnitsNet.Extensions.NumberToAngle { public static class NumberToAngleExtensions { - #region Arcminute - /// public static Angle Arcminutes(this T value) => Angle.FromArcminutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Arcminutes(this T? value) where T : struct => Angle.FromArcminutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Arcsecond - /// public static Angle Arcseconds(this T value) => Angle.FromArcseconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Arcseconds(this T? value) where T : struct => Angle.FromArcseconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Centiradian - /// public static Angle Centiradians(this T value) => Angle.FromCentiradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Centiradians(this T? value) where T : struct => Angle.FromCentiradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Deciradian - /// public static Angle Deciradians(this T value) => Angle.FromDeciradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Deciradians(this T? value) where T : struct => Angle.FromDeciradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Degree - /// public static Angle Degrees(this T value) => Angle.FromDegrees(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Degrees(this T? value) where T : struct => Angle.FromDegrees(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gradian - /// public static Angle Gradians(this T value) => Angle.FromGradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Gradians(this T? value) where T : struct => Angle.FromGradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microdegree - /// public static Angle Microdegrees(this T value) => Angle.FromMicrodegrees(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Microdegrees(this T? value) where T : struct => Angle.FromMicrodegrees(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microradian - /// public static Angle Microradians(this T value) => Angle.FromMicroradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Microradians(this T? value) where T : struct => Angle.FromMicroradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millidegree - /// public static Angle Millidegrees(this T value) => Angle.FromMillidegrees(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Millidegrees(this T? value) where T : struct => Angle.FromMillidegrees(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milliradian - /// public static Angle Milliradians(this T value) => Angle.FromMilliradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Milliradians(this T? value) where T : struct => Angle.FromMilliradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanodegree - /// public static Angle Nanodegrees(this T value) => Angle.FromNanodegrees(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Nanodegrees(this T? value) where T : struct => Angle.FromNanodegrees(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanoradian - /// public static Angle Nanoradians(this T value) => Angle.FromNanoradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Nanoradians(this T? value) where T : struct => Angle.FromNanoradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Radian - /// public static Angle Radians(this T value) => Angle.FromRadians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Radians(this T? value) where T : struct => Angle.FromRadians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Revolution - /// public static Angle Revolutions(this T value) => Angle.FromRevolutions(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? Revolutions(this T? value) where T : struct => Angle.FromRevolutions(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentEnergyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentEnergyExtensions.g.cs index b6ff726836..0c007ff083 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentEnergyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentEnergyExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToApparentEnergy { public static class NumberToApparentEnergyExtensions { - #region KilovoltampereHour - /// public static ApparentEnergy KilovoltampereHours(this T value) => ApparentEnergy.FromKilovoltampereHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentEnergy? KilovoltampereHours(this T? value) where T : struct => ApparentEnergy.FromKilovoltampereHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegavoltampereHour - /// public static ApparentEnergy MegavoltampereHours(this T value) => ApparentEnergy.FromMegavoltampereHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentEnergy? MegavoltampereHours(this T? value) where T : struct => ApparentEnergy.FromMegavoltampereHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region VoltampereHour - /// public static ApparentEnergy VoltampereHours(this T value) => ApparentEnergy.FromVoltampereHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentEnergy? VoltampereHours(this T? value) where T : struct => ApparentEnergy.FromVoltampereHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentPowerExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentPowerExtensions.g.cs index ad97cdc78e..17f85155fd 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentPowerExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToApparentPowerExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToApparentPower { public static class NumberToApparentPowerExtensions { - #region Gigavoltampere - /// public static ApparentPower Gigavoltamperes(this T value) => ApparentPower.FromGigavoltamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentPower? Gigavoltamperes(this T? value) where T : struct => ApparentPower.FromGigavoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilovoltampere - /// public static ApparentPower Kilovoltamperes(this T value) => ApparentPower.FromKilovoltamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentPower? Kilovoltamperes(this T? value) where T : struct => ApparentPower.FromKilovoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megavoltampere - /// public static ApparentPower Megavoltamperes(this T value) => ApparentPower.FromMegavoltamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentPower? Megavoltamperes(this T? value) where T : struct => ApparentPower.FromMegavoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Voltampere - /// public static ApparentPower Voltamperes(this T value) => ApparentPower.FromVoltamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentPower? Voltamperes(this T? value) where T : struct => ApparentPower.FromVoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaDensityExtensions.g.cs index c91ee1b15d..6a67802f24 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaDensityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToAreaDensity { public static class NumberToAreaDensityExtensions { - #region KilogramPerSquareMeter - /// public static AreaDensity KilogramsPerSquareMeter(this T value) => AreaDensity.FromKilogramsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaDensity? KilogramsPerSquareMeter(this T? value) where T : struct => AreaDensity.FromKilogramsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaExtensions.g.cs index f9efe3d5f6..aa22221e89 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaExtensions.g.cs @@ -44,149 +44,45 @@ namespace UnitsNet.Extensions.NumberToArea { public static class NumberToAreaExtensions { - #region Acre - /// public static Area Acres(this T value) => Area.FromAcres(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? Acres(this T? value) where T : struct => Area.FromAcres(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hectare - /// public static Area Hectares(this T value) => Area.FromHectares(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? Hectares(this T? value) where T : struct => Area.FromHectares(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareCentimeter - /// public static Area SquareCentimeters(this T value) => Area.FromSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareCentimeters(this T? value) where T : struct => Area.FromSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareDecimeter - /// public static Area SquareDecimeters(this T value) => Area.FromSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareDecimeters(this T? value) where T : struct => Area.FromSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareFoot - /// public static Area SquareFeet(this T value) => Area.FromSquareFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareFeet(this T? value) where T : struct => Area.FromSquareFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareInch - /// public static Area SquareInches(this T value) => Area.FromSquareInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareInches(this T? value) where T : struct => Area.FromSquareInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareKilometer - /// public static Area SquareKilometers(this T value) => Area.FromSquareKilometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareKilometers(this T? value) where T : struct => Area.FromSquareKilometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMeter - /// public static Area SquareMeters(this T value) => Area.FromSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareMeters(this T? value) where T : struct => Area.FromSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMicrometer - /// public static Area SquareMicrometers(this T value) => Area.FromSquareMicrometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareMicrometers(this T? value) where T : struct => Area.FromSquareMicrometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMile - /// public static Area SquareMiles(this T value) => Area.FromSquareMiles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareMiles(this T? value) where T : struct => Area.FromSquareMiles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMillimeter - /// public static Area SquareMillimeters(this T value) => Area.FromSquareMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareMillimeters(this T? value) where T : struct => Area.FromSquareMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareYard - /// public static Area SquareYards(this T value) => Area.FromSquareYards(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? SquareYards(this T? value) where T : struct => Area.FromSquareYards(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsSurveySquareFoot - /// public static Area UsSurveySquareFeet(this T value) => Area.FromUsSurveySquareFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? UsSurveySquareFeet(this T? value) where T : struct => Area.FromUsSurveySquareFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaMomentOfInertiaExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaMomentOfInertiaExtensions.g.cs index e9a5af6b3f..1917cf1a82 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaMomentOfInertiaExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToAreaMomentOfInertiaExtensions.g.cs @@ -44,72 +44,24 @@ namespace UnitsNet.Extensions.NumberToAreaMomentOfInertia { public static class NumberToAreaMomentOfInertiaExtensions { - #region CentimeterToTheFourth - /// public static AreaMomentOfInertia CentimetersToTheFourth(this T value) => AreaMomentOfInertia.FromCentimetersToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? CentimetersToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromCentimetersToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecimeterToTheFourth - /// public static AreaMomentOfInertia DecimetersToTheFourth(this T value) => AreaMomentOfInertia.FromDecimetersToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? DecimetersToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromDecimetersToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootToTheFourth - /// public static AreaMomentOfInertia FeetToTheFourth(this T value) => AreaMomentOfInertia.FromFeetToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? FeetToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromFeetToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchToTheFourth - /// public static AreaMomentOfInertia InchesToTheFourth(this T value) => AreaMomentOfInertia.FromInchesToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? InchesToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromInchesToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterToTheFourth - /// public static AreaMomentOfInertia MetersToTheFourth(this T value) => AreaMomentOfInertia.FromMetersToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? MetersToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromMetersToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterToTheFourth - /// public static AreaMomentOfInertia MillimetersToTheFourth(this T value) => AreaMomentOfInertia.FromMillimetersToTheFourth(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? MillimetersToTheFourth(this T? value) where T : struct => AreaMomentOfInertia.FromMillimetersToTheFourth(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToBitRateExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToBitRateExtensions.g.cs index 4efef3834b..83969b3527 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToBitRateExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToBitRateExtensions.g.cs @@ -44,292 +44,84 @@ namespace UnitsNet.Extensions.NumberToBitRate { public static class NumberToBitRateExtensions { - #region BitPerSecond - /// public static BitRate BitsPerSecond(this T value) => BitRate.FromBitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? BitsPerSecond(this T? value) where T : struct => BitRate.FromBitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region BytePerSecond - /// public static BitRate BytesPerSecond(this T value) => BitRate.FromBytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? BytesPerSecond(this T? value) where T : struct => BitRate.FromBytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ExabitPerSecond - /// public static BitRate ExabitsPerSecond(this T value) => BitRate.FromExabitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? ExabitsPerSecond(this T? value) where T : struct => BitRate.FromExabitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ExabytePerSecond - /// public static BitRate ExabytesPerSecond(this T value) => BitRate.FromExabytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? ExabytesPerSecond(this T? value) where T : struct => BitRate.FromExabytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ExbibitPerSecond - /// public static BitRate ExbibitsPerSecond(this T value) => BitRate.FromExbibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? ExbibitsPerSecond(this T? value) where T : struct => BitRate.FromExbibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ExbibytePerSecond - /// public static BitRate ExbibytesPerSecond(this T value) => BitRate.FromExbibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? ExbibytesPerSecond(this T? value) where T : struct => BitRate.FromExbibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GibibitPerSecond - /// public static BitRate GibibitsPerSecond(this T value) => BitRate.FromGibibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? GibibitsPerSecond(this T? value) where T : struct => BitRate.FromGibibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GibibytePerSecond - /// public static BitRate GibibytesPerSecond(this T value) => BitRate.FromGibibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? GibibytesPerSecond(this T? value) where T : struct => BitRate.FromGibibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigabitPerSecond - /// public static BitRate GigabitsPerSecond(this T value) => BitRate.FromGigabitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? GigabitsPerSecond(this T? value) where T : struct => BitRate.FromGigabitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigabytePerSecond - /// public static BitRate GigabytesPerSecond(this T value) => BitRate.FromGigabytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? GigabytesPerSecond(this T? value) where T : struct => BitRate.FromGigabytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KibibitPerSecond - /// public static BitRate KibibitsPerSecond(this T value) => BitRate.FromKibibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? KibibitsPerSecond(this T? value) where T : struct => BitRate.FromKibibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KibibytePerSecond - /// public static BitRate KibibytesPerSecond(this T value) => BitRate.FromKibibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? KibibytesPerSecond(this T? value) where T : struct => BitRate.FromKibibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilobitPerSecond - /// public static BitRate KilobitsPerSecond(this T value) => BitRate.FromKilobitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? KilobitsPerSecond(this T? value) where T : struct => BitRate.FromKilobitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilobytePerSecond - /// public static BitRate KilobytesPerSecond(this T value) => BitRate.FromKilobytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? KilobytesPerSecond(this T? value) where T : struct => BitRate.FromKilobytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MebibitPerSecond - /// public static BitRate MebibitsPerSecond(this T value) => BitRate.FromMebibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? MebibitsPerSecond(this T? value) where T : struct => BitRate.FromMebibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MebibytePerSecond - /// public static BitRate MebibytesPerSecond(this T value) => BitRate.FromMebibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? MebibytesPerSecond(this T? value) where T : struct => BitRate.FromMebibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegabitPerSecond - /// public static BitRate MegabitsPerSecond(this T value) => BitRate.FromMegabitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? MegabitsPerSecond(this T? value) where T : struct => BitRate.FromMegabitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegabytePerSecond - /// public static BitRate MegabytesPerSecond(this T value) => BitRate.FromMegabytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? MegabytesPerSecond(this T? value) where T : struct => BitRate.FromMegabytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PebibitPerSecond - /// public static BitRate PebibitsPerSecond(this T value) => BitRate.FromPebibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? PebibitsPerSecond(this T? value) where T : struct => BitRate.FromPebibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PebibytePerSecond - /// public static BitRate PebibytesPerSecond(this T value) => BitRate.FromPebibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? PebibytesPerSecond(this T? value) where T : struct => BitRate.FromPebibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PetabitPerSecond - /// public static BitRate PetabitsPerSecond(this T value) => BitRate.FromPetabitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? PetabitsPerSecond(this T? value) where T : struct => BitRate.FromPetabitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PetabytePerSecond - /// public static BitRate PetabytesPerSecond(this T value) => BitRate.FromPetabytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? PetabytesPerSecond(this T? value) where T : struct => BitRate.FromPetabytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TebibitPerSecond - /// public static BitRate TebibitsPerSecond(this T value) => BitRate.FromTebibitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? TebibitsPerSecond(this T? value) where T : struct => BitRate.FromTebibitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TebibytePerSecond - /// public static BitRate TebibytesPerSecond(this T value) => BitRate.FromTebibytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? TebibytesPerSecond(this T? value) where T : struct => BitRate.FromTebibytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerabitPerSecond - /// public static BitRate TerabitsPerSecond(this T value) => BitRate.FromTerabitsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? TerabitsPerSecond(this T? value) where T : struct => BitRate.FromTerabitsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerabytePerSecond - /// public static BitRate TerabytesPerSecond(this T value) => BitRate.FromTerabytesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? TerabytesPerSecond(this T? value) where T : struct => BitRate.FromTerabytesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs index 1342e04e53..209e93833b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToBrakeSpecificFuelConsumptionExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToBrakeSpecificFuelConsumption { public static class NumberToBrakeSpecificFuelConsumptionExtensions { - #region GramPerKiloWattHour - /// public static BrakeSpecificFuelConsumption GramsPerKiloWattHour(this T value) => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? GramsPerKiloWattHour(this T? value) where T : struct => BrakeSpecificFuelConsumption.FromGramsPerKiloWattHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerJoule - /// public static BrakeSpecificFuelConsumption KilogramsPerJoule(this T value) => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? KilogramsPerJoule(this T? value) where T : struct => BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerMechanicalHorsepowerHour - /// public static BrakeSpecificFuelConsumption PoundsPerMechanicalHorsepowerHour(this T value) => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? PoundsPerMechanicalHorsepowerHour(this T? value) where T : struct => BrakeSpecificFuelConsumption.FromPoundsPerMechanicalHorsepowerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToCapacitanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToCapacitanceExtensions.g.cs index 0ec974e4ae..7c4f20237f 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToCapacitanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToCapacitanceExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToCapacitance { public static class NumberToCapacitanceExtensions { - #region Farad - /// public static Capacitance Farads(this T value) => Capacitance.FromFarads(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Capacitance? Farads(this T? value) where T : struct => Capacitance.FromFarads(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs index ea7699b6a7..ebcbefd1ac 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDensityExtensions.g.cs @@ -44,424 +44,120 @@ namespace UnitsNet.Extensions.NumberToDensity { public static class NumberToDensityExtensions { - #region CentigramPerDeciliter - /// public static Density CentigramsPerDeciLiter(this T value) => Density.FromCentigramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? CentigramsPerDeciLiter(this T? value) where T : struct => Density.FromCentigramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentigramPerLiter - /// public static Density CentigramsPerLiter(this T value) => Density.FromCentigramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? CentigramsPerLiter(this T? value) where T : struct => Density.FromCentigramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentigramPerMilliliter - /// public static Density CentigramsPerMilliliter(this T value) => Density.FromCentigramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? CentigramsPerMilliliter(this T? value) where T : struct => Density.FromCentigramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecigramPerDeciliter - /// public static Density DecigramsPerDeciLiter(this T value) => Density.FromDecigramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? DecigramsPerDeciLiter(this T? value) where T : struct => Density.FromDecigramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecigramPerLiter - /// public static Density DecigramsPerLiter(this T value) => Density.FromDecigramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? DecigramsPerLiter(this T? value) where T : struct => Density.FromDecigramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecigramPerMilliliter - /// public static Density DecigramsPerMilliliter(this T value) => Density.FromDecigramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? DecigramsPerMilliliter(this T? value) where T : struct => Density.FromDecigramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerCubicCentimeter - /// public static Density GramsPerCubicCentimeter(this T value) => Density.FromGramsPerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerCubicCentimeter(this T? value) where T : struct => Density.FromGramsPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerCubicMeter - /// public static Density GramsPerCubicMeter(this T value) => Density.FromGramsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerCubicMeter(this T? value) where T : struct => Density.FromGramsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerCubicMillimeter - /// public static Density GramsPerCubicMillimeter(this T value) => Density.FromGramsPerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerCubicMillimeter(this T? value) where T : struct => Density.FromGramsPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerDeciliter - /// public static Density GramsPerDeciLiter(this T value) => Density.FromGramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerDeciLiter(this T? value) where T : struct => Density.FromGramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerLiter - /// public static Density GramsPerLiter(this T value) => Density.FromGramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerLiter(this T? value) where T : struct => Density.FromGramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerMilliliter - /// public static Density GramsPerMilliliter(this T value) => Density.FromGramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? GramsPerMilliliter(this T? value) where T : struct => Density.FromGramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerCubicCentimeter - /// public static Density KilogramsPerCubicCentimeter(this T value) => Density.FromKilogramsPerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? KilogramsPerCubicCentimeter(this T? value) where T : struct => Density.FromKilogramsPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerCubicMeter - /// public static Density KilogramsPerCubicMeter(this T value) => Density.FromKilogramsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? KilogramsPerCubicMeter(this T? value) where T : struct => Density.FromKilogramsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerCubicMillimeter - /// public static Density KilogramsPerCubicMillimeter(this T value) => Density.FromKilogramsPerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? KilogramsPerCubicMillimeter(this T? value) where T : struct => Density.FromKilogramsPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundPerCubicFoot - /// public static Density KilopoundsPerCubicFoot(this T value) => Density.FromKilopoundsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? KilopoundsPerCubicFoot(this T? value) where T : struct => Density.FromKilopoundsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundPerCubicInch - /// public static Density KilopoundsPerCubicInch(this T value) => Density.FromKilopoundsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? KilopoundsPerCubicInch(this T? value) where T : struct => Density.FromKilopoundsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrogramPerDeciliter - /// public static Density MicrogramsPerDeciLiter(this T value) => Density.FromMicrogramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MicrogramsPerDeciLiter(this T? value) where T : struct => Density.FromMicrogramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrogramPerLiter - /// public static Density MicrogramsPerLiter(this T value) => Density.FromMicrogramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MicrogramsPerLiter(this T? value) where T : struct => Density.FromMicrogramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrogramPerMilliliter - /// public static Density MicrogramsPerMilliliter(this T value) => Density.FromMicrogramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MicrogramsPerMilliliter(this T? value) where T : struct => Density.FromMicrogramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerCubicMeter - /// public static Density MilligramsPerCubicMeter(this T value) => Density.FromMilligramsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MilligramsPerCubicMeter(this T? value) where T : struct => Density.FromMilligramsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerDeciliter - /// public static Density MilligramsPerDeciLiter(this T value) => Density.FromMilligramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MilligramsPerDeciLiter(this T? value) where T : struct => Density.FromMilligramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerLiter - /// public static Density MilligramsPerLiter(this T value) => Density.FromMilligramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MilligramsPerLiter(this T? value) where T : struct => Density.FromMilligramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerMilliliter - /// public static Density MilligramsPerMilliliter(this T value) => Density.FromMilligramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? MilligramsPerMilliliter(this T? value) where T : struct => Density.FromMilligramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanogramPerDeciliter - /// public static Density NanogramsPerDeciLiter(this T value) => Density.FromNanogramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? NanogramsPerDeciLiter(this T? value) where T : struct => Density.FromNanogramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanogramPerLiter - /// public static Density NanogramsPerLiter(this T value) => Density.FromNanogramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? NanogramsPerLiter(this T? value) where T : struct => Density.FromNanogramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanogramPerMilliliter - /// public static Density NanogramsPerMilliliter(this T value) => Density.FromNanogramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? NanogramsPerMilliliter(this T? value) where T : struct => Density.FromNanogramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicogramPerDeciliter - /// public static Density PicogramsPerDeciLiter(this T value) => Density.FromPicogramsPerDeciLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PicogramsPerDeciLiter(this T? value) where T : struct => Density.FromPicogramsPerDeciLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicogramPerLiter - /// public static Density PicogramsPerLiter(this T value) => Density.FromPicogramsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PicogramsPerLiter(this T? value) where T : struct => Density.FromPicogramsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicogramPerMilliliter - /// public static Density PicogramsPerMilliliter(this T value) => Density.FromPicogramsPerMilliliter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PicogramsPerMilliliter(this T? value) where T : struct => Density.FromPicogramsPerMilliliter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerCubicFoot - /// public static Density PoundsPerCubicFoot(this T value) => Density.FromPoundsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PoundsPerCubicFoot(this T? value) where T : struct => Density.FromPoundsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerCubicInch - /// public static Density PoundsPerCubicInch(this T value) => Density.FromPoundsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PoundsPerCubicInch(this T? value) where T : struct => Density.FromPoundsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerImperialGallon - /// public static Density PoundsPerImperialGallon(this T value) => Density.FromPoundsPerImperialGallon(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PoundsPerImperialGallon(this T? value) where T : struct => Density.FromPoundsPerImperialGallon(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerUSGallon - /// public static Density PoundsPerUSGallon(this T value) => Density.FromPoundsPerUSGallon(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? PoundsPerUSGallon(this T? value) where T : struct => Density.FromPoundsPerUSGallon(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SlugPerCubicFoot - /// public static Density SlugsPerCubicFoot(this T value) => Density.FromSlugsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? SlugsPerCubicFoot(this T? value) where T : struct => Density.FromSlugsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonnePerCubicCentimeter - /// public static Density TonnesPerCubicCentimeter(this T value) => Density.FromTonnesPerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? TonnesPerCubicCentimeter(this T? value) where T : struct => Density.FromTonnesPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonnePerCubicMeter - /// public static Density TonnesPerCubicMeter(this T value) => Density.FromTonnesPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? TonnesPerCubicMeter(this T? value) where T : struct => Density.FromTonnesPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonnePerCubicMillimeter - /// public static Density TonnesPerCubicMillimeter(this T value) => Density.FromTonnesPerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? TonnesPerCubicMillimeter(this T? value) where T : struct => Density.FromTonnesPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs index 48e1ccab1a..fad167abb6 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDurationExtensions.g.cs @@ -44,140 +44,44 @@ namespace UnitsNet.Extensions.NumberToDuration { public static class NumberToDurationExtensions { - #region Day - /// public static Duration Days(this T value) => Duration.FromDays(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Days(this T? value) where T : struct => Duration.FromDays(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hour - /// public static Duration Hours(this T value) => Duration.FromHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Hours(this T? value) where T : struct => Duration.FromHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microsecond - /// public static Duration Microseconds(this T value) => Duration.FromMicroseconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Microseconds(this T? value) where T : struct => Duration.FromMicroseconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millisecond - /// public static Duration Milliseconds(this T value) => Duration.FromMilliseconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Milliseconds(this T? value) where T : struct => Duration.FromMilliseconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Minute - /// public static Duration Minutes(this T value) => Duration.FromMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Minutes(this T? value) where T : struct => Duration.FromMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Month - /// [System.Obsolete("Use Month30 instead, which makes it clear that this is an approximate unit based on 30 days per month. The duration of a month varies, but the Gregorian solar calendar has 365.2425/12 = 30.44 days on average.")] public static Duration Months(this T value) => Duration.FromMonths(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Months(this T? value) where T : struct => Duration.FromMonths(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Month30 - /// public static Duration Months30(this T value) => Duration.FromMonths30(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Months30(this T? value) where T : struct => Duration.FromMonths30(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanosecond - /// public static Duration Nanoseconds(this T value) => Duration.FromNanoseconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Nanoseconds(this T? value) where T : struct => Duration.FromNanoseconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Second - /// public static Duration Seconds(this T value) => Duration.FromSeconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Seconds(this T? value) where T : struct => Duration.FromSeconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Week - /// public static Duration Weeks(this T value) => Duration.FromWeeks(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Weeks(this T? value) where T : struct => Duration.FromWeeks(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Year - /// [System.Obsolete("Use Year365 instead, which makes it clear that this is an approximate unit based on 365 days per year. The duration of a year varies due to corrections such as leap years, since a Gregorian solar calendar has 365.2425 days.")] public static Duration Years(this T value) => Duration.FromYears(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Years(this T? value) where T : struct => Duration.FromYears(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Year365 - /// public static Duration Years365(this T value) => Duration.FromYears365(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? Years365(this T? value) where T : struct => Duration.FromYears365(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDynamicViscosityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDynamicViscosityExtensions.g.cs index e8af61187f..362f462bf0 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToDynamicViscosityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToDynamicViscosityExtensions.g.cs @@ -44,72 +44,24 @@ namespace UnitsNet.Extensions.NumberToDynamicViscosity { public static class NumberToDynamicViscosityExtensions { - #region Centipoise - /// public static DynamicViscosity Centipoise(this T value) => DynamicViscosity.FromCentipoise(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? Centipoise(this T? value) where T : struct => DynamicViscosity.FromCentipoise(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicropascalSecond - /// public static DynamicViscosity MicropascalSeconds(this T value) => DynamicViscosity.FromMicropascalSeconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? MicropascalSeconds(this T? value) where T : struct => DynamicViscosity.FromMicropascalSeconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillipascalSecond - /// public static DynamicViscosity MillipascalSeconds(this T value) => DynamicViscosity.FromMillipascalSeconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? MillipascalSeconds(this T? value) where T : struct => DynamicViscosity.FromMillipascalSeconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonSecondPerMeterSquared - /// public static DynamicViscosity NewtonSecondsPerMeterSquared(this T value) => DynamicViscosity.FromNewtonSecondsPerMeterSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? NewtonSecondsPerMeterSquared(this T? value) where T : struct => DynamicViscosity.FromNewtonSecondsPerMeterSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PascalSecond - /// public static DynamicViscosity PascalSeconds(this T value) => DynamicViscosity.FromPascalSeconds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? PascalSeconds(this T? value) where T : struct => DynamicViscosity.FromPascalSeconds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Poise - /// public static DynamicViscosity Poise(this T value) => DynamicViscosity.FromPoise(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? Poise(this T? value) where T : struct => DynamicViscosity.FromPoise(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricAdmittanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricAdmittanceExtensions.g.cs index 479d2dadec..9f4abe488a 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricAdmittanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricAdmittanceExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToElectricAdmittance { public static class NumberToElectricAdmittanceExtensions { - #region Microsiemens - /// public static ElectricAdmittance Microsiemens(this T value) => ElectricAdmittance.FromMicrosiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricAdmittance? Microsiemens(this T? value) where T : struct => ElectricAdmittance.FromMicrosiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millisiemens - /// public static ElectricAdmittance Millisiemens(this T value) => ElectricAdmittance.FromMillisiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricAdmittance? Millisiemens(this T? value) where T : struct => ElectricAdmittance.FromMillisiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanosiemens - /// public static ElectricAdmittance Nanosiemens(this T value) => ElectricAdmittance.FromNanosiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricAdmittance? Nanosiemens(this T? value) where T : struct => ElectricAdmittance.FromNanosiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Siemens - /// public static ElectricAdmittance Siemens(this T value) => ElectricAdmittance.FromSiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricAdmittance? Siemens(this T? value) where T : struct => ElectricAdmittance.FromSiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeDensityExtensions.g.cs index 8cce5635a8..4c1ac1c46b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeDensityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricChargeDensity { public static class NumberToElectricChargeDensityExtensions { - #region CoulombPerCubicMeter - /// public static ElectricChargeDensity CoulombsPerCubicMeter(this T value) => ElectricChargeDensity.FromCoulombsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricChargeDensity? CoulombsPerCubicMeter(this T? value) where T : struct => ElectricChargeDensity.FromCoulombsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeExtensions.g.cs index 4172b896c6..5573d06a98 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricChargeExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricCharge { public static class NumberToElectricChargeExtensions { - #region Coulomb - /// public static ElectricCharge Coulombs(this T value) => ElectricCharge.FromCoulombs(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCharge? Coulombs(this T? value) where T : struct => ElectricCharge.FromCoulombs(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductanceExtensions.g.cs index 009d984d58..843261ed40 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductanceExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToElectricConductance { public static class NumberToElectricConductanceExtensions { - #region Microsiemens - /// public static ElectricConductance Microsiemens(this T value) => ElectricConductance.FromMicrosiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductance? Microsiemens(this T? value) where T : struct => ElectricConductance.FromMicrosiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millisiemens - /// public static ElectricConductance Millisiemens(this T value) => ElectricConductance.FromMillisiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductance? Millisiemens(this T? value) where T : struct => ElectricConductance.FromMillisiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Siemens - /// public static ElectricConductance Siemens(this T value) => ElectricConductance.FromSiemens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductance? Siemens(this T? value) where T : struct => ElectricConductance.FromSiemens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductivityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductivityExtensions.g.cs index d3f606e246..311328fedb 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductivityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricConductivityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricConductivity { public static class NumberToElectricConductivityExtensions { - #region SiemensPerMeter - /// public static ElectricConductivity SiemensPerMeter(this T value) => ElectricConductivity.FromSiemensPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductivity? SiemensPerMeter(this T? value) where T : struct => ElectricConductivity.FromSiemensPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentDensityExtensions.g.cs index efd6ced57a..7ced6e9098 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentDensityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricCurrentDensity { public static class NumberToElectricCurrentDensityExtensions { - #region AmperePerSquareMeter - /// public static ElectricCurrentDensity AmperesPerSquareMeter(this T value) => ElectricCurrentDensity.FromAmperesPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrentDensity? AmperesPerSquareMeter(this T? value) where T : struct => ElectricCurrentDensity.FromAmperesPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentExtensions.g.cs index cc6432cea8..cebeaa5cd6 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToElectricCurrent { public static class NumberToElectricCurrentExtensions { - #region Ampere - /// public static ElectricCurrent Amperes(this T value) => ElectricCurrent.FromAmperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Amperes(this T? value) where T : struct => ElectricCurrent.FromAmperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Centiampere - /// public static ElectricCurrent Centiamperes(this T value) => ElectricCurrent.FromCentiamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Centiamperes(this T? value) where T : struct => ElectricCurrent.FromCentiamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kiloampere - /// public static ElectricCurrent Kiloamperes(this T value) => ElectricCurrent.FromKiloamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Kiloamperes(this T? value) where T : struct => ElectricCurrent.FromKiloamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megaampere - /// public static ElectricCurrent Megaamperes(this T value) => ElectricCurrent.FromMegaamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Megaamperes(this T? value) where T : struct => ElectricCurrent.FromMegaamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microampere - /// public static ElectricCurrent Microamperes(this T value) => ElectricCurrent.FromMicroamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Microamperes(this T? value) where T : struct => ElectricCurrent.FromMicroamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milliampere - /// public static ElectricCurrent Milliamperes(this T value) => ElectricCurrent.FromMilliamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Milliamperes(this T? value) where T : struct => ElectricCurrent.FromMilliamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanoampere - /// public static ElectricCurrent Nanoamperes(this T value) => ElectricCurrent.FromNanoamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Nanoamperes(this T? value) where T : struct => ElectricCurrent.FromNanoamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Picoampere - /// public static ElectricCurrent Picoamperes(this T value) => ElectricCurrent.FromPicoamperes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? Picoamperes(this T? value) where T : struct => ElectricCurrent.FromPicoamperes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentGradientExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentGradientExtensions.g.cs index f8ff56e216..19456d74dc 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentGradientExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricCurrentGradientExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricCurrentGradient { public static class NumberToElectricCurrentGradientExtensions { - #region AmperePerSecond - /// public static ElectricCurrentGradient AmperesPerSecond(this T value) => ElectricCurrentGradient.FromAmperesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrentGradient? AmperesPerSecond(this T? value) where T : struct => ElectricCurrentGradient.FromAmperesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricFieldExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricFieldExtensions.g.cs index dd03e3351a..3b18fa3e9c 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricFieldExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricFieldExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricField { public static class NumberToElectricFieldExtensions { - #region VoltPerMeter - /// public static ElectricField VoltsPerMeter(this T value) => ElectricField.FromVoltsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricField? VoltsPerMeter(this T? value) where T : struct => ElectricField.FromVoltsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricInductanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricInductanceExtensions.g.cs index f080d2a359..32210c78ae 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricInductanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricInductanceExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToElectricInductance { public static class NumberToElectricInductanceExtensions { - #region Henry - /// public static ElectricInductance Henries(this T value) => ElectricInductance.FromHenries(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricInductance? Henries(this T? value) where T : struct => ElectricInductance.FromHenries(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialAcExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialAcExtensions.g.cs index 2e0562ea00..7a9623efee 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialAcExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialAcExtensions.g.cs @@ -44,61 +44,21 @@ namespace UnitsNet.Extensions.NumberToElectricPotentialAc { public static class NumberToElectricPotentialAcExtensions { - #region KilovoltAc - /// public static ElectricPotentialAc KilovoltsAc(this T value) => ElectricPotentialAc.FromKilovoltsAc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? KilovoltsAc(this T? value) where T : struct => ElectricPotentialAc.FromKilovoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegavoltAc - /// public static ElectricPotentialAc MegavoltsAc(this T value) => ElectricPotentialAc.FromMegavoltsAc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? MegavoltsAc(this T? value) where T : struct => ElectricPotentialAc.FromMegavoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrovoltAc - /// public static ElectricPotentialAc MicrovoltsAc(this T value) => ElectricPotentialAc.FromMicrovoltsAc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? MicrovoltsAc(this T? value) where T : struct => ElectricPotentialAc.FromMicrovoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillivoltAc - /// public static ElectricPotentialAc MillivoltsAc(this T value) => ElectricPotentialAc.FromMillivoltsAc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? MillivoltsAc(this T? value) where T : struct => ElectricPotentialAc.FromMillivoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region VoltAc - /// public static ElectricPotentialAc VoltsAc(this T value) => ElectricPotentialAc.FromVoltsAc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? VoltsAc(this T? value) where T : struct => ElectricPotentialAc.FromVoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialDcExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialDcExtensions.g.cs index fde616f3e2..0322b95071 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialDcExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialDcExtensions.g.cs @@ -44,61 +44,21 @@ namespace UnitsNet.Extensions.NumberToElectricPotentialDc { public static class NumberToElectricPotentialDcExtensions { - #region KilovoltDc - /// public static ElectricPotentialDc KilovoltsDc(this T value) => ElectricPotentialDc.FromKilovoltsDc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? KilovoltsDc(this T? value) where T : struct => ElectricPotentialDc.FromKilovoltsDc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegavoltDc - /// public static ElectricPotentialDc MegavoltsDc(this T value) => ElectricPotentialDc.FromMegavoltsDc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? MegavoltsDc(this T? value) where T : struct => ElectricPotentialDc.FromMegavoltsDc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrovoltDc - /// public static ElectricPotentialDc MicrovoltsDc(this T value) => ElectricPotentialDc.FromMicrovoltsDc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? MicrovoltsDc(this T? value) where T : struct => ElectricPotentialDc.FromMicrovoltsDc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillivoltDc - /// public static ElectricPotentialDc MillivoltsDc(this T value) => ElectricPotentialDc.FromMillivoltsDc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? MillivoltsDc(this T? value) where T : struct => ElectricPotentialDc.FromMillivoltsDc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region VoltDc - /// public static ElectricPotentialDc VoltsDc(this T value) => ElectricPotentialDc.FromVoltsDc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? VoltsDc(this T? value) where T : struct => ElectricPotentialDc.FromVoltsDc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialExtensions.g.cs index 4d65056731..ab4f96ce53 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricPotentialExtensions.g.cs @@ -44,61 +44,21 @@ namespace UnitsNet.Extensions.NumberToElectricPotential { public static class NumberToElectricPotentialExtensions { - #region Kilovolt - /// public static ElectricPotential Kilovolts(this T value) => ElectricPotential.FromKilovolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? Kilovolts(this T? value) where T : struct => ElectricPotential.FromKilovolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megavolt - /// public static ElectricPotential Megavolts(this T value) => ElectricPotential.FromMegavolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? Megavolts(this T? value) where T : struct => ElectricPotential.FromMegavolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microvolt - /// public static ElectricPotential Microvolts(this T value) => ElectricPotential.FromMicrovolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? Microvolts(this T? value) where T : struct => ElectricPotential.FromMicrovolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millivolt - /// public static ElectricPotential Millivolts(this T value) => ElectricPotential.FromMillivolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? Millivolts(this T? value) where T : struct => ElectricPotential.FromMillivolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Volt - /// public static ElectricPotential Volts(this T value) => ElectricPotential.FromVolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? Volts(this T? value) where T : struct => ElectricPotential.FromVolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistanceExtensions.g.cs index 2bdd86c11d..2ceb16ce7a 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistanceExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToElectricResistance { public static class NumberToElectricResistanceExtensions { - #region Kiloohm - /// public static ElectricResistance Kiloohms(this T value) => ElectricResistance.FromKiloohms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistance? Kiloohms(this T? value) where T : struct => ElectricResistance.FromKiloohms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megaohm - /// public static ElectricResistance Megaohms(this T value) => ElectricResistance.FromMegaohms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistance? Megaohms(this T? value) where T : struct => ElectricResistance.FromMegaohms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milliohm - /// public static ElectricResistance Milliohms(this T value) => ElectricResistance.FromMilliohms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistance? Milliohms(this T? value) where T : struct => ElectricResistance.FromMilliohms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Ohm - /// public static ElectricResistance Ohms(this T value) => ElectricResistance.FromOhms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistance? Ohms(this T? value) where T : struct => ElectricResistance.FromOhms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistivityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistivityExtensions.g.cs index 1ef50dabd8..264db20bda 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistivityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToElectricResistivityExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToElectricResistivity { public static class NumberToElectricResistivityExtensions { - #region MicroohmMeter - /// public static ElectricResistivity MicroohmMeters(this T value) => ElectricResistivity.FromMicroohmMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistivity? MicroohmMeters(this T? value) where T : struct => ElectricResistivity.FromMicroohmMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliohmMeter - /// public static ElectricResistivity MilliohmMeters(this T value) => ElectricResistivity.FromMilliohmMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistivity? MilliohmMeters(this T? value) where T : struct => ElectricResistivity.FromMilliohmMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanoohmMeter - /// public static ElectricResistivity NanoohmMeters(this T value) => ElectricResistivity.FromNanoohmMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistivity? NanoohmMeters(this T? value) where T : struct => ElectricResistivity.FromNanoohmMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OhmMeter - /// public static ElectricResistivity OhmMeters(this T value) => ElectricResistivity.FromOhmMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistivity? OhmMeters(this T? value) where T : struct => ElectricResistivity.FromOhmMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToEnergyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToEnergyExtensions.g.cs index f1b22c4470..61618ec154 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToEnergyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToEnergyExtensions.g.cs @@ -44,248 +44,72 @@ namespace UnitsNet.Extensions.NumberToEnergy { public static class NumberToEnergyExtensions { - #region BritishThermalUnit - /// public static Energy BritishThermalUnits(this T value) => Energy.FromBritishThermalUnits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? BritishThermalUnits(this T? value) where T : struct => Energy.FromBritishThermalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Calorie - /// public static Energy Calories(this T value) => Energy.FromCalories(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Calories(this T? value) where T : struct => Energy.FromCalories(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecathermEc - /// public static Energy DecathermsEc(this T value) => Energy.FromDecathermsEc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? DecathermsEc(this T? value) where T : struct => Energy.FromDecathermsEc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecathermImperial - /// public static Energy DecathermsImperial(this T value) => Energy.FromDecathermsImperial(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? DecathermsImperial(this T? value) where T : struct => Energy.FromDecathermsImperial(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecathermUs - /// public static Energy DecathermsUs(this T value) => Energy.FromDecathermsUs(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? DecathermsUs(this T? value) where T : struct => Energy.FromDecathermsUs(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ElectronVolt - /// public static Energy ElectronVolts(this T value) => Energy.FromElectronVolts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? ElectronVolts(this T? value) where T : struct => Energy.FromElectronVolts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Erg - /// public static Energy Ergs(this T value) => Energy.FromErgs(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Ergs(this T? value) where T : struct => Energy.FromErgs(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootPound - /// public static Energy FootPounds(this T value) => Energy.FromFootPounds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? FootPounds(this T? value) where T : struct => Energy.FromFootPounds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigabritishThermalUnit - /// public static Energy GigabritishThermalUnits(this T value) => Energy.FromGigabritishThermalUnits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? GigabritishThermalUnits(this T? value) where T : struct => Energy.FromGigabritishThermalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigawattHour - /// public static Energy GigawattHours(this T value) => Energy.FromGigawattHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? GigawattHours(this T? value) where T : struct => Energy.FromGigawattHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Joule - /// public static Energy Joules(this T value) => Energy.FromJoules(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Joules(this T? value) where T : struct => Energy.FromJoules(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilobritishThermalUnit - /// public static Energy KilobritishThermalUnits(this T value) => Energy.FromKilobritishThermalUnits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? KilobritishThermalUnits(this T? value) where T : struct => Energy.FromKilobritishThermalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilocalorie - /// public static Energy Kilocalories(this T value) => Energy.FromKilocalories(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Kilocalories(this T? value) where T : struct => Energy.FromKilocalories(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilojoule - /// public static Energy Kilojoules(this T value) => Energy.FromKilojoules(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Kilojoules(this T? value) where T : struct => Energy.FromKilojoules(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattHour - /// public static Energy KilowattHours(this T value) => Energy.FromKilowattHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? KilowattHours(this T? value) where T : struct => Energy.FromKilowattHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegabritishThermalUnit - /// public static Energy MegabritishThermalUnits(this T value) => Energy.FromMegabritishThermalUnits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? MegabritishThermalUnits(this T? value) where T : struct => Energy.FromMegabritishThermalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megajoule - /// public static Energy Megajoules(this T value) => Energy.FromMegajoules(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? Megajoules(this T? value) where T : struct => Energy.FromMegajoules(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattHour - /// public static Energy MegawattHours(this T value) => Energy.FromMegawattHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? MegawattHours(this T? value) where T : struct => Energy.FromMegawattHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ThermEc - /// public static Energy ThermsEc(this T value) => Energy.FromThermsEc(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? ThermsEc(this T? value) where T : struct => Energy.FromThermsEc(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ThermImperial - /// public static Energy ThermsImperial(this T value) => Energy.FromThermsImperial(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? ThermsImperial(this T? value) where T : struct => Energy.FromThermsImperial(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ThermUs - /// public static Energy ThermsUs(this T value) => Energy.FromThermsUs(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? ThermsUs(this T? value) where T : struct => Energy.FromThermsUs(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattHour - /// public static Energy WattHours(this T value) => Energy.FromWattHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? WattHours(this T? value) where T : struct => Energy.FromWattHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToEntropyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToEntropyExtensions.g.cs index 0c83b6987b..2ff8c28351 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToEntropyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToEntropyExtensions.g.cs @@ -44,83 +44,27 @@ namespace UnitsNet.Extensions.NumberToEntropy { public static class NumberToEntropyExtensions { - #region CaloriePerKelvin - /// public static Entropy CaloriesPerKelvin(this T value) => Entropy.FromCaloriesPerKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? CaloriesPerKelvin(this T? value) where T : struct => Entropy.FromCaloriesPerKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region JoulePerDegreeCelsius - /// public static Entropy JoulesPerDegreeCelsius(this T value) => Entropy.FromJoulesPerDegreeCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? JoulesPerDegreeCelsius(this T? value) where T : struct => Entropy.FromJoulesPerDegreeCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region JoulePerKelvin - /// public static Entropy JoulesPerKelvin(this T value) => Entropy.FromJoulesPerKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? JoulesPerKelvin(this T? value) where T : struct => Entropy.FromJoulesPerKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocaloriePerKelvin - /// public static Entropy KilocaloriesPerKelvin(this T value) => Entropy.FromKilocaloriesPerKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? KilocaloriesPerKelvin(this T? value) where T : struct => Entropy.FromKilocaloriesPerKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerDegreeCelsius - /// public static Entropy KilojoulesPerDegreeCelsius(this T value) => Entropy.FromKilojoulesPerDegreeCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? KilojoulesPerDegreeCelsius(this T? value) where T : struct => Entropy.FromKilojoulesPerDegreeCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerKelvin - /// public static Entropy KilojoulesPerKelvin(this T value) => Entropy.FromKilojoulesPerKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? KilojoulesPerKelvin(this T? value) where T : struct => Entropy.FromKilojoulesPerKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerKelvin - /// public static Entropy MegajoulesPerKelvin(this T value) => Entropy.FromMegajoulesPerKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? MegajoulesPerKelvin(this T? value) where T : struct => Entropy.FromMegajoulesPerKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs index 6fdb1b2fa7..5f82218c6c 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToFlowExtensions.g.cs @@ -44,288 +44,96 @@ namespace UnitsNet.Extensions.NumberToFlow { public static class NumberToFlowExtensions { - #region CentilitersPerMinute - /// public static Flow CentilitersPerMinute(this T value) => Flow.FromCentilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CentilitersPerMinute(this T? value) where T : struct => Flow.FromCentilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicDecimeterPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicDecimetersPerMinute(this T value) => Flow.FromCubicDecimetersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicDecimetersPerMinute(this T? value) where T : struct => Flow.FromCubicDecimetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerHour - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicFeetPerHour(this T value) => Flow.FromCubicFeetPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerHour(this T? value) where T : struct => Flow.FromCubicFeetPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicFeetPerMinute(this T value) => Flow.FromCubicFeetPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerMinute(this T? value) where T : struct => Flow.FromCubicFeetPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerSecond - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicFeetPerSecond(this T value) => Flow.FromCubicFeetPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicFeetPerSecond(this T? value) where T : struct => Flow.FromCubicFeetPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerHour - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicMetersPerHour(this T value) => Flow.FromCubicMetersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerHour(this T? value) where T : struct => Flow.FromCubicMetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicMetersPerMinute(this T value) => Flow.FromCubicMetersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerMinute(this T? value) where T : struct => Flow.FromCubicMetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerSecond - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicMetersPerSecond(this T value) => Flow.FromCubicMetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicMetersPerSecond(this T? value) where T : struct => Flow.FromCubicMetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerHour - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicYardsPerHour(this T value) => Flow.FromCubicYardsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerHour(this T? value) where T : struct => Flow.FromCubicYardsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicYardsPerMinute(this T value) => Flow.FromCubicYardsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerMinute(this T? value) where T : struct => Flow.FromCubicYardsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerSecond - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow CubicYardsPerSecond(this T value) => Flow.FromCubicYardsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? CubicYardsPerSecond(this T? value) where T : struct => Flow.FromCubicYardsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecilitersPerMinute - /// public static Flow DecilitersPerMinute(this T value) => Flow.FromDecilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? DecilitersPerMinute(this T? value) where T : struct => Flow.FromDecilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilolitersPerMinute - /// public static Flow KilolitersPerMinute(this T value) => Flow.FromKilolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? KilolitersPerMinute(this T? value) where T : struct => Flow.FromKilolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerHour - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow LitersPerHour(this T value) => Flow.FromLitersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerHour(this T? value) where T : struct => Flow.FromLitersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow LitersPerMinute(this T value) => Flow.FromLitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerMinute(this T? value) where T : struct => Flow.FromLitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerSecond - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow LitersPerSecond(this T value) => Flow.FromLitersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? LitersPerSecond(this T? value) where T : struct => Flow.FromLitersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrolitersPerMinute - /// public static Flow MicrolitersPerMinute(this T value) => Flow.FromMicrolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MicrolitersPerMinute(this T? value) where T : struct => Flow.FromMicrolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillilitersPerMinute - /// public static Flow MillilitersPerMinute(this T value) => Flow.FromMillilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MillilitersPerMinute(this T? value) where T : struct => Flow.FromMillilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillionUsGallonsPerDay - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow MillionUsGallonsPerDay(this T value) => Flow.FromMillionUsGallonsPerDay(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? MillionUsGallonsPerDay(this T? value) where T : struct => Flow.FromMillionUsGallonsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanolitersPerMinute - /// public static Flow NanolitersPerMinute(this T value) => Flow.FromNanolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? NanolitersPerMinute(this T? value) where T : struct => Flow.FromNanolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrelsPerDay - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow OilBarrelsPerDay(this T value) => Flow.FromOilBarrelsPerDay(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? OilBarrelsPerDay(this T? value) where T : struct => Flow.FromOilBarrelsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerHour - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow UsGallonsPerHour(this T value) => Flow.FromUsGallonsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerHour(this T? value) where T : struct => Flow.FromUsGallonsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerMinute - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow UsGallonsPerMinute(this T value) => Flow.FromUsGallonsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerMinute(this T? value) where T : struct => Flow.FromUsGallonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerSecond - /// [System.Obsolete("Deprecated due to github issue #363, please use VolumeFlow instead")] public static Flow UsGallonsPerSecond(this T value) => Flow.FromUsGallonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? UsGallonsPerSecond(this T? value) where T : struct => Flow.FromUsGallonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceChangeRateExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceChangeRateExtensions.g.cs index 4e9fd9075b..b58d9e2a79 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceChangeRateExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceChangeRateExtensions.g.cs @@ -44,127 +44,39 @@ namespace UnitsNet.Extensions.NumberToForceChangeRate { public static class NumberToForceChangeRateExtensions { - #region CentinewtonPerSecond - /// public static ForceChangeRate CentinewtonsPerSecond(this T value) => ForceChangeRate.FromCentinewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? CentinewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromCentinewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecanewtonPerMinute - /// public static ForceChangeRate DecanewtonsPerMinute(this T value) => ForceChangeRate.FromDecanewtonsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? DecanewtonsPerMinute(this T? value) where T : struct => ForceChangeRate.FromDecanewtonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecanewtonPerSecond - /// public static ForceChangeRate DecanewtonsPerSecond(this T value) => ForceChangeRate.FromDecanewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? DecanewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromDecanewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecinewtonPerSecond - /// public static ForceChangeRate DecinewtonsPerSecond(this T value) => ForceChangeRate.FromDecinewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? DecinewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromDecinewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerMinute - /// public static ForceChangeRate KilonewtonsPerMinute(this T value) => ForceChangeRate.FromKilonewtonsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? KilonewtonsPerMinute(this T? value) where T : struct => ForceChangeRate.FromKilonewtonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerSecond - /// public static ForceChangeRate KilonewtonsPerSecond(this T value) => ForceChangeRate.FromKilonewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? KilonewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromKilonewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicronewtonPerSecond - /// public static ForceChangeRate MicronewtonsPerSecond(this T value) => ForceChangeRate.FromMicronewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? MicronewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromMicronewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillinewtonPerSecond - /// public static ForceChangeRate MillinewtonsPerSecond(this T value) => ForceChangeRate.FromMillinewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? MillinewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromMillinewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanonewtonPerSecond - /// public static ForceChangeRate NanonewtonsPerSecond(this T value) => ForceChangeRate.FromNanonewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? NanonewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromNanonewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerMinute - /// public static ForceChangeRate NewtonsPerMinute(this T value) => ForceChangeRate.FromNewtonsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? NewtonsPerMinute(this T? value) where T : struct => ForceChangeRate.FromNewtonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerSecond - /// public static ForceChangeRate NewtonsPerSecond(this T value) => ForceChangeRate.FromNewtonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? NewtonsPerSecond(this T? value) where T : struct => ForceChangeRate.FromNewtonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceExtensions.g.cs index da7ac9dba4..4e78aba2c8 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForceExtensions.g.cs @@ -44,116 +44,36 @@ namespace UnitsNet.Extensions.NumberToForce { public static class NumberToForceExtensions { - #region Decanewton - /// public static Force Decanewtons(this T value) => Force.FromDecanewtons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Decanewtons(this T? value) where T : struct => Force.FromDecanewtons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Dyn - /// public static Force Dyne(this T value) => Force.FromDyne(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Dyne(this T? value) where T : struct => Force.FromDyne(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForce - /// public static Force KilogramsForce(this T value) => Force.FromKilogramsForce(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? KilogramsForce(this T? value) where T : struct => Force.FromKilogramsForce(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilonewton - /// public static Force Kilonewtons(this T value) => Force.FromKilonewtons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Kilonewtons(this T? value) where T : struct => Force.FromKilonewtons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KiloPond - /// public static Force KiloPonds(this T value) => Force.FromKiloPonds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? KiloPonds(this T? value) where T : struct => Force.FromKiloPonds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Meganewton - /// public static Force Meganewtons(this T value) => Force.FromMeganewtons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Meganewtons(this T? value) where T : struct => Force.FromMeganewtons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Newton - /// public static Force Newtons(this T value) => Force.FromNewtons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Newtons(this T? value) where T : struct => Force.FromNewtons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Poundal - /// public static Force Poundals(this T value) => Force.FromPoundals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? Poundals(this T? value) where T : struct => Force.FromPoundals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForce - /// public static Force PoundsForce(this T value) => Force.FromPoundsForce(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? PoundsForce(this T? value) where T : struct => Force.FromPoundsForce(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForce - /// public static Force TonnesForce(this T value) => Force.FromTonnesForce(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? TonnesForce(this T? value) where T : struct => Force.FromTonnesForce(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForcePerLengthExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForcePerLengthExtensions.g.cs index 6db097dcd1..7a5cd2d5a2 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToForcePerLengthExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToForcePerLengthExtensions.g.cs @@ -44,105 +44,33 @@ namespace UnitsNet.Extensions.NumberToForcePerLength { public static class NumberToForcePerLengthExtensions { - #region CentinewtonPerMeter - /// public static ForcePerLength CentinewtonsPerMeter(this T value) => ForcePerLength.FromCentinewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? CentinewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromCentinewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecinewtonPerMeter - /// public static ForcePerLength DecinewtonsPerMeter(this T value) => ForcePerLength.FromDecinewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? DecinewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromDecinewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerMeter - /// public static ForcePerLength KilogramsForcePerMeter(this T value) => ForcePerLength.FromKilogramsForcePerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? KilogramsForcePerMeter(this T? value) where T : struct => ForcePerLength.FromKilogramsForcePerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerMeter - /// public static ForcePerLength KilonewtonsPerMeter(this T value) => ForcePerLength.FromKilonewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? KilonewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromKilonewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonPerMeter - /// public static ForcePerLength MeganewtonsPerMeter(this T value) => ForcePerLength.FromMeganewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? MeganewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromMeganewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicronewtonPerMeter - /// public static ForcePerLength MicronewtonsPerMeter(this T value) => ForcePerLength.FromMicronewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? MicronewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromMicronewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillinewtonPerMeter - /// public static ForcePerLength MillinewtonsPerMeter(this T value) => ForcePerLength.FromMillinewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? MillinewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromMillinewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanonewtonPerMeter - /// public static ForcePerLength NanonewtonsPerMeter(this T value) => ForcePerLength.FromNanonewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? NanonewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromNanonewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerMeter - /// public static ForcePerLength NewtonsPerMeter(this T value) => ForcePerLength.FromNewtonsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? NewtonsPerMeter(this T? value) where T : struct => ForcePerLength.FromNewtonsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFrequencyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToFrequencyExtensions.g.cs index d9628a6665..313563c5e1 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToFrequencyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToFrequencyExtensions.g.cs @@ -44,83 +44,27 @@ namespace UnitsNet.Extensions.NumberToFrequency { public static class NumberToFrequencyExtensions { - #region CyclePerHour - /// public static Frequency CyclesPerHour(this T value) => Frequency.FromCyclesPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? CyclesPerHour(this T? value) where T : struct => Frequency.FromCyclesPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CyclePerMinute - /// public static Frequency CyclesPerMinute(this T value) => Frequency.FromCyclesPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? CyclesPerMinute(this T? value) where T : struct => Frequency.FromCyclesPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gigahertz - /// public static Frequency Gigahertz(this T value) => Frequency.FromGigahertz(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? Gigahertz(this T? value) where T : struct => Frequency.FromGigahertz(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hertz - /// public static Frequency Hertz(this T value) => Frequency.FromHertz(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? Hertz(this T? value) where T : struct => Frequency.FromHertz(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilohertz - /// public static Frequency Kilohertz(this T value) => Frequency.FromKilohertz(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? Kilohertz(this T? value) where T : struct => Frequency.FromKilohertz(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megahertz - /// public static Frequency Megahertz(this T value) => Frequency.FromMegahertz(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? Megahertz(this T? value) where T : struct => Frequency.FromMegahertz(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Terahertz - /// public static Frequency Terahertz(this T value) => Frequency.FromTerahertz(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? Terahertz(this T? value) where T : struct => Frequency.FromTerahertz(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs index d351423200..737ca32544 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs @@ -44,182 +44,54 @@ namespace UnitsNet.Extensions.NumberToHeatFlux { public static class NumberToHeatFluxExtensions { - #region BtuPerHourSquareFoot - /// public static HeatFlux BtusPerHourSquareFoot(this T value) => HeatFlux.FromBtusPerHourSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? BtusPerHourSquareFoot(this T? value) where T : struct => HeatFlux.FromBtusPerHourSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region BtuPerMinuteSquareFoot - /// public static HeatFlux BtusPerMinuteSquareFoot(this T value) => HeatFlux.FromBtusPerMinuteSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? BtusPerMinuteSquareFoot(this T? value) where T : struct => HeatFlux.FromBtusPerMinuteSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region BtuPerSecondSquareFoot - /// public static HeatFlux BtusPerSecondSquareFoot(this T value) => HeatFlux.FromBtusPerSecondSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? BtusPerSecondSquareFoot(this T? value) where T : struct => HeatFlux.FromBtusPerSecondSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region BtuPerSecondSquareInch - /// public static HeatFlux BtusPerSecondSquareInch(this T value) => HeatFlux.FromBtusPerSecondSquareInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? BtusPerSecondSquareInch(this T? value) where T : struct => HeatFlux.FromBtusPerSecondSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CaloriePerSecondSquareCentimeter - /// public static HeatFlux CaloriesPerSecondSquareCentimeter(this T value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? CaloriesPerSecondSquareCentimeter(this T? value) where T : struct => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentiwattPerSquareMeter - /// public static HeatFlux CentiwattsPerSquareMeter(this T value) => HeatFlux.FromCentiwattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? CentiwattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromCentiwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciwattPerSquareMeter - /// public static HeatFlux DeciwattsPerSquareMeter(this T value) => HeatFlux.FromDeciwattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? DeciwattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromDeciwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocaloriePerHourSquareMeter - /// public static HeatFlux KilocaloriesPerHourSquareMeter(this T value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? KilocaloriesPerHourSquareMeter(this T? value) where T : struct => HeatFlux.FromKilocaloriesPerHourSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocaloriePerSecondSquareCentimeter - /// public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this T value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this T? value) where T : struct => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattPerSquareMeter - /// public static HeatFlux KilowattsPerSquareMeter(this T value) => HeatFlux.FromKilowattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? KilowattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromKilowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrowattPerSquareMeter - /// public static HeatFlux MicrowattsPerSquareMeter(this T value) => HeatFlux.FromMicrowattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? MicrowattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromMicrowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliwattPerSquareMeter - /// public static HeatFlux MilliwattsPerSquareMeter(this T value) => HeatFlux.FromMilliwattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? MilliwattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromMilliwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanowattPerSquareMeter - /// public static HeatFlux NanowattsPerSquareMeter(this T value) => HeatFlux.FromNanowattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? NanowattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromNanowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerSquareFoot - /// public static HeatFlux WattsPerSquareFoot(this T value) => HeatFlux.FromWattsPerSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? WattsPerSquareFoot(this T? value) where T : struct => HeatFlux.FromWattsPerSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerSquareInch - /// public static HeatFlux WattsPerSquareInch(this T value) => HeatFlux.FromWattsPerSquareInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? WattsPerSquareInch(this T? value) where T : struct => HeatFlux.FromWattsPerSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerSquareMeter - /// public static HeatFlux WattsPerSquareMeter(this T value) => HeatFlux.FromWattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? WattsPerSquareMeter(this T? value) where T : struct => HeatFlux.FromWattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatTransferCoefficientExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatTransferCoefficientExtensions.g.cs index 95b2497adf..e47213f176 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatTransferCoefficientExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatTransferCoefficientExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToHeatTransferCoefficient { public static class NumberToHeatTransferCoefficientExtensions { - #region WattPerSquareMeterCelsius - /// public static HeatTransferCoefficient WattsPerSquareMeterCelsius(this T value) => HeatTransferCoefficient.FromWattsPerSquareMeterCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatTransferCoefficient? WattsPerSquareMeterCelsius(this T? value) where T : struct => HeatTransferCoefficient.FromWattsPerSquareMeterCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerSquareMeterKelvin - /// public static HeatTransferCoefficient WattsPerSquareMeterKelvin(this T value) => HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatTransferCoefficient? WattsPerSquareMeterKelvin(this T? value) where T : struct => HeatTransferCoefficient.FromWattsPerSquareMeterKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIlluminanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIlluminanceExtensions.g.cs index f65660e24d..63a4c2d79c 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIlluminanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIlluminanceExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToIlluminance { public static class NumberToIlluminanceExtensions { - #region Kilolux - /// public static Illuminance Kilolux(this T value) => Illuminance.FromKilolux(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Illuminance? Kilolux(this T? value) where T : struct => Illuminance.FromKilolux(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Lux - /// public static Illuminance Lux(this T value) => Illuminance.FromLux(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Illuminance? Lux(this T? value) where T : struct => Illuminance.FromLux(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megalux - /// public static Illuminance Megalux(this T value) => Illuminance.FromMegalux(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Illuminance? Megalux(this T? value) where T : struct => Illuminance.FromMegalux(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millilux - /// public static Illuminance Millilux(this T value) => Illuminance.FromMillilux(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Illuminance? Millilux(this T? value) where T : struct => Illuminance.FromMillilux(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToInformationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToInformationExtensions.g.cs index e3e9b1e43e..fc02154ffb 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToInformationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToInformationExtensions.g.cs @@ -44,292 +44,84 @@ namespace UnitsNet.Extensions.NumberToInformation { public static class NumberToInformationExtensions { - #region Bit - /// public static Information Bits(this T value) => Information.FromBits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Bits(this T? value) where T : struct => Information.FromBits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Byte - /// public static Information Bytes(this T value) => Information.FromBytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Bytes(this T? value) where T : struct => Information.FromBytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Exabit - /// public static Information Exabits(this T value) => Information.FromExabits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Exabits(this T? value) where T : struct => Information.FromExabits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Exabyte - /// public static Information Exabytes(this T value) => Information.FromExabytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Exabytes(this T? value) where T : struct => Information.FromExabytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Exbibit - /// public static Information Exbibits(this T value) => Information.FromExbibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Exbibits(this T? value) where T : struct => Information.FromExbibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Exbibyte - /// public static Information Exbibytes(this T value) => Information.FromExbibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Exbibytes(this T? value) where T : struct => Information.FromExbibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gibibit - /// public static Information Gibibits(this T value) => Information.FromGibibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Gibibits(this T? value) where T : struct => Information.FromGibibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gibibyte - /// public static Information Gibibytes(this T value) => Information.FromGibibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Gibibytes(this T? value) where T : struct => Information.FromGibibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gigabit - /// public static Information Gigabits(this T value) => Information.FromGigabits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Gigabits(this T? value) where T : struct => Information.FromGigabits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gigabyte - /// public static Information Gigabytes(this T value) => Information.FromGigabytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Gigabytes(this T? value) where T : struct => Information.FromGigabytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kibibit - /// public static Information Kibibits(this T value) => Information.FromKibibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Kibibits(this T? value) where T : struct => Information.FromKibibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kibibyte - /// public static Information Kibibytes(this T value) => Information.FromKibibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Kibibytes(this T? value) where T : struct => Information.FromKibibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilobit - /// public static Information Kilobits(this T value) => Information.FromKilobits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Kilobits(this T? value) where T : struct => Information.FromKilobits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilobyte - /// public static Information Kilobytes(this T value) => Information.FromKilobytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Kilobytes(this T? value) where T : struct => Information.FromKilobytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Mebibit - /// public static Information Mebibits(this T value) => Information.FromMebibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Mebibits(this T? value) where T : struct => Information.FromMebibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Mebibyte - /// public static Information Mebibytes(this T value) => Information.FromMebibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Mebibytes(this T? value) where T : struct => Information.FromMebibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megabit - /// public static Information Megabits(this T value) => Information.FromMegabits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Megabits(this T? value) where T : struct => Information.FromMegabits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megabyte - /// public static Information Megabytes(this T value) => Information.FromMegabytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Megabytes(this T? value) where T : struct => Information.FromMegabytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Pebibit - /// public static Information Pebibits(this T value) => Information.FromPebibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Pebibits(this T? value) where T : struct => Information.FromPebibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Pebibyte - /// public static Information Pebibytes(this T value) => Information.FromPebibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Pebibytes(this T? value) where T : struct => Information.FromPebibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Petabit - /// public static Information Petabits(this T value) => Information.FromPetabits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Petabits(this T? value) where T : struct => Information.FromPetabits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Petabyte - /// public static Information Petabytes(this T value) => Information.FromPetabytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Petabytes(this T? value) where T : struct => Information.FromPetabytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Tebibit - /// public static Information Tebibits(this T value) => Information.FromTebibits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Tebibits(this T? value) where T : struct => Information.FromTebibits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Tebibyte - /// public static Information Tebibytes(this T value) => Information.FromTebibytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Tebibytes(this T? value) where T : struct => Information.FromTebibytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Terabit - /// public static Information Terabits(this T value) => Information.FromTerabits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Terabits(this T? value) where T : struct => Information.FromTerabits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Terabyte - /// public static Information Terabytes(this T value) => Information.FromTerabytes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? Terabytes(this T? value) where T : struct => Information.FromTerabytes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradianceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradianceExtensions.g.cs index 6102ebb51b..8b202820d6 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradianceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradianceExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToIrradiance { public static class NumberToIrradianceExtensions { - #region KilowattPerSquareMeter - /// public static Irradiance KilowattsPerSquareMeter(this T value) => Irradiance.FromKilowattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiance? KilowattsPerSquareMeter(this T? value) where T : struct => Irradiance.FromKilowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerSquareMeter - /// public static Irradiance WattsPerSquareMeter(this T value) => Irradiance.FromWattsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiance? WattsPerSquareMeter(this T? value) where T : struct => Irradiance.FromWattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradiationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradiationExtensions.g.cs index 790e51aea5..f1c63a55d8 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradiationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToIrradiationExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToIrradiation { public static class NumberToIrradiationExtensions { - #region JoulePerSquareMeter - /// public static Irradiation JoulesPerSquareMeter(this T value) => Irradiation.FromJoulesPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiation? JoulesPerSquareMeter(this T? value) where T : struct => Irradiation.FromJoulesPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattHourPerSquareMeter - /// public static Irradiation KilowattHoursPerSquareMeter(this T value) => Irradiation.FromKilowattHoursPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiation? KilowattHoursPerSquareMeter(this T? value) where T : struct => Irradiation.FromKilowattHoursPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattHourPerSquareMeter - /// public static Irradiation WattHoursPerSquareMeter(this T value) => Irradiation.FromWattHoursPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiation? WattHoursPerSquareMeter(this T? value) where T : struct => Irradiation.FromWattHoursPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToKinematicViscosityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToKinematicViscosityExtensions.g.cs index ba6654d1d2..103d3c781a 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToKinematicViscosityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToKinematicViscosityExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToKinematicViscosity { public static class NumberToKinematicViscosityExtensions { - #region Centistokes - /// public static KinematicViscosity Centistokes(this T value) => KinematicViscosity.FromCentistokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Centistokes(this T? value) where T : struct => KinematicViscosity.FromCentistokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decistokes - /// public static KinematicViscosity Decistokes(this T value) => KinematicViscosity.FromDecistokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Decistokes(this T? value) where T : struct => KinematicViscosity.FromDecistokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilostokes - /// public static KinematicViscosity Kilostokes(this T value) => KinematicViscosity.FromKilostokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Kilostokes(this T? value) where T : struct => KinematicViscosity.FromKilostokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microstokes - /// public static KinematicViscosity Microstokes(this T value) => KinematicViscosity.FromMicrostokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Microstokes(this T? value) where T : struct => KinematicViscosity.FromMicrostokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millistokes - /// public static KinematicViscosity Millistokes(this T value) => KinematicViscosity.FromMillistokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Millistokes(this T? value) where T : struct => KinematicViscosity.FromMillistokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanostokes - /// public static KinematicViscosity Nanostokes(this T value) => KinematicViscosity.FromNanostokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Nanostokes(this T? value) where T : struct => KinematicViscosity.FromNanostokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMeterPerSecond - /// public static KinematicViscosity SquareMetersPerSecond(this T value) => KinematicViscosity.FromSquareMetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? SquareMetersPerSecond(this T? value) where T : struct => KinematicViscosity.FromSquareMetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Stokes - /// public static KinematicViscosity Stokes(this T value) => KinematicViscosity.FromStokes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? Stokes(this T? value) where T : struct => KinematicViscosity.FromStokes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLapseRateExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLapseRateExtensions.g.cs index 591ef48585..256c0daa49 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLapseRateExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLapseRateExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToLapseRate { public static class NumberToLapseRateExtensions { - #region DegreeCelsiusPerKilometer - /// public static LapseRate DegreesCelciusPerKilometer(this T value) => LapseRate.FromDegreesCelciusPerKilometer(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LapseRate? DegreesCelciusPerKilometer(this T? value) where T : struct => LapseRate.FromDegreesCelciusPerKilometer(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLengthExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLengthExtensions.g.cs index 0b2b14e3a0..930b5bd8fb 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLengthExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLengthExtensions.g.cs @@ -44,248 +44,72 @@ namespace UnitsNet.Extensions.NumberToLength { public static class NumberToLengthExtensions { - #region Centimeter - /// public static Length Centimeters(this T value) => Length.FromCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Centimeters(this T? value) where T : struct => Length.FromCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decimeter - /// public static Length Decimeters(this T value) => Length.FromDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Decimeters(this T? value) where T : struct => Length.FromDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DtpPica - /// public static Length DtpPicas(this T value) => Length.FromDtpPicas(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? DtpPicas(this T? value) where T : struct => Length.FromDtpPicas(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DtpPoint - /// public static Length DtpPoints(this T value) => Length.FromDtpPoints(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? DtpPoints(this T? value) where T : struct => Length.FromDtpPoints(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Fathom - /// public static Length Fathoms(this T value) => Length.FromFathoms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Fathoms(this T? value) where T : struct => Length.FromFathoms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Foot - /// public static Length Feet(this T value) => Length.FromFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Feet(this T? value) where T : struct => Length.FromFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Inch - /// public static Length Inches(this T value) => Length.FromInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Inches(this T? value) where T : struct => Length.FromInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilometer - /// public static Length Kilometers(this T value) => Length.FromKilometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Kilometers(this T? value) where T : struct => Length.FromKilometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Meter - /// public static Length Meters(this T value) => Length.FromMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Meters(this T? value) where T : struct => Length.FromMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microinch - /// public static Length Microinches(this T value) => Length.FromMicroinches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Microinches(this T? value) where T : struct => Length.FromMicroinches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Micrometer - /// public static Length Micrometers(this T value) => Length.FromMicrometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Micrometers(this T? value) where T : struct => Length.FromMicrometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Mil - /// public static Length Mils(this T value) => Length.FromMils(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Mils(this T? value) where T : struct => Length.FromMils(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Mile - /// public static Length Miles(this T value) => Length.FromMiles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Miles(this T? value) where T : struct => Length.FromMiles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millimeter - /// public static Length Millimeters(this T value) => Length.FromMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Millimeters(this T? value) where T : struct => Length.FromMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanometer - /// public static Length Nanometers(this T value) => Length.FromNanometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Nanometers(this T? value) where T : struct => Length.FromNanometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NauticalMile - /// public static Length NauticalMiles(this T value) => Length.FromNauticalMiles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? NauticalMiles(this T? value) where T : struct => Length.FromNauticalMiles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PrinterPica - /// public static Length PrinterPicas(this T value) => Length.FromPrinterPicas(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? PrinterPicas(this T? value) where T : struct => Length.FromPrinterPicas(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PrinterPoint - /// public static Length PrinterPoints(this T value) => Length.FromPrinterPoints(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? PrinterPoints(this T? value) where T : struct => Length.FromPrinterPoints(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Shackle - /// public static Length Shackles(this T value) => Length.FromShackles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Shackles(this T? value) where T : struct => Length.FromShackles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Twip - /// public static Length Twips(this T value) => Length.FromTwips(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Twips(this T? value) where T : struct => Length.FromTwips(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsSurveyFoot - /// public static Length UsSurveyFeet(this T value) => Length.FromUsSurveyFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? UsSurveyFeet(this T? value) where T : struct => Length.FromUsSurveyFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Yard - /// public static Length Yards(this T value) => Length.FromYards(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? Yards(this T? value) where T : struct => Length.FromYards(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLevelExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLevelExtensions.g.cs index f0d7aed5c8..024d9d1b64 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLevelExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLevelExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToLevel { public static class NumberToLevelExtensions { - #region Decibel - /// public static Level Decibels(this T value) => Level.FromDecibels(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Level? Decibels(this T? value) where T : struct => Level.FromDecibels(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Neper - /// public static Level Nepers(this T value) => Level.FromNepers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Level? Nepers(this T? value) where T : struct => Level.FromNepers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLinearDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLinearDensityExtensions.g.cs index 9481175332..fcc43ec98f 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLinearDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLinearDensityExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToLinearDensity { public static class NumberToLinearDensityExtensions { - #region GramPerMeter - /// public static LinearDensity GramsPerMeter(this T value) => LinearDensity.FromGramsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LinearDensity? GramsPerMeter(this T? value) where T : struct => LinearDensity.FromGramsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerMeter - /// public static LinearDensity KilogramsPerMeter(this T value) => LinearDensity.FromKilogramsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LinearDensity? KilogramsPerMeter(this T? value) where T : struct => LinearDensity.FromKilogramsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerFoot - /// public static LinearDensity PoundsPerFoot(this T value) => LinearDensity.FromPoundsPerFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LinearDensity? PoundsPerFoot(this T? value) where T : struct => LinearDensity.FromPoundsPerFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousFluxExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousFluxExtensions.g.cs index 3db0da00d8..87e844ed6b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousFluxExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousFluxExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToLuminousFlux { public static class NumberToLuminousFluxExtensions { - #region Lumen - /// public static LuminousFlux Lumens(this T value) => LuminousFlux.FromLumens(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LuminousFlux? Lumens(this T? value) where T : struct => LuminousFlux.FromLumens(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousIntensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousIntensityExtensions.g.cs index 79c9c9cd1b..6459050eb6 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousIntensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToLuminousIntensityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToLuminousIntensity { public static class NumberToLuminousIntensityExtensions { - #region Candela - /// public static LuminousIntensity Candela(this T value) => LuminousIntensity.FromCandela(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LuminousIntensity? Candela(this T? value) where T : struct => LuminousIntensity.FromCandela(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFieldExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFieldExtensions.g.cs index b3484f756b..c7657d43b0 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFieldExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFieldExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToMagneticField { public static class NumberToMagneticFieldExtensions { - #region Tesla - /// public static MagneticField Teslas(this T value) => MagneticField.FromTeslas(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MagneticField? Teslas(this T? value) where T : struct => MagneticField.FromTeslas(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFluxExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFluxExtensions.g.cs index 935ecb2375..fc48c0ef6f 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFluxExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagneticFluxExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToMagneticFlux { public static class NumberToMagneticFluxExtensions { - #region Weber - /// public static MagneticFlux Webers(this T value) => MagneticFlux.FromWebers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MagneticFlux? Webers(this T? value) where T : struct => MagneticFlux.FromWebers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagnetizationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagnetizationExtensions.g.cs index cce5daf093..f9c977ccad 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagnetizationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMagnetizationExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToMagnetization { public static class NumberToMagnetizationExtensions { - #region AmperePerMeter - /// public static Magnetization AmperesPerMeter(this T value) => Magnetization.FromAmperesPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Magnetization? AmperesPerMeter(this T? value) where T : struct => Magnetization.FromAmperesPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassExtensions.g.cs index 1d75e9f3e0..8a20899ef2 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassExtensions.g.cs @@ -44,237 +44,69 @@ namespace UnitsNet.Extensions.NumberToMass { public static class NumberToMassExtensions { - #region Centigram - /// public static Mass Centigrams(this T value) => Mass.FromCentigrams(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Centigrams(this T? value) where T : struct => Mass.FromCentigrams(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decagram - /// public static Mass Decagrams(this T value) => Mass.FromDecagrams(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Decagrams(this T? value) where T : struct => Mass.FromDecagrams(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decigram - /// public static Mass Decigrams(this T value) => Mass.FromDecigrams(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Decigrams(this T? value) where T : struct => Mass.FromDecigrams(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gram - /// public static Mass Grams(this T value) => Mass.FromGrams(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Grams(this T? value) where T : struct => Mass.FromGrams(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hectogram - /// public static Mass Hectograms(this T value) => Mass.FromHectograms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Hectograms(this T? value) where T : struct => Mass.FromHectograms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilogram - /// public static Mass Kilograms(this T value) => Mass.FromKilograms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Kilograms(this T? value) where T : struct => Mass.FromKilograms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilopound - /// public static Mass Kilopounds(this T value) => Mass.FromKilopounds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Kilopounds(this T? value) where T : struct => Mass.FromKilopounds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilotonne - /// public static Mass Kilotonnes(this T value) => Mass.FromKilotonnes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Kilotonnes(this T? value) where T : struct => Mass.FromKilotonnes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LongHundredweight - /// public static Mass LongHundredweight(this T value) => Mass.FromLongHundredweight(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? LongHundredweight(this T? value) where T : struct => Mass.FromLongHundredweight(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LongTon - /// public static Mass LongTons(this T value) => Mass.FromLongTons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? LongTons(this T? value) where T : struct => Mass.FromLongTons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megapound - /// public static Mass Megapounds(this T value) => Mass.FromMegapounds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Megapounds(this T? value) where T : struct => Mass.FromMegapounds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megatonne - /// public static Mass Megatonnes(this T value) => Mass.FromMegatonnes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Megatonnes(this T? value) where T : struct => Mass.FromMegatonnes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microgram - /// public static Mass Micrograms(this T value) => Mass.FromMicrograms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Micrograms(this T? value) where T : struct => Mass.FromMicrograms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milligram - /// public static Mass Milligrams(this T value) => Mass.FromMilligrams(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Milligrams(this T? value) where T : struct => Mass.FromMilligrams(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanogram - /// public static Mass Nanograms(this T value) => Mass.FromNanograms(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Nanograms(this T? value) where T : struct => Mass.FromNanograms(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Ounce - /// public static Mass Ounces(this T value) => Mass.FromOunces(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Ounces(this T? value) where T : struct => Mass.FromOunces(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Pound - /// public static Mass Pounds(this T value) => Mass.FromPounds(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Pounds(this T? value) where T : struct => Mass.FromPounds(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ShortHundredweight - /// public static Mass ShortHundredweight(this T value) => Mass.FromShortHundredweight(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? ShortHundredweight(this T? value) where T : struct => Mass.FromShortHundredweight(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ShortTon - /// public static Mass ShortTons(this T value) => Mass.FromShortTons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? ShortTons(this T? value) where T : struct => Mass.FromShortTons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Stone - /// public static Mass Stone(this T value) => Mass.FromStone(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Stone(this T? value) where T : struct => Mass.FromStone(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Tonne - /// public static Mass Tonnes(this T value) => Mass.FromTonnes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? Tonnes(this T? value) where T : struct => Mass.FromTonnes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFlowExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFlowExtensions.g.cs index 133b50a4eb..8db4e6c06b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFlowExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFlowExtensions.g.cs @@ -44,171 +44,51 @@ namespace UnitsNet.Extensions.NumberToMassFlow { public static class NumberToMassFlowExtensions { - #region CentigramPerSecond - /// public static MassFlow CentigramsPerSecond(this T value) => MassFlow.FromCentigramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? CentigramsPerSecond(this T? value) where T : struct => MassFlow.FromCentigramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecagramPerSecond - /// public static MassFlow DecagramsPerSecond(this T value) => MassFlow.FromDecagramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? DecagramsPerSecond(this T? value) where T : struct => MassFlow.FromDecagramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecigramPerSecond - /// public static MassFlow DecigramsPerSecond(this T value) => MassFlow.FromDecigramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? DecigramsPerSecond(this T? value) where T : struct => MassFlow.FromDecigramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerSecond - /// public static MassFlow GramsPerSecond(this T value) => MassFlow.FromGramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? GramsPerSecond(this T? value) where T : struct => MassFlow.FromGramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HectogramPerSecond - /// public static MassFlow HectogramsPerSecond(this T value) => MassFlow.FromHectogramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? HectogramsPerSecond(this T? value) where T : struct => MassFlow.FromHectogramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerHour - /// public static MassFlow KilogramsPerHour(this T value) => MassFlow.FromKilogramsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? KilogramsPerHour(this T? value) where T : struct => MassFlow.FromKilogramsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerSecond - /// public static MassFlow KilogramsPerSecond(this T value) => MassFlow.FromKilogramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? KilogramsPerSecond(this T? value) where T : struct => MassFlow.FromKilogramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegapoundPerHour - /// public static MassFlow MegapoundsPerHour(this T value) => MassFlow.FromMegapoundsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? MegapoundsPerHour(this T? value) where T : struct => MassFlow.FromMegapoundsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrogramPerSecond - /// public static MassFlow MicrogramsPerSecond(this T value) => MassFlow.FromMicrogramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? MicrogramsPerSecond(this T? value) where T : struct => MassFlow.FromMicrogramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerSecond - /// public static MassFlow MilligramsPerSecond(this T value) => MassFlow.FromMilligramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? MilligramsPerSecond(this T? value) where T : struct => MassFlow.FromMilligramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanogramPerSecond - /// public static MassFlow NanogramsPerSecond(this T value) => MassFlow.FromNanogramsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? NanogramsPerSecond(this T? value) where T : struct => MassFlow.FromNanogramsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerHour - /// public static MassFlow PoundsPerHour(this T value) => MassFlow.FromPoundsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? PoundsPerHour(this T? value) where T : struct => MassFlow.FromPoundsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ShortTonPerHour - /// public static MassFlow ShortTonsPerHour(this T value) => MassFlow.FromShortTonsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? ShortTonsPerHour(this T? value) where T : struct => MassFlow.FromShortTonsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonnePerDay - /// public static MassFlow TonnesPerDay(this T value) => MassFlow.FromTonnesPerDay(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? TonnesPerDay(this T? value) where T : struct => MassFlow.FromTonnesPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonnePerHour - /// public static MassFlow TonnesPerHour(this T value) => MassFlow.FromTonnesPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? TonnesPerHour(this T? value) where T : struct => MassFlow.FromTonnesPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFluxExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFluxExtensions.g.cs index 08731e83a2..8a820b0508 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFluxExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassFluxExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToMassFlux { public static class NumberToMassFluxExtensions { - #region GramPerSecondPerSquareMeter - /// public static MassFlux GramsPerSecondPerSquareMeter(this T value) => MassFlux.FromGramsPerSecondPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlux? GramsPerSecondPerSquareMeter(this T? value) where T : struct => MassFlux.FromGramsPerSecondPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerSecondPerSquareMeter - /// public static MassFlux KilogramsPerSecondPerSquareMeter(this T value) => MassFlux.FromKilogramsPerSecondPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlux? KilogramsPerSecondPerSquareMeter(this T? value) where T : struct => MassFlux.FromKilogramsPerSecondPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassMomentOfInertiaExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassMomentOfInertiaExtensions.g.cs index 0762120e59..4f51429b4b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassMomentOfInertiaExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMassMomentOfInertiaExtensions.g.cs @@ -44,292 +44,84 @@ namespace UnitsNet.Extensions.NumberToMassMomentOfInertia { public static class NumberToMassMomentOfInertiaExtensions { - #region GramSquareCentimeter - /// public static MassMomentOfInertia GramSquareCentimeters(this T value) => MassMomentOfInertia.FromGramSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? GramSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromGramSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramSquareDecimeter - /// public static MassMomentOfInertia GramSquareDecimeters(this T value) => MassMomentOfInertia.FromGramSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? GramSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromGramSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramSquareMeter - /// public static MassMomentOfInertia GramSquareMeters(this T value) => MassMomentOfInertia.FromGramSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? GramSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromGramSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramSquareMillimeter - /// public static MassMomentOfInertia GramSquareMillimeters(this T value) => MassMomentOfInertia.FromGramSquareMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? GramSquareMillimeters(this T? value) where T : struct => MassMomentOfInertia.FromGramSquareMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramSquareCentimeter - /// public static MassMomentOfInertia KilogramSquareCentimeters(this T value) => MassMomentOfInertia.FromKilogramSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilogramSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilogramSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramSquareDecimeter - /// public static MassMomentOfInertia KilogramSquareDecimeters(this T value) => MassMomentOfInertia.FromKilogramSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilogramSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilogramSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramSquareMeter - /// public static MassMomentOfInertia KilogramSquareMeters(this T value) => MassMomentOfInertia.FromKilogramSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilogramSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromKilogramSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramSquareMillimeter - /// public static MassMomentOfInertia KilogramSquareMillimeters(this T value) => MassMomentOfInertia.FromKilogramSquareMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilogramSquareMillimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilogramSquareMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilotonneSquareCentimeter - /// public static MassMomentOfInertia KilotonneSquareCentimeters(this T value) => MassMomentOfInertia.FromKilotonneSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilotonneSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilotonneSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilotonneSquareDecimeter - /// public static MassMomentOfInertia KilotonneSquareDecimeters(this T value) => MassMomentOfInertia.FromKilotonneSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilotonneSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilotonneSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilotonneSquareMeter - /// public static MassMomentOfInertia KilotonneSquareMeters(this T value) => MassMomentOfInertia.FromKilotonneSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilotonneSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromKilotonneSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilotonneSquareMilimeter - /// public static MassMomentOfInertia KilotonneSquareMilimeters(this T value) => MassMomentOfInertia.FromKilotonneSquareMilimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? KilotonneSquareMilimeters(this T? value) where T : struct => MassMomentOfInertia.FromKilotonneSquareMilimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegatonneSquareCentimeter - /// public static MassMomentOfInertia MegatonneSquareCentimeters(this T value) => MassMomentOfInertia.FromMegatonneSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MegatonneSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromMegatonneSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegatonneSquareDecimeter - /// public static MassMomentOfInertia MegatonneSquareDecimeters(this T value) => MassMomentOfInertia.FromMegatonneSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MegatonneSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromMegatonneSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegatonneSquareMeter - /// public static MassMomentOfInertia MegatonneSquareMeters(this T value) => MassMomentOfInertia.FromMegatonneSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MegatonneSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromMegatonneSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegatonneSquareMilimeter - /// public static MassMomentOfInertia MegatonneSquareMilimeters(this T value) => MassMomentOfInertia.FromMegatonneSquareMilimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MegatonneSquareMilimeters(this T? value) where T : struct => MassMomentOfInertia.FromMegatonneSquareMilimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramSquareCentimeter - /// public static MassMomentOfInertia MilligramSquareCentimeters(this T value) => MassMomentOfInertia.FromMilligramSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MilligramSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromMilligramSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramSquareDecimeter - /// public static MassMomentOfInertia MilligramSquareDecimeters(this T value) => MassMomentOfInertia.FromMilligramSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MilligramSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromMilligramSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramSquareMeter - /// public static MassMomentOfInertia MilligramSquareMeters(this T value) => MassMomentOfInertia.FromMilligramSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MilligramSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromMilligramSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramSquareMillimeter - /// public static MassMomentOfInertia MilligramSquareMillimeters(this T value) => MassMomentOfInertia.FromMilligramSquareMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? MilligramSquareMillimeters(this T? value) where T : struct => MassMomentOfInertia.FromMilligramSquareMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundSquareFoot - /// public static MassMomentOfInertia PoundSquareFeet(this T value) => MassMomentOfInertia.FromPoundSquareFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? PoundSquareFeet(this T? value) where T : struct => MassMomentOfInertia.FromPoundSquareFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundSquareInch - /// public static MassMomentOfInertia PoundSquareInches(this T value) => MassMomentOfInertia.FromPoundSquareInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? PoundSquareInches(this T? value) where T : struct => MassMomentOfInertia.FromPoundSquareInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneSquareCentimeter - /// public static MassMomentOfInertia TonneSquareCentimeters(this T value) => MassMomentOfInertia.FromTonneSquareCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? TonneSquareCentimeters(this T? value) where T : struct => MassMomentOfInertia.FromTonneSquareCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneSquareDecimeter - /// public static MassMomentOfInertia TonneSquareDecimeters(this T value) => MassMomentOfInertia.FromTonneSquareDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? TonneSquareDecimeters(this T? value) where T : struct => MassMomentOfInertia.FromTonneSquareDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneSquareMeter - /// public static MassMomentOfInertia TonneSquareMeters(this T value) => MassMomentOfInertia.FromTonneSquareMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? TonneSquareMeters(this T? value) where T : struct => MassMomentOfInertia.FromTonneSquareMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneSquareMilimeter - /// public static MassMomentOfInertia TonneSquareMilimeters(this T value) => MassMomentOfInertia.FromTonneSquareMilimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? TonneSquareMilimeters(this T? value) where T : struct => MassMomentOfInertia.FromTonneSquareMilimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEnergyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEnergyExtensions.g.cs index bd21a01cfe..04710dbb24 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEnergyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEnergyExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToMolarEnergy { public static class NumberToMolarEnergyExtensions { - #region JoulePerMole - /// public static MolarEnergy JoulesPerMole(this T value) => MolarEnergy.FromJoulesPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEnergy? JoulesPerMole(this T? value) where T : struct => MolarEnergy.FromJoulesPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerMole - /// public static MolarEnergy KilojoulesPerMole(this T value) => MolarEnergy.FromKilojoulesPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEnergy? KilojoulesPerMole(this T? value) where T : struct => MolarEnergy.FromKilojoulesPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerMole - /// public static MolarEnergy MegajoulesPerMole(this T value) => MolarEnergy.FromMegajoulesPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEnergy? MegajoulesPerMole(this T? value) where T : struct => MolarEnergy.FromMegajoulesPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEntropyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEntropyExtensions.g.cs index 1585ae6298..ec727f851d 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEntropyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarEntropyExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToMolarEntropy { public static class NumberToMolarEntropyExtensions { - #region JoulePerMoleKelvin - /// public static MolarEntropy JoulesPerMoleKelvin(this T value) => MolarEntropy.FromJoulesPerMoleKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEntropy? JoulesPerMoleKelvin(this T? value) where T : struct => MolarEntropy.FromJoulesPerMoleKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerMoleKelvin - /// public static MolarEntropy KilojoulesPerMoleKelvin(this T value) => MolarEntropy.FromKilojoulesPerMoleKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEntropy? KilojoulesPerMoleKelvin(this T? value) where T : struct => MolarEntropy.FromKilojoulesPerMoleKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerMoleKelvin - /// public static MolarEntropy MegajoulesPerMoleKelvin(this T value) => MolarEntropy.FromMegajoulesPerMoleKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEntropy? MegajoulesPerMoleKelvin(this T? value) where T : struct => MolarEntropy.FromMegajoulesPerMoleKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarMassExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarMassExtensions.g.cs index bde7d51d10..71386056cb 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarMassExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarMassExtensions.g.cs @@ -44,138 +44,42 @@ namespace UnitsNet.Extensions.NumberToMolarMass { public static class NumberToMolarMassExtensions { - #region CentigramPerMole - /// public static MolarMass CentigramsPerMole(this T value) => MolarMass.FromCentigramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? CentigramsPerMole(this T? value) where T : struct => MolarMass.FromCentigramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecagramPerMole - /// public static MolarMass DecagramsPerMole(this T value) => MolarMass.FromDecagramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? DecagramsPerMole(this T? value) where T : struct => MolarMass.FromDecagramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecigramPerMole - /// public static MolarMass DecigramsPerMole(this T value) => MolarMass.FromDecigramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? DecigramsPerMole(this T? value) where T : struct => MolarMass.FromDecigramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GramPerMole - /// public static MolarMass GramsPerMole(this T value) => MolarMass.FromGramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? GramsPerMole(this T? value) where T : struct => MolarMass.FromGramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HectogramPerMole - /// public static MolarMass HectogramsPerMole(this T value) => MolarMass.FromHectogramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? HectogramsPerMole(this T? value) where T : struct => MolarMass.FromHectogramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramPerMole - /// public static MolarMass KilogramsPerMole(this T value) => MolarMass.FromKilogramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? KilogramsPerMole(this T? value) where T : struct => MolarMass.FromKilogramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundPerMole - /// public static MolarMass KilopoundsPerMole(this T value) => MolarMass.FromKilopoundsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? KilopoundsPerMole(this T? value) where T : struct => MolarMass.FromKilopoundsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegapoundPerMole - /// public static MolarMass MegapoundsPerMole(this T value) => MolarMass.FromMegapoundsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? MegapoundsPerMole(this T? value) where T : struct => MolarMass.FromMegapoundsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrogramPerMole - /// public static MolarMass MicrogramsPerMole(this T value) => MolarMass.FromMicrogramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? MicrogramsPerMole(this T? value) where T : struct => MolarMass.FromMicrogramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilligramPerMole - /// public static MolarMass MilligramsPerMole(this T value) => MolarMass.FromMilligramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? MilligramsPerMole(this T? value) where T : struct => MolarMass.FromMilligramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanogramPerMole - /// public static MolarMass NanogramsPerMole(this T value) => MolarMass.FromNanogramsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? NanogramsPerMole(this T? value) where T : struct => MolarMass.FromNanogramsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundPerMole - /// public static MolarMass PoundsPerMole(this T value) => MolarMass.FromPoundsPerMole(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? PoundsPerMole(this T? value) where T : struct => MolarMass.FromPoundsPerMole(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarityExtensions.g.cs index e8a9e7d2e1..1ac5579802 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToMolarityExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToMolarity { public static class NumberToMolarityExtensions { - #region CentimolesPerLiter - /// public static Molarity CentimolesPerLiter(this T value) => Molarity.FromCentimolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? CentimolesPerLiter(this T? value) where T : struct => Molarity.FromCentimolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecimolesPerLiter - /// public static Molarity DecimolesPerLiter(this T value) => Molarity.FromDecimolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? DecimolesPerLiter(this T? value) where T : struct => Molarity.FromDecimolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicromolesPerLiter - /// public static Molarity MicromolesPerLiter(this T value) => Molarity.FromMicromolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? MicromolesPerLiter(this T? value) where T : struct => Molarity.FromMicromolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimolesPerLiter - /// public static Molarity MillimolesPerLiter(this T value) => Molarity.FromMillimolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? MillimolesPerLiter(this T? value) where T : struct => Molarity.FromMillimolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MolesPerCubicMeter - /// public static Molarity MolesPerCubicMeter(this T value) => Molarity.FromMolesPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? MolesPerCubicMeter(this T? value) where T : struct => Molarity.FromMolesPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MolesPerLiter - /// public static Molarity MolesPerLiter(this T value) => Molarity.FromMolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? MolesPerLiter(this T? value) where T : struct => Molarity.FromMolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanomolesPerLiter - /// public static Molarity NanomolesPerLiter(this T value) => Molarity.FromNanomolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? NanomolesPerLiter(this T? value) where T : struct => Molarity.FromNanomolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicomolesPerLiter - /// public static Molarity PicomolesPerLiter(this T value) => Molarity.FromPicomolesPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? PicomolesPerLiter(this T? value) where T : struct => Molarity.FromPicomolesPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermeabilityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermeabilityExtensions.g.cs index e098fc24ea..823d428c34 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermeabilityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermeabilityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToPermeability { public static class NumberToPermeabilityExtensions { - #region HenryPerMeter - /// public static Permeability HenriesPerMeter(this T value) => Permeability.FromHenriesPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Permeability? HenriesPerMeter(this T? value) where T : struct => Permeability.FromHenriesPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermittivityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermittivityExtensions.g.cs index 8744ae9a5f..647088a5c1 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermittivityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPermittivityExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToPermittivity { public static class NumberToPermittivityExtensions { - #region FaradPerMeter - /// public static Permittivity FaradsPerMeter(this T value) => Permittivity.FromFaradsPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Permittivity? FaradsPerMeter(this T? value) where T : struct => Permittivity.FromFaradsPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs index fdf6c889f3..e6ed64ac9f 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs @@ -44,490 +44,138 @@ namespace UnitsNet.Extensions.NumberToPowerDensity { public static class NumberToPowerDensityExtensions { - #region DecawattPerCubicFoot - /// public static PowerDensity DecawattsPerCubicFoot(this T value) => PowerDensity.FromDecawattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DecawattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromDecawattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecawattPerCubicInch - /// public static PowerDensity DecawattsPerCubicInch(this T value) => PowerDensity.FromDecawattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DecawattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromDecawattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecawattPerCubicMeter - /// public static PowerDensity DecawattsPerCubicMeter(this T value) => PowerDensity.FromDecawattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DecawattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromDecawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecawattPerLiter - /// public static PowerDensity DecawattsPerLiter(this T value) => PowerDensity.FromDecawattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DecawattsPerLiter(this T? value) where T : struct => PowerDensity.FromDecawattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciwattPerCubicFoot - /// public static PowerDensity DeciwattsPerCubicFoot(this T value) => PowerDensity.FromDeciwattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DeciwattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromDeciwattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciwattPerCubicInch - /// public static PowerDensity DeciwattsPerCubicInch(this T value) => PowerDensity.FromDeciwattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DeciwattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromDeciwattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciwattPerCubicMeter - /// public static PowerDensity DeciwattsPerCubicMeter(this T value) => PowerDensity.FromDeciwattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DeciwattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromDeciwattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciwattPerLiter - /// public static PowerDensity DeciwattsPerLiter(this T value) => PowerDensity.FromDeciwattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? DeciwattsPerLiter(this T? value) where T : struct => PowerDensity.FromDeciwattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigawattPerCubicFoot - /// public static PowerDensity GigawattsPerCubicFoot(this T value) => PowerDensity.FromGigawattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? GigawattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromGigawattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigawattPerCubicInch - /// public static PowerDensity GigawattsPerCubicInch(this T value) => PowerDensity.FromGigawattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? GigawattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromGigawattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigawattPerCubicMeter - /// public static PowerDensity GigawattsPerCubicMeter(this T value) => PowerDensity.FromGigawattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? GigawattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromGigawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region GigawattPerLiter - /// public static PowerDensity GigawattsPerLiter(this T value) => PowerDensity.FromGigawattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? GigawattsPerLiter(this T? value) where T : struct => PowerDensity.FromGigawattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattPerCubicFoot - /// public static PowerDensity KilowattsPerCubicFoot(this T value) => PowerDensity.FromKilowattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? KilowattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromKilowattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattPerCubicInch - /// public static PowerDensity KilowattsPerCubicInch(this T value) => PowerDensity.FromKilowattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? KilowattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromKilowattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattPerCubicMeter - /// public static PowerDensity KilowattsPerCubicMeter(this T value) => PowerDensity.FromKilowattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? KilowattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromKilowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattPerLiter - /// public static PowerDensity KilowattsPerLiter(this T value) => PowerDensity.FromKilowattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? KilowattsPerLiter(this T? value) where T : struct => PowerDensity.FromKilowattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattPerCubicFoot - /// public static PowerDensity MegawattsPerCubicFoot(this T value) => PowerDensity.FromMegawattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MegawattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromMegawattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattPerCubicInch - /// public static PowerDensity MegawattsPerCubicInch(this T value) => PowerDensity.FromMegawattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MegawattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromMegawattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattPerCubicMeter - /// public static PowerDensity MegawattsPerCubicMeter(this T value) => PowerDensity.FromMegawattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MegawattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromMegawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattPerLiter - /// public static PowerDensity MegawattsPerLiter(this T value) => PowerDensity.FromMegawattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MegawattsPerLiter(this T? value) where T : struct => PowerDensity.FromMegawattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrowattPerCubicFoot - /// public static PowerDensity MicrowattsPerCubicFoot(this T value) => PowerDensity.FromMicrowattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MicrowattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromMicrowattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrowattPerCubicInch - /// public static PowerDensity MicrowattsPerCubicInch(this T value) => PowerDensity.FromMicrowattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MicrowattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromMicrowattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrowattPerCubicMeter - /// public static PowerDensity MicrowattsPerCubicMeter(this T value) => PowerDensity.FromMicrowattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MicrowattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromMicrowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrowattPerLiter - /// public static PowerDensity MicrowattsPerLiter(this T value) => PowerDensity.FromMicrowattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MicrowattsPerLiter(this T? value) where T : struct => PowerDensity.FromMicrowattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliwattPerCubicFoot - /// public static PowerDensity MilliwattsPerCubicFoot(this T value) => PowerDensity.FromMilliwattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MilliwattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromMilliwattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliwattPerCubicInch - /// public static PowerDensity MilliwattsPerCubicInch(this T value) => PowerDensity.FromMilliwattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MilliwattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromMilliwattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliwattPerCubicMeter - /// public static PowerDensity MilliwattsPerCubicMeter(this T value) => PowerDensity.FromMilliwattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MilliwattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromMilliwattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliwattPerLiter - /// public static PowerDensity MilliwattsPerLiter(this T value) => PowerDensity.FromMilliwattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? MilliwattsPerLiter(this T? value) where T : struct => PowerDensity.FromMilliwattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanowattPerCubicFoot - /// public static PowerDensity NanowattsPerCubicFoot(this T value) => PowerDensity.FromNanowattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? NanowattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromNanowattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanowattPerCubicInch - /// public static PowerDensity NanowattsPerCubicInch(this T value) => PowerDensity.FromNanowattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? NanowattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromNanowattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanowattPerCubicMeter - /// public static PowerDensity NanowattsPerCubicMeter(this T value) => PowerDensity.FromNanowattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? NanowattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromNanowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanowattPerLiter - /// public static PowerDensity NanowattsPerLiter(this T value) => PowerDensity.FromNanowattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? NanowattsPerLiter(this T? value) where T : struct => PowerDensity.FromNanowattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicowattPerCubicFoot - /// public static PowerDensity PicowattsPerCubicFoot(this T value) => PowerDensity.FromPicowattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? PicowattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromPicowattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicowattPerCubicInch - /// public static PowerDensity PicowattsPerCubicInch(this T value) => PowerDensity.FromPicowattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? PicowattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromPicowattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicowattPerCubicMeter - /// public static PowerDensity PicowattsPerCubicMeter(this T value) => PowerDensity.FromPicowattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? PicowattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromPicowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PicowattPerLiter - /// public static PowerDensity PicowattsPerLiter(this T value) => PowerDensity.FromPicowattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? PicowattsPerLiter(this T? value) where T : struct => PowerDensity.FromPicowattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerawattPerCubicFoot - /// public static PowerDensity TerawattsPerCubicFoot(this T value) => PowerDensity.FromTerawattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? TerawattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromTerawattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerawattPerCubicInch - /// public static PowerDensity TerawattsPerCubicInch(this T value) => PowerDensity.FromTerawattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? TerawattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromTerawattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerawattPerCubicMeter - /// public static PowerDensity TerawattsPerCubicMeter(this T value) => PowerDensity.FromTerawattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? TerawattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromTerawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TerawattPerLiter - /// public static PowerDensity TerawattsPerLiter(this T value) => PowerDensity.FromTerawattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? TerawattsPerLiter(this T? value) where T : struct => PowerDensity.FromTerawattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerCubicFoot - /// public static PowerDensity WattsPerCubicFoot(this T value) => PowerDensity.FromWattsPerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? WattsPerCubicFoot(this T? value) where T : struct => PowerDensity.FromWattsPerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerCubicInch - /// public static PowerDensity WattsPerCubicInch(this T value) => PowerDensity.FromWattsPerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? WattsPerCubicInch(this T? value) where T : struct => PowerDensity.FromWattsPerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerCubicMeter - /// public static PowerDensity WattsPerCubicMeter(this T value) => PowerDensity.FromWattsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? WattsPerCubicMeter(this T? value) where T : struct => PowerDensity.FromWattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerLiter - /// public static PowerDensity WattsPerLiter(this T value) => PowerDensity.FromWattsPerLiter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? WattsPerLiter(this T? value) where T : struct => PowerDensity.FromWattsPerLiter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerExtensions.g.cs index 6b787f7371..9de02cb592 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerExtensions.g.cs @@ -44,226 +44,66 @@ namespace UnitsNet.Extensions.NumberToPower { public static class NumberToPowerExtensions { - #region BoilerHorsepower - /// public static Power BoilerHorsepower(this T value) => Power.FromBoilerHorsepower(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? BoilerHorsepower(this T? value) where T : struct => Power.FromBoilerHorsepower(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region BritishThermalUnitPerHour - /// public static Power BritishThermalUnitsPerHour(this T value) => Power.FromBritishThermalUnitsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? BritishThermalUnitsPerHour(this T? value) where T : struct => Power.FromBritishThermalUnitsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decawatt - /// public static Power Decawatts(this T value) => Power.FromDecawatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Decawatts(this T? value) where T : struct => Power.FromDecawatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Deciwatt - /// public static Power Deciwatts(this T value) => Power.FromDeciwatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Deciwatts(this T? value) where T : struct => Power.FromDeciwatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ElectricalHorsepower - /// public static Power ElectricalHorsepower(this T value) => Power.FromElectricalHorsepower(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? ElectricalHorsepower(this T? value) where T : struct => Power.FromElectricalHorsepower(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Femtowatt - /// public static Power Femtowatts(this T value) => Power.FromFemtowatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Femtowatts(this T? value) where T : struct => Power.FromFemtowatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gigawatt - /// public static Power Gigawatts(this T value) => Power.FromGigawatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Gigawatts(this T? value) where T : struct => Power.FromGigawatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HydraulicHorsepower - /// public static Power HydraulicHorsepower(this T value) => Power.FromHydraulicHorsepower(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? HydraulicHorsepower(this T? value) where T : struct => Power.FromHydraulicHorsepower(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilobritishThermalUnitPerHour - /// public static Power KilobritishThermalUnitsPerHour(this T value) => Power.FromKilobritishThermalUnitsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? KilobritishThermalUnitsPerHour(this T? value) where T : struct => Power.FromKilobritishThermalUnitsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilowatt - /// public static Power Kilowatts(this T value) => Power.FromKilowatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Kilowatts(this T? value) where T : struct => Power.FromKilowatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MechanicalHorsepower - /// public static Power MechanicalHorsepower(this T value) => Power.FromMechanicalHorsepower(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? MechanicalHorsepower(this T? value) where T : struct => Power.FromMechanicalHorsepower(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megawatt - /// public static Power Megawatts(this T value) => Power.FromMegawatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Megawatts(this T? value) where T : struct => Power.FromMegawatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MetricHorsepower - /// public static Power MetricHorsepower(this T value) => Power.FromMetricHorsepower(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? MetricHorsepower(this T? value) where T : struct => Power.FromMetricHorsepower(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microwatt - /// public static Power Microwatts(this T value) => Power.FromMicrowatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Microwatts(this T? value) where T : struct => Power.FromMicrowatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milliwatt - /// public static Power Milliwatts(this T value) => Power.FromMilliwatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Milliwatts(this T? value) where T : struct => Power.FromMilliwatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Nanowatt - /// public static Power Nanowatts(this T value) => Power.FromNanowatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Nanowatts(this T? value) where T : struct => Power.FromNanowatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Petawatt - /// public static Power Petawatts(this T value) => Power.FromPetawatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Petawatts(this T? value) where T : struct => Power.FromPetawatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Picowatt - /// public static Power Picowatts(this T value) => Power.FromPicowatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Picowatts(this T? value) where T : struct => Power.FromPicowatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Terawatt - /// public static Power Terawatts(this T value) => Power.FromTerawatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Terawatts(this T? value) where T : struct => Power.FromTerawatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Watt - /// public static Power Watts(this T value) => Power.FromWatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? Watts(this T? value) where T : struct => Power.FromWatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerRatioExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerRatioExtensions.g.cs index df98da38e2..996e47fbd5 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerRatioExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerRatioExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToPowerRatio { public static class NumberToPowerRatioExtensions { - #region DecibelMilliwatt - /// public static PowerRatio DecibelMilliwatts(this T value) => PowerRatio.FromDecibelMilliwatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerRatio? DecibelMilliwatts(this T? value) where T : struct => PowerRatio.FromDecibelMilliwatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecibelWatt - /// public static PowerRatio DecibelWatts(this T value) => PowerRatio.FromDecibelWatts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerRatio? DecibelWatts(this T? value) where T : struct => PowerRatio.FromDecibelWatts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureChangeRateExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureChangeRateExtensions.g.cs index afb087b144..380cdb9cce 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureChangeRateExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureChangeRateExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToPressureChangeRate { public static class NumberToPressureChangeRateExtensions { - #region AtmospherePerSecond - /// public static PressureChangeRate AtmospheresPerSecond(this T value) => PressureChangeRate.FromAtmospheresPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PressureChangeRate? AtmospheresPerSecond(this T? value) where T : struct => PressureChangeRate.FromAtmospheresPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopascalPerSecond - /// public static PressureChangeRate KilopascalsPerSecond(this T value) => PressureChangeRate.FromKilopascalsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PressureChangeRate? KilopascalsPerSecond(this T? value) where T : struct => PressureChangeRate.FromKilopascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegapascalPerSecond - /// public static PressureChangeRate MegapascalsPerSecond(this T value) => PressureChangeRate.FromMegapascalsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PressureChangeRate? MegapascalsPerSecond(this T? value) where T : struct => PressureChangeRate.FromMegapascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PascalPerSecond - /// public static PressureChangeRate PascalsPerSecond(this T value) => PressureChangeRate.FromPascalsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PressureChangeRate? PascalsPerSecond(this T? value) where T : struct => PressureChangeRate.FromPascalsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs index 3a81e40518..fce5c27b14 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPressureExtensions.g.cs @@ -44,425 +44,121 @@ namespace UnitsNet.Extensions.NumberToPressure { public static class NumberToPressureExtensions { - #region Atmosphere - /// public static Pressure Atmospheres(this T value) => Pressure.FromAtmospheres(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Atmospheres(this T? value) where T : struct => Pressure.FromAtmospheres(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Bar - /// public static Pressure Bars(this T value) => Pressure.FromBars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Bars(this T? value) where T : struct => Pressure.FromBars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Centibar - /// public static Pressure Centibars(this T value) => Pressure.FromCentibars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Centibars(this T? value) where T : struct => Pressure.FromCentibars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decapascal - /// public static Pressure Decapascals(this T value) => Pressure.FromDecapascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Decapascals(this T? value) where T : struct => Pressure.FromDecapascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Decibar - /// public static Pressure Decibars(this T value) => Pressure.FromDecibars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Decibars(this T? value) where T : struct => Pressure.FromDecibars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootOfHead - /// public static Pressure FeetOfHead(this T value) => Pressure.FromFeetOfHead(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? FeetOfHead(this T? value) where T : struct => Pressure.FromFeetOfHead(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Gigapascal - /// public static Pressure Gigapascals(this T value) => Pressure.FromGigapascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Gigapascals(this T? value) where T : struct => Pressure.FromGigapascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hectopascal - /// public static Pressure Hectopascals(this T value) => Pressure.FromHectopascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Hectopascals(this T? value) where T : struct => Pressure.FromHectopascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchOfMercury - /// public static Pressure InchesOfMercury(this T value) => Pressure.FromInchesOfMercury(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? InchesOfMercury(this T? value) where T : struct => Pressure.FromInchesOfMercury(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilobar - /// public static Pressure Kilobars(this T value) => Pressure.FromKilobars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Kilobars(this T? value) where T : struct => Pressure.FromKilobars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerSquareCentimeter - /// public static Pressure KilogramsForcePerSquareCentimeter(this T value) => Pressure.FromKilogramsForcePerSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilogramsForcePerSquareCentimeter(this T? value) where T : struct => Pressure.FromKilogramsForcePerSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerSquareMeter - /// public static Pressure KilogramsForcePerSquareMeter(this T value) => Pressure.FromKilogramsForcePerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilogramsForcePerSquareMeter(this T? value) where T : struct => Pressure.FromKilogramsForcePerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerSquareMillimeter - /// public static Pressure KilogramsForcePerSquareMillimeter(this T value) => Pressure.FromKilogramsForcePerSquareMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilogramsForcePerSquareMillimeter(this T? value) where T : struct => Pressure.FromKilogramsForcePerSquareMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerSquareCentimeter - /// public static Pressure KilonewtonsPerSquareCentimeter(this T value) => Pressure.FromKilonewtonsPerSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilonewtonsPerSquareCentimeter(this T? value) where T : struct => Pressure.FromKilonewtonsPerSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerSquareMeter - /// public static Pressure KilonewtonsPerSquareMeter(this T value) => Pressure.FromKilonewtonsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilonewtonsPerSquareMeter(this T? value) where T : struct => Pressure.FromKilonewtonsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerSquareMillimeter - /// public static Pressure KilonewtonsPerSquareMillimeter(this T value) => Pressure.FromKilonewtonsPerSquareMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilonewtonsPerSquareMillimeter(this T? value) where T : struct => Pressure.FromKilonewtonsPerSquareMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kilopascal - /// public static Pressure Kilopascals(this T value) => Pressure.FromKilopascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Kilopascals(this T? value) where T : struct => Pressure.FromKilopascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForcePerSquareFoot - /// public static Pressure KilopoundsForcePerSquareFoot(this T value) => Pressure.FromKilopoundsForcePerSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilopoundsForcePerSquareFoot(this T? value) where T : struct => Pressure.FromKilopoundsForcePerSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForcePerSquareInch - /// public static Pressure KilopoundsForcePerSquareInch(this T value) => Pressure.FromKilopoundsForcePerSquareInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? KilopoundsForcePerSquareInch(this T? value) where T : struct => Pressure.FromKilopoundsForcePerSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megabar - /// public static Pressure Megabars(this T value) => Pressure.FromMegabars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Megabars(this T? value) where T : struct => Pressure.FromMegabars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonPerSquareMeter - /// public static Pressure MeganewtonsPerSquareMeter(this T value) => Pressure.FromMeganewtonsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? MeganewtonsPerSquareMeter(this T? value) where T : struct => Pressure.FromMeganewtonsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Megapascal - /// public static Pressure Megapascals(this T value) => Pressure.FromMegapascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Megapascals(this T? value) where T : struct => Pressure.FromMegapascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterOfHead - /// public static Pressure MetersOfHead(this T value) => Pressure.FromMetersOfHead(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? MetersOfHead(this T? value) where T : struct => Pressure.FromMetersOfHead(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Micropascal - /// public static Pressure Micropascals(this T value) => Pressure.FromMicropascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Micropascals(this T? value) where T : struct => Pressure.FromMicropascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Millibar - /// public static Pressure Millibars(this T value) => Pressure.FromMillibars(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Millibars(this T? value) where T : struct => Pressure.FromMillibars(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterOfMercury - /// public static Pressure MillimetersOfMercury(this T value) => Pressure.FromMillimetersOfMercury(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? MillimetersOfMercury(this T? value) where T : struct => Pressure.FromMillimetersOfMercury(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerSquareCentimeter - /// public static Pressure NewtonsPerSquareCentimeter(this T value) => Pressure.FromNewtonsPerSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? NewtonsPerSquareCentimeter(this T? value) where T : struct => Pressure.FromNewtonsPerSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerSquareMeter - /// public static Pressure NewtonsPerSquareMeter(this T value) => Pressure.FromNewtonsPerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? NewtonsPerSquareMeter(this T? value) where T : struct => Pressure.FromNewtonsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerSquareMillimeter - /// public static Pressure NewtonsPerSquareMillimeter(this T value) => Pressure.FromNewtonsPerSquareMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? NewtonsPerSquareMillimeter(this T? value) where T : struct => Pressure.FromNewtonsPerSquareMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Pascal - /// public static Pressure Pascals(this T value) => Pressure.FromPascals(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Pascals(this T? value) where T : struct => Pressure.FromPascals(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForcePerSquareFoot - /// public static Pressure PoundsForcePerSquareFoot(this T value) => Pressure.FromPoundsForcePerSquareFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? PoundsForcePerSquareFoot(this T? value) where T : struct => Pressure.FromPoundsForcePerSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForcePerSquareInch - /// public static Pressure PoundsForcePerSquareInch(this T value) => Pressure.FromPoundsForcePerSquareInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? PoundsForcePerSquareInch(this T? value) where T : struct => Pressure.FromPoundsForcePerSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Psi - /// [System.Obsolete("Deprecated due to github issue #215, please use PoundForcePerSquareInch instead")] public static Pressure Psi(this T value) => Pressure.FromPsi(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Psi(this T? value) where T : struct => Pressure.FromPsi(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TechnicalAtmosphere - /// public static Pressure TechnicalAtmospheres(this T value) => Pressure.FromTechnicalAtmospheres(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? TechnicalAtmospheres(this T? value) where T : struct => Pressure.FromTechnicalAtmospheres(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerSquareCentimeter - /// public static Pressure TonnesForcePerSquareCentimeter(this T value) => Pressure.FromTonnesForcePerSquareCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? TonnesForcePerSquareCentimeter(this T? value) where T : struct => Pressure.FromTonnesForcePerSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerSquareMeter - /// public static Pressure TonnesForcePerSquareMeter(this T value) => Pressure.FromTonnesForcePerSquareMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? TonnesForcePerSquareMeter(this T? value) where T : struct => Pressure.FromTonnesForcePerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerSquareMillimeter - /// public static Pressure TonnesForcePerSquareMillimeter(this T value) => Pressure.FromTonnesForcePerSquareMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? TonnesForcePerSquareMillimeter(this T? value) where T : struct => Pressure.FromTonnesForcePerSquareMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Torr - /// public static Pressure Torrs(this T value) => Pressure.FromTorrs(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? Torrs(this T? value) where T : struct => Pressure.FromTorrs(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRatioExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRatioExtensions.g.cs index 470f763f82..5d33244679 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRatioExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRatioExtensions.g.cs @@ -44,72 +44,24 @@ namespace UnitsNet.Extensions.NumberToRatio { public static class NumberToRatioExtensions { - #region DecimalFraction - /// public static Ratio DecimalFractions(this T value) => Ratio.FromDecimalFractions(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? DecimalFractions(this T? value) where T : struct => Ratio.FromDecimalFractions(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PartPerBillion - /// public static Ratio PartsPerBillion(this T value) => Ratio.FromPartsPerBillion(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? PartsPerBillion(this T? value) where T : struct => Ratio.FromPartsPerBillion(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PartPerMillion - /// public static Ratio PartsPerMillion(this T value) => Ratio.FromPartsPerMillion(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? PartsPerMillion(this T? value) where T : struct => Ratio.FromPartsPerMillion(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PartPerThousand - /// public static Ratio PartsPerThousand(this T value) => Ratio.FromPartsPerThousand(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? PartsPerThousand(this T? value) where T : struct => Ratio.FromPartsPerThousand(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PartPerTrillion - /// public static Ratio PartsPerTrillion(this T value) => Ratio.FromPartsPerTrillion(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? PartsPerTrillion(this T? value) where T : struct => Ratio.FromPartsPerTrillion(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Percent - /// public static Ratio Percent(this T value) => Ratio.FromPercent(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? Percent(this T? value) where T : struct => Ratio.FromPercent(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactiveEnergyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactiveEnergyExtensions.g.cs index 9a4594afc3..9154910452 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactiveEnergyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactiveEnergyExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToReactiveEnergy { public static class NumberToReactiveEnergyExtensions { - #region KilovoltampereReactiveHour - /// public static ReactiveEnergy KilovoltampereReactiveHours(this T value) => ReactiveEnergy.FromKilovoltampereReactiveHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactiveEnergy? KilovoltampereReactiveHours(this T? value) where T : struct => ReactiveEnergy.FromKilovoltampereReactiveHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegavoltampereReactiveHour - /// public static ReactiveEnergy MegavoltampereReactiveHours(this T value) => ReactiveEnergy.FromMegavoltampereReactiveHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactiveEnergy? MegavoltampereReactiveHours(this T? value) where T : struct => ReactiveEnergy.FromMegavoltampereReactiveHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region VoltampereReactiveHour - /// public static ReactiveEnergy VoltampereReactiveHours(this T value) => ReactiveEnergy.FromVoltampereReactiveHours(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactiveEnergy? VoltampereReactiveHours(this T? value) where T : struct => ReactiveEnergy.FromVoltampereReactiveHours(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactivePowerExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactivePowerExtensions.g.cs index 89d6b7f589..efb9839777 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactivePowerExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToReactivePowerExtensions.g.cs @@ -44,50 +44,18 @@ namespace UnitsNet.Extensions.NumberToReactivePower { public static class NumberToReactivePowerExtensions { - #region GigavoltampereReactive - /// public static ReactivePower GigavoltamperesReactive(this T value) => ReactivePower.FromGigavoltamperesReactive(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactivePower? GigavoltamperesReactive(this T? value) where T : struct => ReactivePower.FromGigavoltamperesReactive(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilovoltampereReactive - /// public static ReactivePower KilovoltamperesReactive(this T value) => ReactivePower.FromKilovoltamperesReactive(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactivePower? KilovoltamperesReactive(this T? value) where T : struct => ReactivePower.FromKilovoltamperesReactive(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegavoltampereReactive - /// public static ReactivePower MegavoltamperesReactive(this T value) => ReactivePower.FromMegavoltamperesReactive(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactivePower? MegavoltamperesReactive(this T? value) where T : struct => ReactivePower.FromMegavoltamperesReactive(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region VoltampereReactive - /// public static ReactivePower VoltamperesReactive(this T value) => ReactivePower.FromVoltamperesReactive(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactivePower? VoltamperesReactive(this T? value) where T : struct => ReactivePower.FromVoltamperesReactive(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalAccelerationExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalAccelerationExtensions.g.cs index 68b257bddd..d8643581a7 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalAccelerationExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalAccelerationExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToRotationalAcceleration { public static class NumberToRotationalAccelerationExtensions { - #region DegreePerSecondSquared - /// public static RotationalAcceleration DegreesPerSecondSquared(this T value) => RotationalAcceleration.FromDegreesPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalAcceleration? DegreesPerSecondSquared(this T? value) where T : struct => RotationalAcceleration.FromDegreesPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region RadianPerSecondSquared - /// public static RotationalAcceleration RadiansPerSecondSquared(this T value) => RotationalAcceleration.FromRadiansPerSecondSquared(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalAcceleration? RadiansPerSecondSquared(this T? value) where T : struct => RotationalAcceleration.FromRadiansPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region RevolutionPerMinutePerSecond - /// public static RotationalAcceleration RevolutionsPerMinutePerSecond(this T value) => RotationalAcceleration.FromRevolutionsPerMinutePerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalAcceleration? RevolutionsPerMinutePerSecond(this T? value) where T : struct => RotationalAcceleration.FromRevolutionsPerMinutePerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalSpeedExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalSpeedExtensions.g.cs index f0512ae33d..005f9ab145 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalSpeedExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalSpeedExtensions.g.cs @@ -44,149 +44,45 @@ namespace UnitsNet.Extensions.NumberToRotationalSpeed { public static class NumberToRotationalSpeedExtensions { - #region CentiradianPerSecond - /// public static RotationalSpeed CentiradiansPerSecond(this T value) => RotationalSpeed.FromCentiradiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? CentiradiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromCentiradiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DeciradianPerSecond - /// public static RotationalSpeed DeciradiansPerSecond(this T value) => RotationalSpeed.FromDeciradiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? DeciradiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromDeciradiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreePerMinute - /// public static RotationalSpeed DegreesPerMinute(this T value) => RotationalSpeed.FromDegreesPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? DegreesPerMinute(this T? value) where T : struct => RotationalSpeed.FromDegreesPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreePerSecond - /// public static RotationalSpeed DegreesPerSecond(this T value) => RotationalSpeed.FromDegreesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? DegreesPerSecond(this T? value) where T : struct => RotationalSpeed.FromDegreesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrodegreePerSecond - /// public static RotationalSpeed MicrodegreesPerSecond(this T value) => RotationalSpeed.FromMicrodegreesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? MicrodegreesPerSecond(this T? value) where T : struct => RotationalSpeed.FromMicrodegreesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicroradianPerSecond - /// public static RotationalSpeed MicroradiansPerSecond(this T value) => RotationalSpeed.FromMicroradiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? MicroradiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromMicroradiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillidegreePerSecond - /// public static RotationalSpeed MillidegreesPerSecond(this T value) => RotationalSpeed.FromMillidegreesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? MillidegreesPerSecond(this T? value) where T : struct => RotationalSpeed.FromMillidegreesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilliradianPerSecond - /// public static RotationalSpeed MilliradiansPerSecond(this T value) => RotationalSpeed.FromMilliradiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? MilliradiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromMilliradiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanodegreePerSecond - /// public static RotationalSpeed NanodegreesPerSecond(this T value) => RotationalSpeed.FromNanodegreesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? NanodegreesPerSecond(this T? value) where T : struct => RotationalSpeed.FromNanodegreesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanoradianPerSecond - /// public static RotationalSpeed NanoradiansPerSecond(this T value) => RotationalSpeed.FromNanoradiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? NanoradiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromNanoradiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region RadianPerSecond - /// public static RotationalSpeed RadiansPerSecond(this T value) => RotationalSpeed.FromRadiansPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? RadiansPerSecond(this T? value) where T : struct => RotationalSpeed.FromRadiansPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region RevolutionPerMinute - /// public static RotationalSpeed RevolutionsPerMinute(this T value) => RotationalSpeed.FromRevolutionsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? RevolutionsPerMinute(this T? value) where T : struct => RotationalSpeed.FromRevolutionsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region RevolutionPerSecond - /// public static RotationalSpeed RevolutionsPerSecond(this T value) => RotationalSpeed.FromRevolutionsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? RevolutionsPerSecond(this T? value) where T : struct => RotationalSpeed.FromRevolutionsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessExtensions.g.cs index 25d863aac9..36e2e3d4ab 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToRotationalStiffness { public static class NumberToRotationalStiffnessExtensions { - #region KilonewtonMeterPerRadian - /// public static RotationalStiffness KilonewtonMetersPerRadian(this T value) => RotationalStiffness.FromKilonewtonMetersPerRadian(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffness? KilonewtonMetersPerRadian(this T? value) where T : struct => RotationalStiffness.FromKilonewtonMetersPerRadian(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonMeterPerRadian - /// public static RotationalStiffness MeganewtonMetersPerRadian(this T value) => RotationalStiffness.FromMeganewtonMetersPerRadian(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffness? MeganewtonMetersPerRadian(this T? value) where T : struct => RotationalStiffness.FromMeganewtonMetersPerRadian(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonMeterPerRadian - /// public static RotationalStiffness NewtonMetersPerRadian(this T value) => RotationalStiffness.FromNewtonMetersPerRadian(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffness? NewtonMetersPerRadian(this T? value) where T : struct => RotationalStiffness.FromNewtonMetersPerRadian(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessPerLengthExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessPerLengthExtensions.g.cs index d8891117ff..972c49dac1 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessPerLengthExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToRotationalStiffnessPerLengthExtensions.g.cs @@ -44,39 +44,15 @@ namespace UnitsNet.Extensions.NumberToRotationalStiffnessPerLength { public static class NumberToRotationalStiffnessPerLengthExtensions { - #region KilonewtonMeterPerRadianPerMeter - /// public static RotationalStiffnessPerLength KilonewtonMetersPerRadianPerMeter(this T value) => RotationalStiffnessPerLength.FromKilonewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffnessPerLength? KilonewtonMetersPerRadianPerMeter(this T? value) where T : struct => RotationalStiffnessPerLength.FromKilonewtonMetersPerRadianPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonMeterPerRadianPerMeter - /// public static RotationalStiffnessPerLength MeganewtonMetersPerRadianPerMeter(this T value) => RotationalStiffnessPerLength.FromMeganewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffnessPerLength? MeganewtonMetersPerRadianPerMeter(this T? value) where T : struct => RotationalStiffnessPerLength.FromMeganewtonMetersPerRadianPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonMeterPerRadianPerMeter - /// public static RotationalStiffnessPerLength NewtonMetersPerRadianPerMeter(this T value) => RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffnessPerLength? NewtonMetersPerRadianPerMeter(this T? value) where T : struct => RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSolidAngleExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSolidAngleExtensions.g.cs index b960b70ba1..ee15ab2fcf 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSolidAngleExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSolidAngleExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToSolidAngle { public static class NumberToSolidAngleExtensions { - #region Steradian - /// public static SolidAngle Steradians(this T value) => SolidAngle.FromSteradians(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SolidAngle? Steradians(this T? value) where T : struct => SolidAngle.FromSteradians(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEnergyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEnergyExtensions.g.cs index 873ffd7db8..eedb73e55d 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEnergyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEnergyExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToSpecificEnergy { public static class NumberToSpecificEnergyExtensions { - #region CaloriePerGram - /// public static SpecificEnergy CaloriesPerGram(this T value) => SpecificEnergy.FromCaloriesPerGram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? CaloriesPerGram(this T? value) where T : struct => SpecificEnergy.FromCaloriesPerGram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region JoulePerKilogram - /// public static SpecificEnergy JoulesPerKilogram(this T value) => SpecificEnergy.FromJoulesPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? JoulesPerKilogram(this T? value) where T : struct => SpecificEnergy.FromJoulesPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocaloriePerGram - /// public static SpecificEnergy KilocaloriesPerGram(this T value) => SpecificEnergy.FromKilocaloriesPerGram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? KilocaloriesPerGram(this T? value) where T : struct => SpecificEnergy.FromKilocaloriesPerGram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerKilogram - /// public static SpecificEnergy KilojoulesPerKilogram(this T value) => SpecificEnergy.FromKilojoulesPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? KilojoulesPerKilogram(this T? value) where T : struct => SpecificEnergy.FromKilojoulesPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilowattHourPerKilogram - /// public static SpecificEnergy KilowattHoursPerKilogram(this T value) => SpecificEnergy.FromKilowattHoursPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? KilowattHoursPerKilogram(this T? value) where T : struct => SpecificEnergy.FromKilowattHoursPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerKilogram - /// public static SpecificEnergy MegajoulesPerKilogram(this T value) => SpecificEnergy.FromMegajoulesPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? MegajoulesPerKilogram(this T? value) where T : struct => SpecificEnergy.FromMegajoulesPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegawattHourPerKilogram - /// public static SpecificEnergy MegawattHoursPerKilogram(this T value) => SpecificEnergy.FromMegawattHoursPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? MegawattHoursPerKilogram(this T? value) where T : struct => SpecificEnergy.FromMegawattHoursPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattHourPerKilogram - /// public static SpecificEnergy WattHoursPerKilogram(this T value) => SpecificEnergy.FromWattHoursPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? WattHoursPerKilogram(this T? value) where T : struct => SpecificEnergy.FromWattHoursPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEntropyExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEntropyExtensions.g.cs index e9915976d1..349c77f35b 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEntropyExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificEntropyExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToSpecificEntropy { public static class NumberToSpecificEntropyExtensions { - #region CaloriePerGramKelvin - /// public static SpecificEntropy CaloriesPerGramKelvin(this T value) => SpecificEntropy.FromCaloriesPerGramKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? CaloriesPerGramKelvin(this T? value) where T : struct => SpecificEntropy.FromCaloriesPerGramKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region JoulePerKilogramDegreeCelsius - /// public static SpecificEntropy JoulesPerKilogramDegreeCelsius(this T value) => SpecificEntropy.FromJoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? JoulesPerKilogramDegreeCelsius(this T? value) where T : struct => SpecificEntropy.FromJoulesPerKilogramDegreeCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region JoulePerKilogramKelvin - /// public static SpecificEntropy JoulesPerKilogramKelvin(this T value) => SpecificEntropy.FromJoulesPerKilogramKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? JoulesPerKilogramKelvin(this T? value) where T : struct => SpecificEntropy.FromJoulesPerKilogramKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocaloriePerGramKelvin - /// public static SpecificEntropy KilocaloriesPerGramKelvin(this T value) => SpecificEntropy.FromKilocaloriesPerGramKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? KilocaloriesPerGramKelvin(this T? value) where T : struct => SpecificEntropy.FromKilocaloriesPerGramKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerKilogramDegreeCelsius - /// public static SpecificEntropy KilojoulesPerKilogramDegreeCelsius(this T value) => SpecificEntropy.FromKilojoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? KilojoulesPerKilogramDegreeCelsius(this T? value) where T : struct => SpecificEntropy.FromKilojoulesPerKilogramDegreeCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilojoulePerKilogramKelvin - /// public static SpecificEntropy KilojoulesPerKilogramKelvin(this T value) => SpecificEntropy.FromKilojoulesPerKilogramKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? KilojoulesPerKilogramKelvin(this T? value) where T : struct => SpecificEntropy.FromKilojoulesPerKilogramKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerKilogramDegreeCelsius - /// public static SpecificEntropy MegajoulesPerKilogramDegreeCelsius(this T value) => SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? MegajoulesPerKilogramDegreeCelsius(this T? value) where T : struct => SpecificEntropy.FromMegajoulesPerKilogramDegreeCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegajoulePerKilogramKelvin - /// public static SpecificEntropy MegajoulesPerKilogramKelvin(this T value) => SpecificEntropy.FromMegajoulesPerKilogramKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? MegajoulesPerKilogramKelvin(this T? value) where T : struct => SpecificEntropy.FromMegajoulesPerKilogramKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificVolumeExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificVolumeExtensions.g.cs index 3ac4fad9d2..38ad063b86 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificVolumeExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificVolumeExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToSpecificVolume { public static class NumberToSpecificVolumeExtensions { - #region CubicFootPerPound - /// public static SpecificVolume CubicFeetPerPound(this T value) => SpecificVolume.FromCubicFeetPerPound(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificVolume? CubicFeetPerPound(this T? value) where T : struct => SpecificVolume.FromCubicFeetPerPound(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerKilogram - /// public static SpecificVolume CubicMetersPerKilogram(this T value) => SpecificVolume.FromCubicMetersPerKilogram(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificVolume? CubicMetersPerKilogram(this T? value) where T : struct => SpecificVolume.FromCubicMetersPerKilogram(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificWeightExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificWeightExtensions.g.cs index 96baddecbc..53e1155bd6 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificWeightExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpecificWeightExtensions.g.cs @@ -44,193 +44,57 @@ namespace UnitsNet.Extensions.NumberToSpecificWeight { public static class NumberToSpecificWeightExtensions { - #region KilogramForcePerCubicCentimeter - /// public static SpecificWeight KilogramsForcePerCubicCentimeter(this T value) => SpecificWeight.FromKilogramsForcePerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilogramsForcePerCubicCentimeter(this T? value) where T : struct => SpecificWeight.FromKilogramsForcePerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerCubicMeter - /// public static SpecificWeight KilogramsForcePerCubicMeter(this T value) => SpecificWeight.FromKilogramsForcePerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilogramsForcePerCubicMeter(this T? value) where T : struct => SpecificWeight.FromKilogramsForcePerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForcePerCubicMillimeter - /// public static SpecificWeight KilogramsForcePerCubicMillimeter(this T value) => SpecificWeight.FromKilogramsForcePerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilogramsForcePerCubicMillimeter(this T? value) where T : struct => SpecificWeight.FromKilogramsForcePerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerCubicCentimeter - /// public static SpecificWeight KilonewtonsPerCubicCentimeter(this T value) => SpecificWeight.FromKilonewtonsPerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilonewtonsPerCubicCentimeter(this T? value) where T : struct => SpecificWeight.FromKilonewtonsPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerCubicMeter - /// public static SpecificWeight KilonewtonsPerCubicMeter(this T value) => SpecificWeight.FromKilonewtonsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilonewtonsPerCubicMeter(this T? value) where T : struct => SpecificWeight.FromKilonewtonsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonPerCubicMillimeter - /// public static SpecificWeight KilonewtonsPerCubicMillimeter(this T value) => SpecificWeight.FromKilonewtonsPerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilonewtonsPerCubicMillimeter(this T? value) where T : struct => SpecificWeight.FromKilonewtonsPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForcePerCubicFoot - /// public static SpecificWeight KilopoundsForcePerCubicFoot(this T value) => SpecificWeight.FromKilopoundsForcePerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilopoundsForcePerCubicFoot(this T? value) where T : struct => SpecificWeight.FromKilopoundsForcePerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForcePerCubicInch - /// public static SpecificWeight KilopoundsForcePerCubicInch(this T value) => SpecificWeight.FromKilopoundsForcePerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? KilopoundsForcePerCubicInch(this T? value) where T : struct => SpecificWeight.FromKilopoundsForcePerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonPerCubicMeter - /// public static SpecificWeight MeganewtonsPerCubicMeter(this T value) => SpecificWeight.FromMeganewtonsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? MeganewtonsPerCubicMeter(this T? value) where T : struct => SpecificWeight.FromMeganewtonsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerCubicCentimeter - /// public static SpecificWeight NewtonsPerCubicCentimeter(this T value) => SpecificWeight.FromNewtonsPerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? NewtonsPerCubicCentimeter(this T? value) where T : struct => SpecificWeight.FromNewtonsPerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerCubicMeter - /// public static SpecificWeight NewtonsPerCubicMeter(this T value) => SpecificWeight.FromNewtonsPerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? NewtonsPerCubicMeter(this T? value) where T : struct => SpecificWeight.FromNewtonsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonPerCubicMillimeter - /// public static SpecificWeight NewtonsPerCubicMillimeter(this T value) => SpecificWeight.FromNewtonsPerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? NewtonsPerCubicMillimeter(this T? value) where T : struct => SpecificWeight.FromNewtonsPerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForcePerCubicFoot - /// public static SpecificWeight PoundsForcePerCubicFoot(this T value) => SpecificWeight.FromPoundsForcePerCubicFoot(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? PoundsForcePerCubicFoot(this T? value) where T : struct => SpecificWeight.FromPoundsForcePerCubicFoot(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForcePerCubicInch - /// public static SpecificWeight PoundsForcePerCubicInch(this T value) => SpecificWeight.FromPoundsForcePerCubicInch(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? PoundsForcePerCubicInch(this T? value) where T : struct => SpecificWeight.FromPoundsForcePerCubicInch(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerCubicCentimeter - /// public static SpecificWeight TonnesForcePerCubicCentimeter(this T value) => SpecificWeight.FromTonnesForcePerCubicCentimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? TonnesForcePerCubicCentimeter(this T? value) where T : struct => SpecificWeight.FromTonnesForcePerCubicCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerCubicMeter - /// public static SpecificWeight TonnesForcePerCubicMeter(this T value) => SpecificWeight.FromTonnesForcePerCubicMeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? TonnesForcePerCubicMeter(this T? value) where T : struct => SpecificWeight.FromTonnesForcePerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForcePerCubicMillimeter - /// public static SpecificWeight TonnesForcePerCubicMillimeter(this T value) => SpecificWeight.FromTonnesForcePerCubicMillimeter(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? TonnesForcePerCubicMillimeter(this T? value) where T : struct => SpecificWeight.FromTonnesForcePerCubicMillimeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpeedExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpeedExtensions.g.cs index ee9db77b1f..d921f92ff2 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpeedExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToSpeedExtensions.g.cs @@ -44,358 +44,102 @@ namespace UnitsNet.Extensions.NumberToSpeed { public static class NumberToSpeedExtensions { - #region CentimeterPerHour - /// public static Speed CentimetersPerHour(this T value) => Speed.FromCentimetersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? CentimetersPerHour(this T? value) where T : struct => Speed.FromCentimetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentimeterPerMinute - /// public static Speed CentimetersPerMinutes(this T value) => Speed.FromCentimetersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? CentimetersPerMinutes(this T? value) where T : struct => Speed.FromCentimetersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CentimeterPerSecond - /// public static Speed CentimetersPerSecond(this T value) => Speed.FromCentimetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? CentimetersPerSecond(this T? value) where T : struct => Speed.FromCentimetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecimeterPerMinute - /// public static Speed DecimetersPerMinutes(this T value) => Speed.FromDecimetersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? DecimetersPerMinutes(this T? value) where T : struct => Speed.FromDecimetersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecimeterPerSecond - /// public static Speed DecimetersPerSecond(this T value) => Speed.FromDecimetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? DecimetersPerSecond(this T? value) where T : struct => Speed.FromDecimetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootPerHour - /// public static Speed FeetPerHour(this T value) => Speed.FromFeetPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? FeetPerHour(this T? value) where T : struct => Speed.FromFeetPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootPerMinute - /// public static Speed FeetPerMinute(this T value) => Speed.FromFeetPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? FeetPerMinute(this T? value) where T : struct => Speed.FromFeetPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region FootPerSecond - /// public static Speed FeetPerSecond(this T value) => Speed.FromFeetPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? FeetPerSecond(this T? value) where T : struct => Speed.FromFeetPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchPerHour - /// public static Speed InchesPerHour(this T value) => Speed.FromInchesPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? InchesPerHour(this T? value) where T : struct => Speed.FromInchesPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchPerMinute - /// public static Speed InchesPerMinute(this T value) => Speed.FromInchesPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? InchesPerMinute(this T? value) where T : struct => Speed.FromInchesPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region InchPerSecond - /// public static Speed InchesPerSecond(this T value) => Speed.FromInchesPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? InchesPerSecond(this T? value) where T : struct => Speed.FromInchesPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilometerPerHour - /// public static Speed KilometersPerHour(this T value) => Speed.FromKilometersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? KilometersPerHour(this T? value) where T : struct => Speed.FromKilometersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilometerPerMinute - /// public static Speed KilometersPerMinutes(this T value) => Speed.FromKilometersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? KilometersPerMinutes(this T? value) where T : struct => Speed.FromKilometersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilometerPerSecond - /// public static Speed KilometersPerSecond(this T value) => Speed.FromKilometersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? KilometersPerSecond(this T? value) where T : struct => Speed.FromKilometersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Knot - /// public static Speed Knots(this T value) => Speed.FromKnots(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? Knots(this T? value) where T : struct => Speed.FromKnots(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterPerHour - /// public static Speed MetersPerHour(this T value) => Speed.FromMetersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MetersPerHour(this T? value) where T : struct => Speed.FromMetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterPerMinute - /// public static Speed MetersPerMinutes(this T value) => Speed.FromMetersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MetersPerMinutes(this T? value) where T : struct => Speed.FromMetersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeterPerSecond - /// public static Speed MetersPerSecond(this T value) => Speed.FromMetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MetersPerSecond(this T? value) where T : struct => Speed.FromMetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrometerPerMinute - /// public static Speed MicrometersPerMinutes(this T value) => Speed.FromMicrometersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MicrometersPerMinutes(this T? value) where T : struct => Speed.FromMicrometersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrometerPerSecond - /// public static Speed MicrometersPerSecond(this T value) => Speed.FromMicrometersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MicrometersPerSecond(this T? value) where T : struct => Speed.FromMicrometersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MilePerHour - /// public static Speed MilesPerHour(this T value) => Speed.FromMilesPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MilesPerHour(this T? value) where T : struct => Speed.FromMilesPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterPerHour - /// public static Speed MillimetersPerHour(this T value) => Speed.FromMillimetersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MillimetersPerHour(this T? value) where T : struct => Speed.FromMillimetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterPerMinute - /// public static Speed MillimetersPerMinutes(this T value) => Speed.FromMillimetersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MillimetersPerMinutes(this T? value) where T : struct => Speed.FromMillimetersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillimeterPerSecond - /// public static Speed MillimetersPerSecond(this T value) => Speed.FromMillimetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? MillimetersPerSecond(this T? value) where T : struct => Speed.FromMillimetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanometerPerMinute - /// public static Speed NanometersPerMinutes(this T value) => Speed.FromNanometersPerMinutes(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? NanometersPerMinutes(this T? value) where T : struct => Speed.FromNanometersPerMinutes(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanometerPerSecond - /// public static Speed NanometersPerSecond(this T value) => Speed.FromNanometersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? NanometersPerSecond(this T? value) where T : struct => Speed.FromNanometersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsSurveyFootPerHour - /// public static Speed UsSurveyFeetPerHour(this T value) => Speed.FromUsSurveyFeetPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? UsSurveyFeetPerHour(this T? value) where T : struct => Speed.FromUsSurveyFeetPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsSurveyFootPerMinute - /// public static Speed UsSurveyFeetPerMinute(this T value) => Speed.FromUsSurveyFeetPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? UsSurveyFeetPerMinute(this T? value) where T : struct => Speed.FromUsSurveyFeetPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsSurveyFootPerSecond - /// public static Speed UsSurveyFeetPerSecond(this T value) => Speed.FromUsSurveyFeetPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? UsSurveyFeetPerSecond(this T? value) where T : struct => Speed.FromUsSurveyFeetPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region YardPerHour - /// public static Speed YardsPerHour(this T value) => Speed.FromYardsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? YardsPerHour(this T? value) where T : struct => Speed.FromYardsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region YardPerMinute - /// public static Speed YardsPerMinute(this T value) => Speed.FromYardsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? YardsPerMinute(this T? value) where T : struct => Speed.FromYardsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region YardPerSecond - /// public static Speed YardsPerSecond(this T value) => Speed.FromYardsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? YardsPerSecond(this T? value) where T : struct => Speed.FromYardsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureChangeRateExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureChangeRateExtensions.g.cs index 3e6946be23..6754a82323 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureChangeRateExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureChangeRateExtensions.g.cs @@ -44,116 +44,36 @@ namespace UnitsNet.Extensions.NumberToTemperatureChangeRate { public static class NumberToTemperatureChangeRateExtensions { - #region CentidegreeCelsiusPerSecond - /// public static TemperatureChangeRate CentidegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromCentidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? CentidegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromCentidegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecadegreeCelsiusPerSecond - /// public static TemperatureChangeRate DecadegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromDecadegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? DecadegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromDecadegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecidegreeCelsiusPerSecond - /// public static TemperatureChangeRate DecidegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromDecidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? DecidegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromDecidegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeCelsiusPerMinute - /// public static TemperatureChangeRate DegreesCelsiusPerMinute(this T value) => TemperatureChangeRate.FromDegreesCelsiusPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? DegreesCelsiusPerMinute(this T? value) where T : struct => TemperatureChangeRate.FromDegreesCelsiusPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeCelsiusPerSecond - /// public static TemperatureChangeRate DegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromDegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? DegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromDegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HectodegreeCelsiusPerSecond - /// public static TemperatureChangeRate HectodegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromHectodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? HectodegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromHectodegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilodegreeCelsiusPerSecond - /// public static TemperatureChangeRate KilodegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromKilodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? KilodegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromKilodegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrodegreeCelsiusPerSecond - /// public static TemperatureChangeRate MicrodegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromMicrodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? MicrodegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromMicrodegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillidegreeCelsiusPerSecond - /// public static TemperatureChangeRate MillidegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromMillidegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? MillidegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromMillidegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanodegreeCelsiusPerSecond - /// public static TemperatureChangeRate NanodegreesCelsiusPerSecond(this T value) => TemperatureChangeRate.FromNanodegreesCelsiusPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? NanodegreesCelsiusPerSecond(this T? value) where T : struct => TemperatureChangeRate.FromNanodegreesCelsiusPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs index 1b2559ee15..db4d0a0ca5 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureDeltaExtensions.g.cs @@ -44,190 +44,62 @@ namespace UnitsNet.Extensions.NumberToTemperatureDelta { public static class NumberToTemperatureDeltaExtensions { - #region DegreeCelsius - /// public static TemperatureDelta DegreesCelsius(this T value) => TemperatureDelta.FromDegreesCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesCelsius(this T? value) where T : struct => TemperatureDelta.FromDegreesCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeCelsiusDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeCelsius instead")] public static TemperatureDelta DegreesCelsiusDelta(this T value) => TemperatureDelta.FromDegreesCelsiusDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesCelsiusDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesCelsiusDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeDelisle - /// public static TemperatureDelta DegreesDelisle(this T value) => TemperatureDelta.FromDegreesDelisle(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesDelisle(this T? value) where T : struct => TemperatureDelta.FromDegreesDelisle(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeDelisleDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeDelisle instead")] public static TemperatureDelta DegreesDelisleDelta(this T value) => TemperatureDelta.FromDegreesDelisleDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesDelisleDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesDelisleDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeFahrenheit - /// public static TemperatureDelta DegreesFahrenheit(this T value) => TemperatureDelta.FromDegreesFahrenheit(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesFahrenheit(this T? value) where T : struct => TemperatureDelta.FromDegreesFahrenheit(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeFahrenheitDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeFahrenheit instead")] public static TemperatureDelta DegreesFahrenheitDelta(this T value) => TemperatureDelta.FromDegreesFahrenheitDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesFahrenheitDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesFahrenheitDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeNewton - /// public static TemperatureDelta DegreesNewton(this T value) => TemperatureDelta.FromDegreesNewton(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesNewton(this T? value) where T : struct => TemperatureDelta.FromDegreesNewton(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeNewtonDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeNewton instead")] public static TemperatureDelta DegreesNewtonDelta(this T value) => TemperatureDelta.FromDegreesNewtonDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesNewtonDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesNewtonDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRankine - /// public static TemperatureDelta DegreesRankine(this T value) => TemperatureDelta.FromDegreesRankine(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRankine(this T? value) where T : struct => TemperatureDelta.FromDegreesRankine(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRankineDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeRankine instead")] public static TemperatureDelta DegreesRankineDelta(this T value) => TemperatureDelta.FromDegreesRankineDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRankineDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesRankineDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeReaumur - /// public static TemperatureDelta DegreesReaumur(this T value) => TemperatureDelta.FromDegreesReaumur(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesReaumur(this T? value) where T : struct => TemperatureDelta.FromDegreesReaumur(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeReaumurDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeReaumur instead")] public static TemperatureDelta DegreesReaumurDelta(this T value) => TemperatureDelta.FromDegreesReaumurDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesReaumurDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesReaumurDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRoemer - /// public static TemperatureDelta DegreesRoemer(this T value) => TemperatureDelta.FromDegreesRoemer(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRoemer(this T? value) where T : struct => TemperatureDelta.FromDegreesRoemer(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRoemerDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use DegreeRoemer instead")] public static TemperatureDelta DegreesRoemerDelta(this T value) => TemperatureDelta.FromDegreesRoemerDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? DegreesRoemerDelta(this T? value) where T : struct => TemperatureDelta.FromDegreesRoemerDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kelvin - /// public static TemperatureDelta Kelvins(this T value) => TemperatureDelta.FromKelvins(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? Kelvins(this T? value) where T : struct => TemperatureDelta.FromKelvins(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KelvinDelta - /// [System.Obsolete("Deprecated due to github issue #180, please use Kelvin instead")] public static TemperatureDelta KelvinsDelta(this T value) => TemperatureDelta.FromKelvinsDelta(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? KelvinsDelta(this T? value) where T : struct => TemperatureDelta.FromKelvinsDelta(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureExtensions.g.cs index 74b3d22047..b04a374531 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTemperatureExtensions.g.cs @@ -44,94 +44,30 @@ namespace UnitsNet.Extensions.NumberToTemperature { public static class NumberToTemperatureExtensions { - #region DegreeCelsius - /// public static Temperature DegreesCelsius(this T value) => Temperature.FromDegreesCelsius(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesCelsius(this T? value) where T : struct => Temperature.FromDegreesCelsius(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeDelisle - /// public static Temperature DegreesDelisle(this T value) => Temperature.FromDegreesDelisle(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesDelisle(this T? value) where T : struct => Temperature.FromDegreesDelisle(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeFahrenheit - /// public static Temperature DegreesFahrenheit(this T value) => Temperature.FromDegreesFahrenheit(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesFahrenheit(this T? value) where T : struct => Temperature.FromDegreesFahrenheit(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeNewton - /// public static Temperature DegreesNewton(this T value) => Temperature.FromDegreesNewton(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesNewton(this T? value) where T : struct => Temperature.FromDegreesNewton(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRankine - /// public static Temperature DegreesRankine(this T value) => Temperature.FromDegreesRankine(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesRankine(this T? value) where T : struct => Temperature.FromDegreesRankine(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeReaumur - /// public static Temperature DegreesReaumur(this T value) => Temperature.FromDegreesReaumur(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesReaumur(this T? value) where T : struct => Temperature.FromDegreesReaumur(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DegreeRoemer - /// public static Temperature DegreesRoemer(this T value) => Temperature.FromDegreesRoemer(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? DegreesRoemer(this T? value) where T : struct => Temperature.FromDegreesRoemer(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Kelvin - /// public static Temperature Kelvins(this T value) => Temperature.FromKelvins(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? Kelvins(this T? value) where T : struct => Temperature.FromKelvins(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalConductivityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalConductivityExtensions.g.cs index dc9c3d7539..74d3658cb4 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalConductivityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalConductivityExtensions.g.cs @@ -44,28 +44,12 @@ namespace UnitsNet.Extensions.NumberToThermalConductivity { public static class NumberToThermalConductivityExtensions { - #region BtuPerHourFootFahrenheit - /// public static ThermalConductivity BtusPerHourFootFahrenheit(this T value) => ThermalConductivity.FromBtusPerHourFootFahrenheit(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalConductivity? BtusPerHourFootFahrenheit(this T? value) where T : struct => ThermalConductivity.FromBtusPerHourFootFahrenheit(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region WattPerMeterKelvin - /// public static ThermalConductivity WattsPerMeterKelvin(this T value) => ThermalConductivity.FromWattsPerMeterKelvin(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalConductivity? WattsPerMeterKelvin(this T? value) where T : struct => ThermalConductivity.FromWattsPerMeterKelvin(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalResistanceExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalResistanceExtensions.g.cs index cd13575d0a..814e163654 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalResistanceExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToThermalResistanceExtensions.g.cs @@ -44,61 +44,21 @@ namespace UnitsNet.Extensions.NumberToThermalResistance { public static class NumberToThermalResistanceExtensions { - #region HourSquareFeetDegreeFahrenheitPerBtu - /// public static ThermalResistance HourSquareFeetDegreesFahrenheitPerBtu(this T value) => ThermalResistance.FromHourSquareFeetDegreesFahrenheitPerBtu(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? HourSquareFeetDegreesFahrenheitPerBtu(this T? value) where T : struct => ThermalResistance.FromHourSquareFeetDegreesFahrenheitPerBtu(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareCentimeterHourDegreeCelsiusPerKilocalorie - /// public static ThermalResistance SquareCentimeterHourDegreesCelsiusPerKilocalorie(this T value) => ThermalResistance.FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? SquareCentimeterHourDegreesCelsiusPerKilocalorie(this T? value) where T : struct => ThermalResistance.FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareCentimeterKelvinPerWatt - /// public static ThermalResistance SquareCentimeterKelvinsPerWatt(this T value) => ThermalResistance.FromSquareCentimeterKelvinsPerWatt(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? SquareCentimeterKelvinsPerWatt(this T? value) where T : struct => ThermalResistance.FromSquareCentimeterKelvinsPerWatt(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMeterDegreeCelsiusPerWatt - /// public static ThermalResistance SquareMeterDegreesCelsiusPerWatt(this T value) => ThermalResistance.FromSquareMeterDegreesCelsiusPerWatt(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? SquareMeterDegreesCelsiusPerWatt(this T? value) where T : struct => ThermalResistance.FromSquareMeterDegreesCelsiusPerWatt(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region SquareMeterKelvinPerKilowatt - /// public static ThermalResistance SquareMeterKelvinsPerKilowatt(this T value) => ThermalResistance.FromSquareMeterKelvinsPerKilowatt(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? SquareMeterKelvinsPerKilowatt(this T? value) where T : struct => ThermalResistance.FromSquareMeterKelvinsPerKilowatt(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTorqueExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTorqueExtensions.g.cs index 3e373c103a..9a1b0c92d8 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToTorqueExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToTorqueExtensions.g.cs @@ -44,237 +44,69 @@ namespace UnitsNet.Extensions.NumberToTorque { public static class NumberToTorqueExtensions { - #region KilogramForceCentimeter - /// public static Torque KilogramForceCentimeters(this T value) => Torque.FromKilogramForceCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilogramForceCentimeters(this T? value) where T : struct => Torque.FromKilogramForceCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForceMeter - /// public static Torque KilogramForceMeters(this T value) => Torque.FromKilogramForceMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilogramForceMeters(this T? value) where T : struct => Torque.FromKilogramForceMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilogramForceMillimeter - /// public static Torque KilogramForceMillimeters(this T value) => Torque.FromKilogramForceMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilogramForceMillimeters(this T? value) where T : struct => Torque.FromKilogramForceMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonCentimeter - /// public static Torque KilonewtonCentimeters(this T value) => Torque.FromKilonewtonCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilonewtonCentimeters(this T? value) where T : struct => Torque.FromKilonewtonCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonMeter - /// public static Torque KilonewtonMeters(this T value) => Torque.FromKilonewtonMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilonewtonMeters(this T? value) where T : struct => Torque.FromKilonewtonMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilonewtonMillimeter - /// public static Torque KilonewtonMillimeters(this T value) => Torque.FromKilonewtonMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilonewtonMillimeters(this T? value) where T : struct => Torque.FromKilonewtonMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForceFoot - /// public static Torque KilopoundForceFeet(this T value) => Torque.FromKilopoundForceFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilopoundForceFeet(this T? value) where T : struct => Torque.FromKilopoundForceFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilopoundForceInch - /// public static Torque KilopoundForceInches(this T value) => Torque.FromKilopoundForceInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? KilopoundForceInches(this T? value) where T : struct => Torque.FromKilopoundForceInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonCentimeter - /// public static Torque MeganewtonCentimeters(this T value) => Torque.FromMeganewtonCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? MeganewtonCentimeters(this T? value) where T : struct => Torque.FromMeganewtonCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonMeter - /// public static Torque MeganewtonMeters(this T value) => Torque.FromMeganewtonMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? MeganewtonMeters(this T? value) where T : struct => Torque.FromMeganewtonMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MeganewtonMillimeter - /// public static Torque MeganewtonMillimeters(this T value) => Torque.FromMeganewtonMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? MeganewtonMillimeters(this T? value) where T : struct => Torque.FromMeganewtonMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegapoundForceFoot - /// public static Torque MegapoundForceFeet(this T value) => Torque.FromMegapoundForceFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? MegapoundForceFeet(this T? value) where T : struct => Torque.FromMegapoundForceFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegapoundForceInch - /// public static Torque MegapoundForceInches(this T value) => Torque.FromMegapoundForceInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? MegapoundForceInches(this T? value) where T : struct => Torque.FromMegapoundForceInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonCentimeter - /// public static Torque NewtonCentimeters(this T value) => Torque.FromNewtonCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? NewtonCentimeters(this T? value) where T : struct => Torque.FromNewtonCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonMeter - /// public static Torque NewtonMeters(this T value) => Torque.FromNewtonMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? NewtonMeters(this T? value) where T : struct => Torque.FromNewtonMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NewtonMillimeter - /// public static Torque NewtonMillimeters(this T value) => Torque.FromNewtonMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? NewtonMillimeters(this T? value) where T : struct => Torque.FromNewtonMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForceFoot - /// public static Torque PoundForceFeet(this T value) => Torque.FromPoundForceFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? PoundForceFeet(this T? value) where T : struct => Torque.FromPoundForceFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region PoundForceInch - /// public static Torque PoundForceInches(this T value) => Torque.FromPoundForceInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? PoundForceInches(this T? value) where T : struct => Torque.FromPoundForceInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForceCentimeter - /// public static Torque TonneForceCentimeters(this T value) => Torque.FromTonneForceCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? TonneForceCentimeters(this T? value) where T : struct => Torque.FromTonneForceCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForceMeter - /// public static Torque TonneForceMeters(this T value) => Torque.FromTonneForceMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? TonneForceMeters(this T? value) where T : struct => Torque.FromTonneForceMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region TonneForceMillimeter - /// public static Torque TonneForceMillimeters(this T value) => Torque.FromTonneForceMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? TonneForceMillimeters(this T? value) where T : struct => Torque.FromTonneForceMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVitaminAExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVitaminAExtensions.g.cs index 748f471f95..79890adcb2 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVitaminAExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVitaminAExtensions.g.cs @@ -44,17 +44,9 @@ namespace UnitsNet.Extensions.NumberToVitaminA { public static class NumberToVitaminAExtensions { - #region InternationalUnit - /// public static VitaminA InternationalUnits(this T value) => VitaminA.FromInternationalUnits(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VitaminA? InternationalUnits(this T? value) where T : struct => VitaminA.FromInternationalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs index 26c05e3625..150eef67e2 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeExtensions.g.cs @@ -44,492 +44,140 @@ namespace UnitsNet.Extensions.NumberToVolume { public static class NumberToVolumeExtensions { - #region AuTablespoon - /// public static Volume AuTablespoons(this T value) => Volume.FromAuTablespoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? AuTablespoons(this T? value) where T : struct => Volume.FromAuTablespoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Centiliter - /// public static Volume Centiliters(this T value) => Volume.FromCentiliters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Centiliters(this T? value) where T : struct => Volume.FromCentiliters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicCentimeter - /// public static Volume CubicCentimeters(this T value) => Volume.FromCubicCentimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicCentimeters(this T? value) where T : struct => Volume.FromCubicCentimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicDecimeter - /// public static Volume CubicDecimeters(this T value) => Volume.FromCubicDecimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicDecimeters(this T? value) where T : struct => Volume.FromCubicDecimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFoot - /// public static Volume CubicFeet(this T value) => Volume.FromCubicFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicFeet(this T? value) where T : struct => Volume.FromCubicFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicInch - /// public static Volume CubicInches(this T value) => Volume.FromCubicInches(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicInches(this T? value) where T : struct => Volume.FromCubicInches(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicKilometer - /// public static Volume CubicKilometers(this T value) => Volume.FromCubicKilometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicKilometers(this T? value) where T : struct => Volume.FromCubicKilometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeter - /// public static Volume CubicMeters(this T value) => Volume.FromCubicMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicMeters(this T? value) where T : struct => Volume.FromCubicMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMicrometer - /// public static Volume CubicMicrometers(this T value) => Volume.FromCubicMicrometers(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicMicrometers(this T? value) where T : struct => Volume.FromCubicMicrometers(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMile - /// public static Volume CubicMiles(this T value) => Volume.FromCubicMiles(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicMiles(this T? value) where T : struct => Volume.FromCubicMiles(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMillimeter - /// public static Volume CubicMillimeters(this T value) => Volume.FromCubicMillimeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicMillimeters(this T? value) where T : struct => Volume.FromCubicMillimeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYard - /// public static Volume CubicYards(this T value) => Volume.FromCubicYards(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? CubicYards(this T? value) where T : struct => Volume.FromCubicYards(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Deciliter - /// public static Volume Deciliters(this T value) => Volume.FromDeciliters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Deciliters(this T? value) where T : struct => Volume.FromDeciliters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HectocubicFoot - /// public static Volume HectocubicFeet(this T value) => Volume.FromHectocubicFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? HectocubicFeet(this T? value) where T : struct => Volume.FromHectocubicFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region HectocubicMeter - /// public static Volume HectocubicMeters(this T value) => Volume.FromHectocubicMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? HectocubicMeters(this T? value) where T : struct => Volume.FromHectocubicMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Hectoliter - /// public static Volume Hectoliters(this T value) => Volume.FromHectoliters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Hectoliters(this T? value) where T : struct => Volume.FromHectoliters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ImperialBeerBarrel - /// public static Volume ImperialBeerBarrels(this T value) => Volume.FromImperialBeerBarrels(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? ImperialBeerBarrels(this T? value) where T : struct => Volume.FromImperialBeerBarrels(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ImperialGallon - /// public static Volume ImperialGallons(this T value) => Volume.FromImperialGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? ImperialGallons(this T? value) where T : struct => Volume.FromImperialGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region ImperialOunce - /// public static Volume ImperialOunces(this T value) => Volume.FromImperialOunces(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? ImperialOunces(this T? value) where T : struct => Volume.FromImperialOunces(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocubicFoot - /// public static Volume KilocubicFeet(this T value) => Volume.FromKilocubicFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? KilocubicFeet(this T? value) where T : struct => Volume.FromKilocubicFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilocubicMeter - /// public static Volume KilocubicMeters(this T value) => Volume.FromKilocubicMeters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? KilocubicMeters(this T? value) where T : struct => Volume.FromKilocubicMeters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KiloimperialGallon - /// public static Volume KiloimperialGallons(this T value) => Volume.FromKiloimperialGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? KiloimperialGallons(this T? value) where T : struct => Volume.FromKiloimperialGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilousGallon - /// public static Volume KilousGallons(this T value) => Volume.FromKilousGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? KilousGallons(this T? value) where T : struct => Volume.FromKilousGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Liter - /// public static Volume Liters(this T value) => Volume.FromLiters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Liters(this T? value) where T : struct => Volume.FromLiters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegacubicFoot - /// public static Volume MegacubicFeet(this T value) => Volume.FromMegacubicFeet(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? MegacubicFeet(this T? value) where T : struct => Volume.FromMegacubicFeet(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegaimperialGallon - /// public static Volume MegaimperialGallons(this T value) => Volume.FromMegaimperialGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? MegaimperialGallons(this T? value) where T : struct => Volume.FromMegaimperialGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MegausGallon - /// public static Volume MegausGallons(this T value) => Volume.FromMegausGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? MegausGallons(this T? value) where T : struct => Volume.FromMegausGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MetricCup - /// public static Volume MetricCups(this T value) => Volume.FromMetricCups(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? MetricCups(this T? value) where T : struct => Volume.FromMetricCups(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MetricTeaspoon - /// public static Volume MetricTeaspoons(this T value) => Volume.FromMetricTeaspoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? MetricTeaspoons(this T? value) where T : struct => Volume.FromMetricTeaspoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Microliter - /// public static Volume Microliters(this T value) => Volume.FromMicroliters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Microliters(this T? value) where T : struct => Volume.FromMicroliters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Milliliter - /// public static Volume Milliliters(this T value) => Volume.FromMilliliters(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Milliliters(this T? value) where T : struct => Volume.FromMilliliters(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrel - /// public static Volume OilBarrels(this T value) => Volume.FromOilBarrels(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? OilBarrels(this T? value) where T : struct => Volume.FromOilBarrels(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Tablespoon - /// [System.Obsolete("Deprecated due to github issue #134, please use UsTablespoon instead")] public static Volume Tablespoons(this T value) => Volume.FromTablespoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Tablespoons(this T? value) where T : struct => Volume.FromTablespoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region Teaspoon - /// [System.Obsolete("Deprecated due to github issue #134, please use UsTeaspoon instead")] public static Volume Teaspoons(this T value) => Volume.FromTeaspoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? Teaspoons(this T? value) where T : struct => Volume.FromTeaspoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UkTablespoon - /// public static Volume UkTablespoons(this T value) => Volume.FromUkTablespoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UkTablespoons(this T? value) where T : struct => Volume.FromUkTablespoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsBeerBarrel - /// public static Volume UsBeerBarrels(this T value) => Volume.FromUsBeerBarrels(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsBeerBarrels(this T? value) where T : struct => Volume.FromUsBeerBarrels(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsCustomaryCup - /// public static Volume UsCustomaryCups(this T value) => Volume.FromUsCustomaryCups(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsCustomaryCups(this T? value) where T : struct => Volume.FromUsCustomaryCups(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallon - /// public static Volume UsGallons(this T value) => Volume.FromUsGallons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsGallons(this T? value) where T : struct => Volume.FromUsGallons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsLegalCup - /// public static Volume UsLegalCups(this T value) => Volume.FromUsLegalCups(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsLegalCups(this T? value) where T : struct => Volume.FromUsLegalCups(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsOunce - /// public static Volume UsOunces(this T value) => Volume.FromUsOunces(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsOunces(this T? value) where T : struct => Volume.FromUsOunces(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsPint - /// public static Volume UsPints(this T value) => Volume.FromUsPints(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsPints(this T? value) where T : struct => Volume.FromUsPints(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsQuart - /// public static Volume UsQuarts(this T value) => Volume.FromUsQuarts(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsQuarts(this T? value) where T : struct => Volume.FromUsQuarts(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsTablespoon - /// public static Volume UsTablespoons(this T value) => Volume.FromUsTablespoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsTablespoons(this T? value) where T : struct => Volume.FromUsTablespoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsTeaspoon - /// public static Volume UsTeaspoons(this T value) => Volume.FromUsTeaspoons(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? UsTeaspoons(this T? value) where T : struct => Volume.FromUsTeaspoons(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeFlowExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeFlowExtensions.g.cs index 19375aa8a8..18e5684f05 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeFlowExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToVolumeFlowExtensions.g.cs @@ -44,292 +44,84 @@ namespace UnitsNet.Extensions.NumberToVolumeFlow { public static class NumberToVolumeFlowExtensions { - #region CentilitersPerMinute - /// public static VolumeFlow CentilitersPerMinute(this T value) => VolumeFlow.FromCentilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CentilitersPerMinute(this T? value) where T : struct => VolumeFlow.FromCentilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicDecimeterPerMinute - /// public static VolumeFlow CubicDecimetersPerMinute(this T value) => VolumeFlow.FromCubicDecimetersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicDecimetersPerMinute(this T? value) where T : struct => VolumeFlow.FromCubicDecimetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerHour - /// public static VolumeFlow CubicFeetPerHour(this T value) => VolumeFlow.FromCubicFeetPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicFeetPerHour(this T? value) where T : struct => VolumeFlow.FromCubicFeetPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerMinute - /// public static VolumeFlow CubicFeetPerMinute(this T value) => VolumeFlow.FromCubicFeetPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicFeetPerMinute(this T? value) where T : struct => VolumeFlow.FromCubicFeetPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicFootPerSecond - /// public static VolumeFlow CubicFeetPerSecond(this T value) => VolumeFlow.FromCubicFeetPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicFeetPerSecond(this T? value) where T : struct => VolumeFlow.FromCubicFeetPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerHour - /// public static VolumeFlow CubicMetersPerHour(this T value) => VolumeFlow.FromCubicMetersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicMetersPerHour(this T? value) where T : struct => VolumeFlow.FromCubicMetersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerMinute - /// public static VolumeFlow CubicMetersPerMinute(this T value) => VolumeFlow.FromCubicMetersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicMetersPerMinute(this T? value) where T : struct => VolumeFlow.FromCubicMetersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicMeterPerSecond - /// public static VolumeFlow CubicMetersPerSecond(this T value) => VolumeFlow.FromCubicMetersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicMetersPerSecond(this T? value) where T : struct => VolumeFlow.FromCubicMetersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerHour - /// public static VolumeFlow CubicYardsPerHour(this T value) => VolumeFlow.FromCubicYardsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicYardsPerHour(this T? value) where T : struct => VolumeFlow.FromCubicYardsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerMinute - /// public static VolumeFlow CubicYardsPerMinute(this T value) => VolumeFlow.FromCubicYardsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicYardsPerMinute(this T? value) where T : struct => VolumeFlow.FromCubicYardsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region CubicYardPerSecond - /// public static VolumeFlow CubicYardsPerSecond(this T value) => VolumeFlow.FromCubicYardsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? CubicYardsPerSecond(this T? value) where T : struct => VolumeFlow.FromCubicYardsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region DecilitersPerMinute - /// public static VolumeFlow DecilitersPerMinute(this T value) => VolumeFlow.FromDecilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? DecilitersPerMinute(this T? value) where T : struct => VolumeFlow.FromDecilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region KilolitersPerMinute - /// public static VolumeFlow KilolitersPerMinute(this T value) => VolumeFlow.FromKilolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? KilolitersPerMinute(this T? value) where T : struct => VolumeFlow.FromKilolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerHour - /// public static VolumeFlow LitersPerHour(this T value) => VolumeFlow.FromLitersPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? LitersPerHour(this T? value) where T : struct => VolumeFlow.FromLitersPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerMinute - /// public static VolumeFlow LitersPerMinute(this T value) => VolumeFlow.FromLitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? LitersPerMinute(this T? value) where T : struct => VolumeFlow.FromLitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region LitersPerSecond - /// public static VolumeFlow LitersPerSecond(this T value) => VolumeFlow.FromLitersPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? LitersPerSecond(this T? value) where T : struct => VolumeFlow.FromLitersPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MicrolitersPerMinute - /// public static VolumeFlow MicrolitersPerMinute(this T value) => VolumeFlow.FromMicrolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? MicrolitersPerMinute(this T? value) where T : struct => VolumeFlow.FromMicrolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillilitersPerMinute - /// public static VolumeFlow MillilitersPerMinute(this T value) => VolumeFlow.FromMillilitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? MillilitersPerMinute(this T? value) where T : struct => VolumeFlow.FromMillilitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region MillionUsGallonsPerDay - /// public static VolumeFlow MillionUsGallonsPerDay(this T value) => VolumeFlow.FromMillionUsGallonsPerDay(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? MillionUsGallonsPerDay(this T? value) where T : struct => VolumeFlow.FromMillionUsGallonsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region NanolitersPerMinute - /// public static VolumeFlow NanolitersPerMinute(this T value) => VolumeFlow.FromNanolitersPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? NanolitersPerMinute(this T? value) where T : struct => VolumeFlow.FromNanolitersPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrelsPerDay - /// public static VolumeFlow OilBarrelsPerDay(this T value) => VolumeFlow.FromOilBarrelsPerDay(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? OilBarrelsPerDay(this T? value) where T : struct => VolumeFlow.FromOilBarrelsPerDay(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrelsPerHour - /// public static VolumeFlow OilBarrelsPerHour(this T value) => VolumeFlow.FromOilBarrelsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? OilBarrelsPerHour(this T? value) where T : struct => VolumeFlow.FromOilBarrelsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region OilBarrelsPerMinute - /// public static VolumeFlow OilBarrelsPerMinute(this T value) => VolumeFlow.FromOilBarrelsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? OilBarrelsPerMinute(this T? value) where T : struct => VolumeFlow.FromOilBarrelsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerHour - /// public static VolumeFlow UsGallonsPerHour(this T value) => VolumeFlow.FromUsGallonsPerHour(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? UsGallonsPerHour(this T? value) where T : struct => VolumeFlow.FromUsGallonsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerMinute - /// public static VolumeFlow UsGallonsPerMinute(this T value) => VolumeFlow.FromUsGallonsPerMinute(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? UsGallonsPerMinute(this T? value) where T : struct => VolumeFlow.FromUsGallonsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - - #region UsGallonsPerSecond - /// public static VolumeFlow UsGallonsPerSecond(this T value) => VolumeFlow.FromUsGallonsPerSecond(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? UsGallonsPerSecond(this T? value) where T : struct => VolumeFlow.FromUsGallonsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - } } #endif diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index afe7bad3d2..5032179de9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -60,139 +60,6 @@ public partial struct Acceleration : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Acceleration from nullable CentimetersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromCentimetersPerSecondSquared(QuantityValue? centimeterspersecondsquared) - { - return centimeterspersecondsquared.HasValue ? FromCentimetersPerSecondSquared(centimeterspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable DecimetersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromDecimetersPerSecondSquared(QuantityValue? decimeterspersecondsquared) - { - return decimeterspersecondsquared.HasValue ? FromDecimetersPerSecondSquared(decimeterspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable FeetPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromFeetPerSecondSquared(QuantityValue? feetpersecondsquared) - { - return feetpersecondsquared.HasValue ? FromFeetPerSecondSquared(feetpersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable InchesPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromInchesPerSecondSquared(QuantityValue? inchespersecondsquared) - { - return inchespersecondsquared.HasValue ? FromInchesPerSecondSquared(inchespersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable KilometersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromKilometersPerSecondSquared(QuantityValue? kilometerspersecondsquared) - { - return kilometerspersecondsquared.HasValue ? FromKilometersPerSecondSquared(kilometerspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable KnotsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromKnotsPerHour(QuantityValue? knotsperhour) - { - return knotsperhour.HasValue ? FromKnotsPerHour(knotsperhour.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable KnotsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromKnotsPerMinute(QuantityValue? knotsperminute) - { - return knotsperminute.HasValue ? FromKnotsPerMinute(knotsperminute.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable KnotsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromKnotsPerSecond(QuantityValue? knotspersecond) - { - return knotspersecond.HasValue ? FromKnotsPerSecond(knotspersecond.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable MetersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromMetersPerSecondSquared(QuantityValue? meterspersecondsquared) - { - return meterspersecondsquared.HasValue ? FromMetersPerSecondSquared(meterspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable MicrometersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromMicrometersPerSecondSquared(QuantityValue? micrometerspersecondsquared) - { - return micrometerspersecondsquared.HasValue ? FromMicrometersPerSecondSquared(micrometerspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable MillimetersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromMillimetersPerSecondSquared(QuantityValue? millimeterspersecondsquared) - { - return millimeterspersecondsquared.HasValue ? FromMillimetersPerSecondSquared(millimeterspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable NanometersPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromNanometersPerSecondSquared(QuantityValue? nanometerspersecondsquared) - { - return nanometerspersecondsquared.HasValue ? FromNanometersPerSecondSquared(nanometerspersecondsquared.Value) : default(Acceleration?); - } - - /// - /// Get nullable Acceleration from nullable StandardGravity. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Acceleration? FromStandardGravity(QuantityValue? standardgravity) - { - return standardgravity.HasValue ? FromStandardGravity(standardgravity.Value) : default(Acceleration?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Acceleration unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Acceleration? From(QuantityValue? value, AccelerationUnit fromUnit) - { - return value.HasValue ? new Acceleration((double)value.Value, fromUnit) : default(Acceleration?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 61e24dca68..0c7bbb8672 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -60,148 +60,6 @@ public partial struct AmountOfSubstance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable AmountOfSubstance from nullable Centimoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromCentimoles(QuantityValue? centimoles) - { - return centimoles.HasValue ? FromCentimoles(centimoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable CentipoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromCentipoundMoles(QuantityValue? centipoundmoles) - { - return centipoundmoles.HasValue ? FromCentipoundMoles(centipoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Decimoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromDecimoles(QuantityValue? decimoles) - { - return decimoles.HasValue ? FromDecimoles(decimoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable DecipoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromDecipoundMoles(QuantityValue? decipoundmoles) - { - return decipoundmoles.HasValue ? FromDecipoundMoles(decipoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Kilomoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromKilomoles(QuantityValue? kilomoles) - { - return kilomoles.HasValue ? FromKilomoles(kilomoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable KilopoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromKilopoundMoles(QuantityValue? kilopoundmoles) - { - return kilopoundmoles.HasValue ? FromKilopoundMoles(kilopoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Micromoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromMicromoles(QuantityValue? micromoles) - { - return micromoles.HasValue ? FromMicromoles(micromoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable MicropoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromMicropoundMoles(QuantityValue? micropoundmoles) - { - return micropoundmoles.HasValue ? FromMicropoundMoles(micropoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Millimoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromMillimoles(QuantityValue? millimoles) - { - return millimoles.HasValue ? FromMillimoles(millimoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable MillipoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromMillipoundMoles(QuantityValue? millipoundmoles) - { - return millipoundmoles.HasValue ? FromMillipoundMoles(millipoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Moles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromMoles(QuantityValue? moles) - { - return moles.HasValue ? FromMoles(moles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable Nanomoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromNanomoles(QuantityValue? nanomoles) - { - return nanomoles.HasValue ? FromNanomoles(nanomoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable NanopoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromNanopoundMoles(QuantityValue? nanopoundmoles) - { - return nanopoundmoles.HasValue ? FromNanopoundMoles(nanopoundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Get nullable AmountOfSubstance from nullable PoundMoles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmountOfSubstance? FromPoundMoles(QuantityValue? poundmoles) - { - return poundmoles.HasValue ? FromPoundMoles(poundmoles.Value) : default(AmountOfSubstance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// AmountOfSubstance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmountOfSubstance? From(QuantityValue? value, AmountOfSubstanceUnit fromUnit) - { - return value.HasValue ? new AmountOfSubstance((double)value.Value, fromUnit) : default(AmountOfSubstance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 23c643afd5..b6b7872a4b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct AmplitudeRatio : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable AmplitudeRatio from nullable DecibelMicrovolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmplitudeRatio? FromDecibelMicrovolts(QuantityValue? decibelmicrovolts) - { - return decibelmicrovolts.HasValue ? FromDecibelMicrovolts(decibelmicrovolts.Value) : default(AmplitudeRatio?); - } - - /// - /// Get nullable AmplitudeRatio from nullable DecibelMillivolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmplitudeRatio? FromDecibelMillivolts(QuantityValue? decibelmillivolts) - { - return decibelmillivolts.HasValue ? FromDecibelMillivolts(decibelmillivolts.Value) : default(AmplitudeRatio?); - } - - /// - /// Get nullable AmplitudeRatio from nullable DecibelsUnloaded. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmplitudeRatio? FromDecibelsUnloaded(QuantityValue? decibelsunloaded) - { - return decibelsunloaded.HasValue ? FromDecibelsUnloaded(decibelsunloaded.Value) : default(AmplitudeRatio?); - } - - /// - /// Get nullable AmplitudeRatio from nullable DecibelVolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AmplitudeRatio? FromDecibelVolts(QuantityValue? decibelvolts) - { - return decibelvolts.HasValue ? FromDecibelVolts(decibelvolts.Value) : default(AmplitudeRatio?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// AmplitudeRatio unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AmplitudeRatio? From(QuantityValue? value, AmplitudeRatioUnit fromUnit) - { - return value.HasValue ? new AmplitudeRatio((double)value.Value, fromUnit) : default(AmplitudeRatio?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index ca02498de4..0836147276 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -60,148 +60,6 @@ public partial struct Angle : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Angle from nullable Arcminutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromArcminutes(QuantityValue? arcminutes) - { - return arcminutes.HasValue ? FromArcminutes(arcminutes.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Arcseconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromArcseconds(QuantityValue? arcseconds) - { - return arcseconds.HasValue ? FromArcseconds(arcseconds.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Centiradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromCentiradians(QuantityValue? centiradians) - { - return centiradians.HasValue ? FromCentiradians(centiradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Deciradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromDeciradians(QuantityValue? deciradians) - { - return deciradians.HasValue ? FromDeciradians(deciradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Degrees. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromDegrees(QuantityValue? degrees) - { - return degrees.HasValue ? FromDegrees(degrees.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Gradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromGradians(QuantityValue? gradians) - { - return gradians.HasValue ? FromGradians(gradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Microdegrees. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromMicrodegrees(QuantityValue? microdegrees) - { - return microdegrees.HasValue ? FromMicrodegrees(microdegrees.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Microradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromMicroradians(QuantityValue? microradians) - { - return microradians.HasValue ? FromMicroradians(microradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Millidegrees. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromMillidegrees(QuantityValue? millidegrees) - { - return millidegrees.HasValue ? FromMillidegrees(millidegrees.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Milliradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromMilliradians(QuantityValue? milliradians) - { - return milliradians.HasValue ? FromMilliradians(milliradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Nanodegrees. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromNanodegrees(QuantityValue? nanodegrees) - { - return nanodegrees.HasValue ? FromNanodegrees(nanodegrees.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Nanoradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromNanoradians(QuantityValue? nanoradians) - { - return nanoradians.HasValue ? FromNanoradians(nanoradians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Radians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromRadians(QuantityValue? radians) - { - return radians.HasValue ? FromRadians(radians.Value) : default(Angle?); - } - - /// - /// Get nullable Angle from nullable Revolutions. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Angle? FromRevolutions(QuantityValue? revolutions) - { - return revolutions.HasValue ? FromRevolutions(revolutions.Value) : default(Angle?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Angle unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Angle? From(QuantityValue? value, AngleUnit fromUnit) - { - return value.HasValue ? new Angle((double)value.Value, fromUnit) : default(Angle?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 05dfc23e9d..d6b822b78e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct ApparentEnergy : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ApparentEnergy from nullable KilovoltampereHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentEnergy? FromKilovoltampereHours(QuantityValue? kilovoltamperehours) - { - return kilovoltamperehours.HasValue ? FromKilovoltampereHours(kilovoltamperehours.Value) : default(ApparentEnergy?); - } - - /// - /// Get nullable ApparentEnergy from nullable MegavoltampereHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentEnergy? FromMegavoltampereHours(QuantityValue? megavoltamperehours) - { - return megavoltamperehours.HasValue ? FromMegavoltampereHours(megavoltamperehours.Value) : default(ApparentEnergy?); - } - - /// - /// Get nullable ApparentEnergy from nullable VoltampereHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentEnergy? FromVoltampereHours(QuantityValue? voltamperehours) - { - return voltamperehours.HasValue ? FromVoltampereHours(voltamperehours.Value) : default(ApparentEnergy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ApparentEnergy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentEnergy? From(QuantityValue? value, ApparentEnergyUnit fromUnit) - { - return value.HasValue ? new ApparentEnergy((double)value.Value, fromUnit) : default(ApparentEnergy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index aea8d678f7..768eea8baa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct ApparentPower : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ApparentPower from nullable Gigavoltamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentPower? FromGigavoltamperes(QuantityValue? gigavoltamperes) - { - return gigavoltamperes.HasValue ? FromGigavoltamperes(gigavoltamperes.Value) : default(ApparentPower?); - } - - /// - /// Get nullable ApparentPower from nullable Kilovoltamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentPower? FromKilovoltamperes(QuantityValue? kilovoltamperes) - { - return kilovoltamperes.HasValue ? FromKilovoltamperes(kilovoltamperes.Value) : default(ApparentPower?); - } - - /// - /// Get nullable ApparentPower from nullable Megavoltamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentPower? FromMegavoltamperes(QuantityValue? megavoltamperes) - { - return megavoltamperes.HasValue ? FromMegavoltamperes(megavoltamperes.Value) : default(ApparentPower?); - } - - /// - /// Get nullable ApparentPower from nullable Voltamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ApparentPower? FromVoltamperes(QuantityValue? voltamperes) - { - return voltamperes.HasValue ? FromVoltamperes(voltamperes.Value) : default(ApparentPower?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ApparentPower unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ApparentPower? From(QuantityValue? value, ApparentPowerUnit fromUnit) - { - return value.HasValue ? new ApparentPower((double)value.Value, fromUnit) : default(ApparentPower?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 5235e24c0d..848e6678de 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -60,139 +60,6 @@ public partial struct Area : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Area from nullable Acres. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromAcres(QuantityValue? acres) - { - return acres.HasValue ? FromAcres(acres.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable Hectares. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromHectares(QuantityValue? hectares) - { - return hectares.HasValue ? FromHectares(hectares.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareCentimeters(QuantityValue? squarecentimeters) - { - return squarecentimeters.HasValue ? FromSquareCentimeters(squarecentimeters.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareDecimeters(QuantityValue? squaredecimeters) - { - return squaredecimeters.HasValue ? FromSquareDecimeters(squaredecimeters.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareFeet(QuantityValue? squarefeet) - { - return squarefeet.HasValue ? FromSquareFeet(squarefeet.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareInches(QuantityValue? squareinches) - { - return squareinches.HasValue ? FromSquareInches(squareinches.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareKilometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareKilometers(QuantityValue? squarekilometers) - { - return squarekilometers.HasValue ? FromSquareKilometers(squarekilometers.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareMeters(QuantityValue? squaremeters) - { - return squaremeters.HasValue ? FromSquareMeters(squaremeters.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareMicrometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareMicrometers(QuantityValue? squaremicrometers) - { - return squaremicrometers.HasValue ? FromSquareMicrometers(squaremicrometers.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareMiles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareMiles(QuantityValue? squaremiles) - { - return squaremiles.HasValue ? FromSquareMiles(squaremiles.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareMillimeters(QuantityValue? squaremillimeters) - { - return squaremillimeters.HasValue ? FromSquareMillimeters(squaremillimeters.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable SquareYards. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromSquareYards(QuantityValue? squareyards) - { - return squareyards.HasValue ? FromSquareYards(squareyards.Value) : default(Area?); - } - - /// - /// Get nullable Area from nullable UsSurveySquareFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Area? FromUsSurveySquareFeet(QuantityValue? ussurveysquarefeet) - { - return ussurveysquarefeet.HasValue ? FromUsSurveySquareFeet(ussurveysquarefeet.Value) : default(Area?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Area unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Area? From(QuantityValue? value, AreaUnit fromUnit) - { - return value.HasValue ? new Area((double)value.Value, fromUnit) : default(Area?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 842a74b281..22183d61bd 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct AreaDensity : IComparable, IComparable /// public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable AreaDensity from nullable KilogramsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaDensity? FromKilogramsPerSquareMeter(QuantityValue? kilogramspersquaremeter) - { - return kilogramspersquaremeter.HasValue ? FromKilogramsPerSquareMeter(kilogramspersquaremeter.Value) : default(AreaDensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// AreaDensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaDensity? From(QuantityValue? value, AreaDensityUnit fromUnit) - { - return value.HasValue ? new AreaDensity((double)value.Value, fromUnit) : default(AreaDensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 76f090fc9d..9474a70716 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -60,76 +60,6 @@ public partial struct AreaMomentOfInertia : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable AreaMomentOfInertia from nullable CentimetersToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromCentimetersToTheFourth(QuantityValue? centimeterstothefourth) - { - return centimeterstothefourth.HasValue ? FromCentimetersToTheFourth(centimeterstothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Get nullable AreaMomentOfInertia from nullable DecimetersToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromDecimetersToTheFourth(QuantityValue? decimeterstothefourth) - { - return decimeterstothefourth.HasValue ? FromDecimetersToTheFourth(decimeterstothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Get nullable AreaMomentOfInertia from nullable FeetToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromFeetToTheFourth(QuantityValue? feettothefourth) - { - return feettothefourth.HasValue ? FromFeetToTheFourth(feettothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Get nullable AreaMomentOfInertia from nullable InchesToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromInchesToTheFourth(QuantityValue? inchestothefourth) - { - return inchestothefourth.HasValue ? FromInchesToTheFourth(inchestothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Get nullable AreaMomentOfInertia from nullable MetersToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromMetersToTheFourth(QuantityValue? meterstothefourth) - { - return meterstothefourth.HasValue ? FromMetersToTheFourth(meterstothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Get nullable AreaMomentOfInertia from nullable MillimetersToTheFourth. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static AreaMomentOfInertia? FromMillimetersToTheFourth(QuantityValue? millimeterstothefourth) - { - return millimeterstothefourth.HasValue ? FromMillimetersToTheFourth(millimeterstothefourth.Value) : default(AreaMomentOfInertia?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// AreaMomentOfInertia unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static AreaMomentOfInertia? From(QuantityValue? value, AreaMomentOfInertiaUnit fromUnit) - { - return value.HasValue ? new AreaMomentOfInertia((double)value.Value, fromUnit) : default(AreaMomentOfInertia?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 222a886e70..9d59eb703f 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -60,256 +60,6 @@ public partial struct BitRate : IComparable, IComparable /// public decimal Value => _value; - #region Nullable From Methods - - /// - /// Get nullable BitRate from nullable BitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromBitsPerSecond(QuantityValue? bitspersecond) - { - return bitspersecond.HasValue ? FromBitsPerSecond(bitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable BytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromBytesPerSecond(QuantityValue? bytespersecond) - { - return bytespersecond.HasValue ? FromBytesPerSecond(bytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable ExabitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromExabitsPerSecond(QuantityValue? exabitspersecond) - { - return exabitspersecond.HasValue ? FromExabitsPerSecond(exabitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable ExabytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromExabytesPerSecond(QuantityValue? exabytespersecond) - { - return exabytespersecond.HasValue ? FromExabytesPerSecond(exabytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable ExbibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromExbibitsPerSecond(QuantityValue? exbibitspersecond) - { - return exbibitspersecond.HasValue ? FromExbibitsPerSecond(exbibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable ExbibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromExbibytesPerSecond(QuantityValue? exbibytespersecond) - { - return exbibytespersecond.HasValue ? FromExbibytesPerSecond(exbibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable GibibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromGibibitsPerSecond(QuantityValue? gibibitspersecond) - { - return gibibitspersecond.HasValue ? FromGibibitsPerSecond(gibibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable GibibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromGibibytesPerSecond(QuantityValue? gibibytespersecond) - { - return gibibytespersecond.HasValue ? FromGibibytesPerSecond(gibibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable GigabitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromGigabitsPerSecond(QuantityValue? gigabitspersecond) - { - return gigabitspersecond.HasValue ? FromGigabitsPerSecond(gigabitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable GigabytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromGigabytesPerSecond(QuantityValue? gigabytespersecond) - { - return gigabytespersecond.HasValue ? FromGigabytesPerSecond(gigabytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable KibibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromKibibitsPerSecond(QuantityValue? kibibitspersecond) - { - return kibibitspersecond.HasValue ? FromKibibitsPerSecond(kibibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable KibibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromKibibytesPerSecond(QuantityValue? kibibytespersecond) - { - return kibibytespersecond.HasValue ? FromKibibytesPerSecond(kibibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable KilobitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromKilobitsPerSecond(QuantityValue? kilobitspersecond) - { - return kilobitspersecond.HasValue ? FromKilobitsPerSecond(kilobitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable KilobytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromKilobytesPerSecond(QuantityValue? kilobytespersecond) - { - return kilobytespersecond.HasValue ? FromKilobytesPerSecond(kilobytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable MebibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromMebibitsPerSecond(QuantityValue? mebibitspersecond) - { - return mebibitspersecond.HasValue ? FromMebibitsPerSecond(mebibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable MebibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromMebibytesPerSecond(QuantityValue? mebibytespersecond) - { - return mebibytespersecond.HasValue ? FromMebibytesPerSecond(mebibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable MegabitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromMegabitsPerSecond(QuantityValue? megabitspersecond) - { - return megabitspersecond.HasValue ? FromMegabitsPerSecond(megabitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable MegabytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromMegabytesPerSecond(QuantityValue? megabytespersecond) - { - return megabytespersecond.HasValue ? FromMegabytesPerSecond(megabytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable PebibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromPebibitsPerSecond(QuantityValue? pebibitspersecond) - { - return pebibitspersecond.HasValue ? FromPebibitsPerSecond(pebibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable PebibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromPebibytesPerSecond(QuantityValue? pebibytespersecond) - { - return pebibytespersecond.HasValue ? FromPebibytesPerSecond(pebibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable PetabitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromPetabitsPerSecond(QuantityValue? petabitspersecond) - { - return petabitspersecond.HasValue ? FromPetabitsPerSecond(petabitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable PetabytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromPetabytesPerSecond(QuantityValue? petabytespersecond) - { - return petabytespersecond.HasValue ? FromPetabytesPerSecond(petabytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable TebibitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromTebibitsPerSecond(QuantityValue? tebibitspersecond) - { - return tebibitspersecond.HasValue ? FromTebibitsPerSecond(tebibitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable TebibytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromTebibytesPerSecond(QuantityValue? tebibytespersecond) - { - return tebibytespersecond.HasValue ? FromTebibytesPerSecond(tebibytespersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable TerabitsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromTerabitsPerSecond(QuantityValue? terabitspersecond) - { - return terabitspersecond.HasValue ? FromTerabitsPerSecond(terabitspersecond.Value) : default(BitRate?); - } - - /// - /// Get nullable BitRate from nullable TerabytesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BitRate? FromTerabytesPerSecond(QuantityValue? terabytespersecond) - { - return terabytespersecond.HasValue ? FromTerabytesPerSecond(terabytespersecond.Value) : default(BitRate?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// BitRate unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BitRate? From(QuantityValue? value, BitRateUnit fromUnit) - { - return value.HasValue ? new BitRate((decimal)value.Value, fromUnit) : default(BitRate?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 9de58b5023..9e625bd2c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct BrakeSpecificFuelConsumption : IComparable, IComparable
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable BrakeSpecificFuelConsumption from nullable GramsPerKiloWattHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? FromGramsPerKiloWattHour(QuantityValue? gramsperkilowatthour) - { - return gramsperkilowatthour.HasValue ? FromGramsPerKiloWattHour(gramsperkilowatthour.Value) : default(BrakeSpecificFuelConsumption?); - } - - /// - /// Get nullable BrakeSpecificFuelConsumption from nullable KilogramsPerJoule. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? FromKilogramsPerJoule(QuantityValue? kilogramsperjoule) - { - return kilogramsperjoule.HasValue ? FromKilogramsPerJoule(kilogramsperjoule.Value) : default(BrakeSpecificFuelConsumption?); - } - - /// - /// Get nullable BrakeSpecificFuelConsumption from nullable PoundsPerMechanicalHorsepowerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? FromPoundsPerMechanicalHorsepowerHour(QuantityValue? poundspermechanicalhorsepowerhour) - { - return poundspermechanicalhorsepowerhour.HasValue ? FromPoundsPerMechanicalHorsepowerHour(poundspermechanicalhorsepowerhour.Value) : default(BrakeSpecificFuelConsumption?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// BrakeSpecificFuelConsumption unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static BrakeSpecificFuelConsumption? From(QuantityValue? value, BrakeSpecificFuelConsumptionUnit fromUnit) - { - return value.HasValue ? new BrakeSpecificFuelConsumption((double)value.Value, fromUnit) : default(BrakeSpecificFuelConsumption?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 1a0f3a3dd9..45f0edafa3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct Capacitance : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Capacitance from nullable Farads. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Capacitance? FromFarads(QuantityValue? farads) - { - return farads.HasValue ? FromFarads(farads.Value) : default(Capacitance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Capacitance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Capacitance? From(QuantityValue? value, CapacitanceUnit fromUnit) - { - return value.HasValue ? new Capacitance((double)value.Value, fromUnit) : default(Capacitance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index adc1b74e5f..62938a27d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -60,364 +60,6 @@ public partial struct Density : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Density from nullable CentigramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromCentigramsPerDeciLiter(QuantityValue? centigramsperdeciliter) - { - return centigramsperdeciliter.HasValue ? FromCentigramsPerDeciLiter(centigramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable CentigramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromCentigramsPerLiter(QuantityValue? centigramsperliter) - { - return centigramsperliter.HasValue ? FromCentigramsPerLiter(centigramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable CentigramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromCentigramsPerMilliliter(QuantityValue? centigramspermilliliter) - { - return centigramspermilliliter.HasValue ? FromCentigramsPerMilliliter(centigramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable DecigramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromDecigramsPerDeciLiter(QuantityValue? decigramsperdeciliter) - { - return decigramsperdeciliter.HasValue ? FromDecigramsPerDeciLiter(decigramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable DecigramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromDecigramsPerLiter(QuantityValue? decigramsperliter) - { - return decigramsperliter.HasValue ? FromDecigramsPerLiter(decigramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable DecigramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromDecigramsPerMilliliter(QuantityValue? decigramspermilliliter) - { - return decigramspermilliliter.HasValue ? FromDecigramsPerMilliliter(decigramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerCubicCentimeter(QuantityValue? gramspercubiccentimeter) - { - return gramspercubiccentimeter.HasValue ? FromGramsPerCubicCentimeter(gramspercubiccentimeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerCubicMeter(QuantityValue? gramspercubicmeter) - { - return gramspercubicmeter.HasValue ? FromGramsPerCubicMeter(gramspercubicmeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerCubicMillimeter(QuantityValue? gramspercubicmillimeter) - { - return gramspercubicmillimeter.HasValue ? FromGramsPerCubicMillimeter(gramspercubicmillimeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerDeciLiter(QuantityValue? gramsperdeciliter) - { - return gramsperdeciliter.HasValue ? FromGramsPerDeciLiter(gramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerLiter(QuantityValue? gramsperliter) - { - return gramsperliter.HasValue ? FromGramsPerLiter(gramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable GramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromGramsPerMilliliter(QuantityValue? gramspermilliliter) - { - return gramspermilliliter.HasValue ? FromGramsPerMilliliter(gramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable KilogramsPerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromKilogramsPerCubicCentimeter(QuantityValue? kilogramspercubiccentimeter) - { - return kilogramspercubiccentimeter.HasValue ? FromKilogramsPerCubicCentimeter(kilogramspercubiccentimeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable KilogramsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromKilogramsPerCubicMeter(QuantityValue? kilogramspercubicmeter) - { - return kilogramspercubicmeter.HasValue ? FromKilogramsPerCubicMeter(kilogramspercubicmeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable KilogramsPerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromKilogramsPerCubicMillimeter(QuantityValue? kilogramspercubicmillimeter) - { - return kilogramspercubicmillimeter.HasValue ? FromKilogramsPerCubicMillimeter(kilogramspercubicmillimeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable KilopoundsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromKilopoundsPerCubicFoot(QuantityValue? kilopoundspercubicfoot) - { - return kilopoundspercubicfoot.HasValue ? FromKilopoundsPerCubicFoot(kilopoundspercubicfoot.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable KilopoundsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromKilopoundsPerCubicInch(QuantityValue? kilopoundspercubicinch) - { - return kilopoundspercubicinch.HasValue ? FromKilopoundsPerCubicInch(kilopoundspercubicinch.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MicrogramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMicrogramsPerDeciLiter(QuantityValue? microgramsperdeciliter) - { - return microgramsperdeciliter.HasValue ? FromMicrogramsPerDeciLiter(microgramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MicrogramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMicrogramsPerLiter(QuantityValue? microgramsperliter) - { - return microgramsperliter.HasValue ? FromMicrogramsPerLiter(microgramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MicrogramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMicrogramsPerMilliliter(QuantityValue? microgramspermilliliter) - { - return microgramspermilliliter.HasValue ? FromMicrogramsPerMilliliter(microgramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MilligramsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMilligramsPerCubicMeter(QuantityValue? milligramspercubicmeter) - { - return milligramspercubicmeter.HasValue ? FromMilligramsPerCubicMeter(milligramspercubicmeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MilligramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMilligramsPerDeciLiter(QuantityValue? milligramsperdeciliter) - { - return milligramsperdeciliter.HasValue ? FromMilligramsPerDeciLiter(milligramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MilligramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMilligramsPerLiter(QuantityValue? milligramsperliter) - { - return milligramsperliter.HasValue ? FromMilligramsPerLiter(milligramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable MilligramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromMilligramsPerMilliliter(QuantityValue? milligramspermilliliter) - { - return milligramspermilliliter.HasValue ? FromMilligramsPerMilliliter(milligramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable NanogramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromNanogramsPerDeciLiter(QuantityValue? nanogramsperdeciliter) - { - return nanogramsperdeciliter.HasValue ? FromNanogramsPerDeciLiter(nanogramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable NanogramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromNanogramsPerLiter(QuantityValue? nanogramsperliter) - { - return nanogramsperliter.HasValue ? FromNanogramsPerLiter(nanogramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable NanogramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromNanogramsPerMilliliter(QuantityValue? nanogramspermilliliter) - { - return nanogramspermilliliter.HasValue ? FromNanogramsPerMilliliter(nanogramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PicogramsPerDeciLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPicogramsPerDeciLiter(QuantityValue? picogramsperdeciliter) - { - return picogramsperdeciliter.HasValue ? FromPicogramsPerDeciLiter(picogramsperdeciliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PicogramsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPicogramsPerLiter(QuantityValue? picogramsperliter) - { - return picogramsperliter.HasValue ? FromPicogramsPerLiter(picogramsperliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PicogramsPerMilliliter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPicogramsPerMilliliter(QuantityValue? picogramspermilliliter) - { - return picogramspermilliliter.HasValue ? FromPicogramsPerMilliliter(picogramspermilliliter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PoundsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPoundsPerCubicFoot(QuantityValue? poundspercubicfoot) - { - return poundspercubicfoot.HasValue ? FromPoundsPerCubicFoot(poundspercubicfoot.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PoundsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPoundsPerCubicInch(QuantityValue? poundspercubicinch) - { - return poundspercubicinch.HasValue ? FromPoundsPerCubicInch(poundspercubicinch.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PoundsPerImperialGallon. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPoundsPerImperialGallon(QuantityValue? poundsperimperialgallon) - { - return poundsperimperialgallon.HasValue ? FromPoundsPerImperialGallon(poundsperimperialgallon.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable PoundsPerUSGallon. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromPoundsPerUSGallon(QuantityValue? poundsperusgallon) - { - return poundsperusgallon.HasValue ? FromPoundsPerUSGallon(poundsperusgallon.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable SlugsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromSlugsPerCubicFoot(QuantityValue? slugspercubicfoot) - { - return slugspercubicfoot.HasValue ? FromSlugsPerCubicFoot(slugspercubicfoot.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable TonnesPerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromTonnesPerCubicCentimeter(QuantityValue? tonnespercubiccentimeter) - { - return tonnespercubiccentimeter.HasValue ? FromTonnesPerCubicCentimeter(tonnespercubiccentimeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable TonnesPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromTonnesPerCubicMeter(QuantityValue? tonnespercubicmeter) - { - return tonnespercubicmeter.HasValue ? FromTonnesPerCubicMeter(tonnespercubicmeter.Value) : default(Density?); - } - - /// - /// Get nullable Density from nullable TonnesPerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Density? FromTonnesPerCubicMillimeter(QuantityValue? tonnespercubicmillimeter) - { - return tonnespercubicmillimeter.HasValue ? FromTonnesPerCubicMillimeter(tonnespercubicmillimeter.Value) : default(Density?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Density unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Density? From(QuantityValue? value, DensityUnit fromUnit) - { - return value.HasValue ? new Density((double)value.Value, fromUnit) : default(Density?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 351f373794..4c5090f276 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -60,130 +60,6 @@ public partial struct Duration : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Duration from nullable Days. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromDays(QuantityValue? days) - { - return days.HasValue ? FromDays(days.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Hours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromHours(QuantityValue? hours) - { - return hours.HasValue ? FromHours(hours.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Microseconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMicroseconds(QuantityValue? microseconds) - { - return microseconds.HasValue ? FromMicroseconds(microseconds.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Milliseconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMilliseconds(QuantityValue? milliseconds) - { - return milliseconds.HasValue ? FromMilliseconds(milliseconds.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Minutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMinutes(QuantityValue? minutes) - { - return minutes.HasValue ? FromMinutes(minutes.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Months. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMonths(QuantityValue? months) - { - return months.HasValue ? FromMonths(months.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Months30. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromMonths30(QuantityValue? months30) - { - return months30.HasValue ? FromMonths30(months30.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Nanoseconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromNanoseconds(QuantityValue? nanoseconds) - { - return nanoseconds.HasValue ? FromNanoseconds(nanoseconds.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Seconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromSeconds(QuantityValue? seconds) - { - return seconds.HasValue ? FromSeconds(seconds.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Weeks. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromWeeks(QuantityValue? weeks) - { - return weeks.HasValue ? FromWeeks(weeks.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Years. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromYears(QuantityValue? years) - { - return years.HasValue ? FromYears(years.Value) : default(Duration?); - } - - /// - /// Get nullable Duration from nullable Years365. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Duration? FromYears365(QuantityValue? years365) - { - return years365.HasValue ? FromYears365(years365.Value) : default(Duration?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Duration unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Duration? From(QuantityValue? value, DurationUnit fromUnit) - { - return value.HasValue ? new Duration((double)value.Value, fromUnit) : default(Duration?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 40c15616e8..626a349819 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -60,76 +60,6 @@ public partial struct DynamicViscosity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable DynamicViscosity from nullable Centipoise. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromCentipoise(QuantityValue? centipoise) - { - return centipoise.HasValue ? FromCentipoise(centipoise.Value) : default(DynamicViscosity?); - } - - /// - /// Get nullable DynamicViscosity from nullable MicropascalSeconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromMicropascalSeconds(QuantityValue? micropascalseconds) - { - return micropascalseconds.HasValue ? FromMicropascalSeconds(micropascalseconds.Value) : default(DynamicViscosity?); - } - - /// - /// Get nullable DynamicViscosity from nullable MillipascalSeconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromMillipascalSeconds(QuantityValue? millipascalseconds) - { - return millipascalseconds.HasValue ? FromMillipascalSeconds(millipascalseconds.Value) : default(DynamicViscosity?); - } - - /// - /// Get nullable DynamicViscosity from nullable NewtonSecondsPerMeterSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromNewtonSecondsPerMeterSquared(QuantityValue? newtonsecondspermetersquared) - { - return newtonsecondspermetersquared.HasValue ? FromNewtonSecondsPerMeterSquared(newtonsecondspermetersquared.Value) : default(DynamicViscosity?); - } - - /// - /// Get nullable DynamicViscosity from nullable PascalSeconds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromPascalSeconds(QuantityValue? pascalseconds) - { - return pascalseconds.HasValue ? FromPascalSeconds(pascalseconds.Value) : default(DynamicViscosity?); - } - - /// - /// Get nullable DynamicViscosity from nullable Poise. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static DynamicViscosity? FromPoise(QuantityValue? poise) - { - return poise.HasValue ? FromPoise(poise.Value) : default(DynamicViscosity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// DynamicViscosity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static DynamicViscosity? From(QuantityValue? value, DynamicViscosityUnit fromUnit) - { - return value.HasValue ? new DynamicViscosity((double)value.Value, fromUnit) : default(DynamicViscosity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index d1814b926c..9e9515bb29 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct ElectricAdmittance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricAdmittance from nullable Microsiemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricAdmittance? FromMicrosiemens(QuantityValue? microsiemens) - { - return microsiemens.HasValue ? FromMicrosiemens(microsiemens.Value) : default(ElectricAdmittance?); - } - - /// - /// Get nullable ElectricAdmittance from nullable Millisiemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricAdmittance? FromMillisiemens(QuantityValue? millisiemens) - { - return millisiemens.HasValue ? FromMillisiemens(millisiemens.Value) : default(ElectricAdmittance?); - } - - /// - /// Get nullable ElectricAdmittance from nullable Nanosiemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricAdmittance? FromNanosiemens(QuantityValue? nanosiemens) - { - return nanosiemens.HasValue ? FromNanosiemens(nanosiemens.Value) : default(ElectricAdmittance?); - } - - /// - /// Get nullable ElectricAdmittance from nullable Siemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricAdmittance? FromSiemens(QuantityValue? siemens) - { - return siemens.HasValue ? FromSiemens(siemens.Value) : default(ElectricAdmittance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricAdmittance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricAdmittance? From(QuantityValue? value, ElectricAdmittanceUnit fromUnit) - { - return value.HasValue ? new ElectricAdmittance((double)value.Value, fromUnit) : default(ElectricAdmittance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index de311c02d2..2246311187 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricCharge : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricCharge from nullable Coulombs. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCharge? FromCoulombs(QuantityValue? coulombs) - { - return coulombs.HasValue ? FromCoulombs(coulombs.Value) : default(ElectricCharge?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricCharge unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCharge? From(QuantityValue? value, ElectricChargeUnit fromUnit) - { - return value.HasValue ? new ElectricCharge((double)value.Value, fromUnit) : default(ElectricCharge?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index e5ac919058..b24018a2c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricChargeDensity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricChargeDensity from nullable CoulombsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricChargeDensity? FromCoulombsPerCubicMeter(QuantityValue? coulombspercubicmeter) - { - return coulombspercubicmeter.HasValue ? FromCoulombsPerCubicMeter(coulombspercubicmeter.Value) : default(ElectricChargeDensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricChargeDensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricChargeDensity? From(QuantityValue? value, ElectricChargeDensityUnit fromUnit) - { - return value.HasValue ? new ElectricChargeDensity((double)value.Value, fromUnit) : default(ElectricChargeDensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index c8e5ee97db..0c90e51a46 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct ElectricConductance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricConductance from nullable Microsiemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricConductance? FromMicrosiemens(QuantityValue? microsiemens) - { - return microsiemens.HasValue ? FromMicrosiemens(microsiemens.Value) : default(ElectricConductance?); - } - - /// - /// Get nullable ElectricConductance from nullable Millisiemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricConductance? FromMillisiemens(QuantityValue? millisiemens) - { - return millisiemens.HasValue ? FromMillisiemens(millisiemens.Value) : default(ElectricConductance?); - } - - /// - /// Get nullable ElectricConductance from nullable Siemens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricConductance? FromSiemens(QuantityValue? siemens) - { - return siemens.HasValue ? FromSiemens(siemens.Value) : default(ElectricConductance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricConductance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductance? From(QuantityValue? value, ElectricConductanceUnit fromUnit) - { - return value.HasValue ? new ElectricConductance((double)value.Value, fromUnit) : default(ElectricConductance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d74de9be33..861ada2fe5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricConductivity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricConductivity from nullable SiemensPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricConductivity? FromSiemensPerMeter(QuantityValue? siemenspermeter) - { - return siemenspermeter.HasValue ? FromSiemensPerMeter(siemenspermeter.Value) : default(ElectricConductivity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricConductivity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricConductivity? From(QuantityValue? value, ElectricConductivityUnit fromUnit) - { - return value.HasValue ? new ElectricConductivity((double)value.Value, fromUnit) : default(ElectricConductivity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 0f5858fe1b..911b3ff983 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct ElectricCurrent : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricCurrent from nullable Amperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromAmperes(QuantityValue? amperes) - { - return amperes.HasValue ? FromAmperes(amperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Centiamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromCentiamperes(QuantityValue? centiamperes) - { - return centiamperes.HasValue ? FromCentiamperes(centiamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Kiloamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromKiloamperes(QuantityValue? kiloamperes) - { - return kiloamperes.HasValue ? FromKiloamperes(kiloamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Megaamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromMegaamperes(QuantityValue? megaamperes) - { - return megaamperes.HasValue ? FromMegaamperes(megaamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Microamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromMicroamperes(QuantityValue? microamperes) - { - return microamperes.HasValue ? FromMicroamperes(microamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Milliamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromMilliamperes(QuantityValue? milliamperes) - { - return milliamperes.HasValue ? FromMilliamperes(milliamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Nanoamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromNanoamperes(QuantityValue? nanoamperes) - { - return nanoamperes.HasValue ? FromNanoamperes(nanoamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Get nullable ElectricCurrent from nullable Picoamperes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrent? FromPicoamperes(QuantityValue? picoamperes) - { - return picoamperes.HasValue ? FromPicoamperes(picoamperes.Value) : default(ElectricCurrent?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricCurrent unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrent? From(QuantityValue? value, ElectricCurrentUnit fromUnit) - { - return value.HasValue ? new ElectricCurrent((double)value.Value, fromUnit) : default(ElectricCurrent?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4ac621d58f..4e26f2b295 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricCurrentDensity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricCurrentDensity from nullable AmperesPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrentDensity? FromAmperesPerSquareMeter(QuantityValue? amperespersquaremeter) - { - return amperespersquaremeter.HasValue ? FromAmperesPerSquareMeter(amperespersquaremeter.Value) : default(ElectricCurrentDensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricCurrentDensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrentDensity? From(QuantityValue? value, ElectricCurrentDensityUnit fromUnit) - { - return value.HasValue ? new ElectricCurrentDensity((double)value.Value, fromUnit) : default(ElectricCurrentDensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 1bdea233a1..90cc5d2e3a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricCurrentGradient : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricCurrentGradient from nullable AmperesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricCurrentGradient? FromAmperesPerSecond(QuantityValue? amperespersecond) - { - return amperespersecond.HasValue ? FromAmperesPerSecond(amperespersecond.Value) : default(ElectricCurrentGradient?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricCurrentGradient unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricCurrentGradient? From(QuantityValue? value, ElectricCurrentGradientUnit fromUnit) - { - return value.HasValue ? new ElectricCurrentGradient((double)value.Value, fromUnit) : default(ElectricCurrentGradient?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 5f7b4d55cd..fa4d78c78b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricField : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricField from nullable VoltsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricField? FromVoltsPerMeter(QuantityValue? voltspermeter) - { - return voltspermeter.HasValue ? FromVoltsPerMeter(voltspermeter.Value) : default(ElectricField?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricField unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricField? From(QuantityValue? value, ElectricFieldUnit fromUnit) - { - return value.HasValue ? new ElectricField((double)value.Value, fromUnit) : default(ElectricField?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 8b8e0060e5..885d7d6bd0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct ElectricInductance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricInductance from nullable Henries. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricInductance? FromHenries(QuantityValue? henries) - { - return henries.HasValue ? FromHenries(henries.Value) : default(ElectricInductance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricInductance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricInductance? From(QuantityValue? value, ElectricInductanceUnit fromUnit) - { - return value.HasValue ? new ElectricInductance((double)value.Value, fromUnit) : default(ElectricInductance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index f9cebf55a4..0741dbc127 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -60,67 +60,6 @@ public partial struct ElectricPotential : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricPotential from nullable Kilovolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotential? FromKilovolts(QuantityValue? kilovolts) - { - return kilovolts.HasValue ? FromKilovolts(kilovolts.Value) : default(ElectricPotential?); - } - - /// - /// Get nullable ElectricPotential from nullable Megavolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotential? FromMegavolts(QuantityValue? megavolts) - { - return megavolts.HasValue ? FromMegavolts(megavolts.Value) : default(ElectricPotential?); - } - - /// - /// Get nullable ElectricPotential from nullable Microvolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotential? FromMicrovolts(QuantityValue? microvolts) - { - return microvolts.HasValue ? FromMicrovolts(microvolts.Value) : default(ElectricPotential?); - } - - /// - /// Get nullable ElectricPotential from nullable Millivolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotential? FromMillivolts(QuantityValue? millivolts) - { - return millivolts.HasValue ? FromMillivolts(millivolts.Value) : default(ElectricPotential?); - } - - /// - /// Get nullable ElectricPotential from nullable Volts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotential? FromVolts(QuantityValue? volts) - { - return volts.HasValue ? FromVolts(volts.Value) : default(ElectricPotential?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricPotential unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotential? From(QuantityValue? value, ElectricPotentialUnit fromUnit) - { - return value.HasValue ? new ElectricPotential((double)value.Value, fromUnit) : default(ElectricPotential?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index f3df5f0762..6174e002db 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -60,67 +60,6 @@ public partial struct ElectricPotentialAc : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricPotentialAc from nullable KilovoltsAc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialAc? FromKilovoltsAc(QuantityValue? kilovoltsac) - { - return kilovoltsac.HasValue ? FromKilovoltsAc(kilovoltsac.Value) : default(ElectricPotentialAc?); - } - - /// - /// Get nullable ElectricPotentialAc from nullable MegavoltsAc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialAc? FromMegavoltsAc(QuantityValue? megavoltsac) - { - return megavoltsac.HasValue ? FromMegavoltsAc(megavoltsac.Value) : default(ElectricPotentialAc?); - } - - /// - /// Get nullable ElectricPotentialAc from nullable MicrovoltsAc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialAc? FromMicrovoltsAc(QuantityValue? microvoltsac) - { - return microvoltsac.HasValue ? FromMicrovoltsAc(microvoltsac.Value) : default(ElectricPotentialAc?); - } - - /// - /// Get nullable ElectricPotentialAc from nullable MillivoltsAc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialAc? FromMillivoltsAc(QuantityValue? millivoltsac) - { - return millivoltsac.HasValue ? FromMillivoltsAc(millivoltsac.Value) : default(ElectricPotentialAc?); - } - - /// - /// Get nullable ElectricPotentialAc from nullable VoltsAc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialAc? FromVoltsAc(QuantityValue? voltsac) - { - return voltsac.HasValue ? FromVoltsAc(voltsac.Value) : default(ElectricPotentialAc?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricPotentialAc unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialAc? From(QuantityValue? value, ElectricPotentialAcUnit fromUnit) - { - return value.HasValue ? new ElectricPotentialAc((double)value.Value, fromUnit) : default(ElectricPotentialAc?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index ea6f85c7ae..350e476513 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -60,67 +60,6 @@ public partial struct ElectricPotentialDc : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricPotentialDc from nullable KilovoltsDc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialDc? FromKilovoltsDc(QuantityValue? kilovoltsdc) - { - return kilovoltsdc.HasValue ? FromKilovoltsDc(kilovoltsdc.Value) : default(ElectricPotentialDc?); - } - - /// - /// Get nullable ElectricPotentialDc from nullable MegavoltsDc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialDc? FromMegavoltsDc(QuantityValue? megavoltsdc) - { - return megavoltsdc.HasValue ? FromMegavoltsDc(megavoltsdc.Value) : default(ElectricPotentialDc?); - } - - /// - /// Get nullable ElectricPotentialDc from nullable MicrovoltsDc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialDc? FromMicrovoltsDc(QuantityValue? microvoltsdc) - { - return microvoltsdc.HasValue ? FromMicrovoltsDc(microvoltsdc.Value) : default(ElectricPotentialDc?); - } - - /// - /// Get nullable ElectricPotentialDc from nullable MillivoltsDc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialDc? FromMillivoltsDc(QuantityValue? millivoltsdc) - { - return millivoltsdc.HasValue ? FromMillivoltsDc(millivoltsdc.Value) : default(ElectricPotentialDc?); - } - - /// - /// Get nullable ElectricPotentialDc from nullable VoltsDc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricPotentialDc? FromVoltsDc(QuantityValue? voltsdc) - { - return voltsdc.HasValue ? FromVoltsDc(voltsdc.Value) : default(ElectricPotentialDc?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricPotentialDc unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricPotentialDc? From(QuantityValue? value, ElectricPotentialDcUnit fromUnit) - { - return value.HasValue ? new ElectricPotentialDc((double)value.Value, fromUnit) : default(ElectricPotentialDc?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index df944cce7a..74eee349ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct ElectricResistance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricResistance from nullable Kiloohms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistance? FromKiloohms(QuantityValue? kiloohms) - { - return kiloohms.HasValue ? FromKiloohms(kiloohms.Value) : default(ElectricResistance?); - } - - /// - /// Get nullable ElectricResistance from nullable Megaohms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistance? FromMegaohms(QuantityValue? megaohms) - { - return megaohms.HasValue ? FromMegaohms(megaohms.Value) : default(ElectricResistance?); - } - - /// - /// Get nullable ElectricResistance from nullable Milliohms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistance? FromMilliohms(QuantityValue? milliohms) - { - return milliohms.HasValue ? FromMilliohms(milliohms.Value) : default(ElectricResistance?); - } - - /// - /// Get nullable ElectricResistance from nullable Ohms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistance? FromOhms(QuantityValue? ohms) - { - return ohms.HasValue ? FromOhms(ohms.Value) : default(ElectricResistance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricResistance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistance? From(QuantityValue? value, ElectricResistanceUnit fromUnit) - { - return value.HasValue ? new ElectricResistance((double)value.Value, fromUnit) : default(ElectricResistance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index e909be0ec1..31620023e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct ElectricResistivity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ElectricResistivity from nullable MicroohmMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistivity? FromMicroohmMeters(QuantityValue? microohmmeters) - { - return microohmmeters.HasValue ? FromMicroohmMeters(microohmmeters.Value) : default(ElectricResistivity?); - } - - /// - /// Get nullable ElectricResistivity from nullable MilliohmMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistivity? FromMilliohmMeters(QuantityValue? milliohmmeters) - { - return milliohmmeters.HasValue ? FromMilliohmMeters(milliohmmeters.Value) : default(ElectricResistivity?); - } - - /// - /// Get nullable ElectricResistivity from nullable NanoohmMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistivity? FromNanoohmMeters(QuantityValue? nanoohmmeters) - { - return nanoohmmeters.HasValue ? FromNanoohmMeters(nanoohmmeters.Value) : default(ElectricResistivity?); - } - - /// - /// Get nullable ElectricResistivity from nullable OhmMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ElectricResistivity? FromOhmMeters(QuantityValue? ohmmeters) - { - return ohmmeters.HasValue ? FromOhmMeters(ohmmeters.Value) : default(ElectricResistivity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ElectricResistivity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ElectricResistivity? From(QuantityValue? value, ElectricResistivityUnit fromUnit) - { - return value.HasValue ? new ElectricResistivity((double)value.Value, fromUnit) : default(ElectricResistivity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 0aab5ee9a9..9d9a53ede1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -60,220 +60,6 @@ public partial struct Energy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Energy from nullable BritishThermalUnits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromBritishThermalUnits(QuantityValue? britishthermalunits) - { - return britishthermalunits.HasValue ? FromBritishThermalUnits(britishthermalunits.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Calories. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromCalories(QuantityValue? calories) - { - return calories.HasValue ? FromCalories(calories.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable DecathermsEc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromDecathermsEc(QuantityValue? decathermsec) - { - return decathermsec.HasValue ? FromDecathermsEc(decathermsec.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable DecathermsImperial. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromDecathermsImperial(QuantityValue? decathermsimperial) - { - return decathermsimperial.HasValue ? FromDecathermsImperial(decathermsimperial.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable DecathermsUs. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromDecathermsUs(QuantityValue? decathermsus) - { - return decathermsus.HasValue ? FromDecathermsUs(decathermsus.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable ElectronVolts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromElectronVolts(QuantityValue? electronvolts) - { - return electronvolts.HasValue ? FromElectronVolts(electronvolts.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Ergs. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromErgs(QuantityValue? ergs) - { - return ergs.HasValue ? FromErgs(ergs.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable FootPounds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromFootPounds(QuantityValue? footpounds) - { - return footpounds.HasValue ? FromFootPounds(footpounds.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable GigabritishThermalUnits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromGigabritishThermalUnits(QuantityValue? gigabritishthermalunits) - { - return gigabritishthermalunits.HasValue ? FromGigabritishThermalUnits(gigabritishthermalunits.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable GigawattHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromGigawattHours(QuantityValue? gigawatthours) - { - return gigawatthours.HasValue ? FromGigawattHours(gigawatthours.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Joules. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromJoules(QuantityValue? joules) - { - return joules.HasValue ? FromJoules(joules.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable KilobritishThermalUnits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromKilobritishThermalUnits(QuantityValue? kilobritishthermalunits) - { - return kilobritishthermalunits.HasValue ? FromKilobritishThermalUnits(kilobritishthermalunits.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Kilocalories. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromKilocalories(QuantityValue? kilocalories) - { - return kilocalories.HasValue ? FromKilocalories(kilocalories.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Kilojoules. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromKilojoules(QuantityValue? kilojoules) - { - return kilojoules.HasValue ? FromKilojoules(kilojoules.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable KilowattHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromKilowattHours(QuantityValue? kilowatthours) - { - return kilowatthours.HasValue ? FromKilowattHours(kilowatthours.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable MegabritishThermalUnits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromMegabritishThermalUnits(QuantityValue? megabritishthermalunits) - { - return megabritishthermalunits.HasValue ? FromMegabritishThermalUnits(megabritishthermalunits.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable Megajoules. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromMegajoules(QuantityValue? megajoules) - { - return megajoules.HasValue ? FromMegajoules(megajoules.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable MegawattHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromMegawattHours(QuantityValue? megawatthours) - { - return megawatthours.HasValue ? FromMegawattHours(megawatthours.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable ThermsEc. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromThermsEc(QuantityValue? thermsec) - { - return thermsec.HasValue ? FromThermsEc(thermsec.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable ThermsImperial. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromThermsImperial(QuantityValue? thermsimperial) - { - return thermsimperial.HasValue ? FromThermsImperial(thermsimperial.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable ThermsUs. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromThermsUs(QuantityValue? thermsus) - { - return thermsus.HasValue ? FromThermsUs(thermsus.Value) : default(Energy?); - } - - /// - /// Get nullable Energy from nullable WattHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Energy? FromWattHours(QuantityValue? watthours) - { - return watthours.HasValue ? FromWattHours(watthours.Value) : default(Energy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Energy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Energy? From(QuantityValue? value, EnergyUnit fromUnit) - { - return value.HasValue ? new Energy((double)value.Value, fromUnit) : default(Energy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 1e174a2486..7282579bf1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -60,85 +60,6 @@ public partial struct Entropy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Entropy from nullable CaloriesPerKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromCaloriesPerKelvin(QuantityValue? caloriesperkelvin) - { - return caloriesperkelvin.HasValue ? FromCaloriesPerKelvin(caloriesperkelvin.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable JoulesPerDegreeCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromJoulesPerDegreeCelsius(QuantityValue? joulesperdegreecelsius) - { - return joulesperdegreecelsius.HasValue ? FromJoulesPerDegreeCelsius(joulesperdegreecelsius.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable JoulesPerKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromJoulesPerKelvin(QuantityValue? joulesperkelvin) - { - return joulesperkelvin.HasValue ? FromJoulesPerKelvin(joulesperkelvin.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable KilocaloriesPerKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromKilocaloriesPerKelvin(QuantityValue? kilocaloriesperkelvin) - { - return kilocaloriesperkelvin.HasValue ? FromKilocaloriesPerKelvin(kilocaloriesperkelvin.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable KilojoulesPerDegreeCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromKilojoulesPerDegreeCelsius(QuantityValue? kilojoulesperdegreecelsius) - { - return kilojoulesperdegreecelsius.HasValue ? FromKilojoulesPerDegreeCelsius(kilojoulesperdegreecelsius.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable KilojoulesPerKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromKilojoulesPerKelvin(QuantityValue? kilojoulesperkelvin) - { - return kilojoulesperkelvin.HasValue ? FromKilojoulesPerKelvin(kilojoulesperkelvin.Value) : default(Entropy?); - } - - /// - /// Get nullable Entropy from nullable MegajoulesPerKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Entropy? FromMegajoulesPerKelvin(QuantityValue? megajoulesperkelvin) - { - return megajoulesperkelvin.HasValue ? FromMegajoulesPerKelvin(megajoulesperkelvin.Value) : default(Entropy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Entropy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Entropy? From(QuantityValue? value, EntropyUnit fromUnit) - { - return value.HasValue ? new Entropy((double)value.Value, fromUnit) : default(Entropy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs index 1530fa6888..8897b2b55b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs @@ -60,238 +60,6 @@ public partial struct Flow : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Flow from nullable CentilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCentilitersPerMinute(QuantityValue? centilitersperminute) - { - return centilitersperminute.HasValue ? FromCentilitersPerMinute(centilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicDecimetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicDecimetersPerMinute(QuantityValue? cubicdecimetersperminute) - { - return cubicdecimetersperminute.HasValue ? FromCubicDecimetersPerMinute(cubicdecimetersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerHour(QuantityValue? cubicfeetperhour) - { - return cubicfeetperhour.HasValue ? FromCubicFeetPerHour(cubicfeetperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerMinute(QuantityValue? cubicfeetperminute) - { - return cubicfeetperminute.HasValue ? FromCubicFeetPerMinute(cubicfeetperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicFeetPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicFeetPerSecond(QuantityValue? cubicfeetpersecond) - { - return cubicfeetpersecond.HasValue ? FromCubicFeetPerSecond(cubicfeetpersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerHour(QuantityValue? cubicmetersperhour) - { - return cubicmetersperhour.HasValue ? FromCubicMetersPerHour(cubicmetersperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerMinute(QuantityValue? cubicmetersperminute) - { - return cubicmetersperminute.HasValue ? FromCubicMetersPerMinute(cubicmetersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicMetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicMetersPerSecond(QuantityValue? cubicmeterspersecond) - { - return cubicmeterspersecond.HasValue ? FromCubicMetersPerSecond(cubicmeterspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerHour(QuantityValue? cubicyardsperhour) - { - return cubicyardsperhour.HasValue ? FromCubicYardsPerHour(cubicyardsperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerMinute(QuantityValue? cubicyardsperminute) - { - return cubicyardsperminute.HasValue ? FromCubicYardsPerMinute(cubicyardsperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable CubicYardsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromCubicYardsPerSecond(QuantityValue? cubicyardspersecond) - { - return cubicyardspersecond.HasValue ? FromCubicYardsPerSecond(cubicyardspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable DecilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromDecilitersPerMinute(QuantityValue? decilitersperminute) - { - return decilitersperminute.HasValue ? FromDecilitersPerMinute(decilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable KilolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromKilolitersPerMinute(QuantityValue? kilolitersperminute) - { - return kilolitersperminute.HasValue ? FromKilolitersPerMinute(kilolitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerHour(QuantityValue? litersperhour) - { - return litersperhour.HasValue ? FromLitersPerHour(litersperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerMinute(QuantityValue? litersperminute) - { - return litersperminute.HasValue ? FromLitersPerMinute(litersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable LitersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromLitersPerSecond(QuantityValue? literspersecond) - { - return literspersecond.HasValue ? FromLitersPerSecond(literspersecond.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MicrolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMicrolitersPerMinute(QuantityValue? microlitersperminute) - { - return microlitersperminute.HasValue ? FromMicrolitersPerMinute(microlitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MillilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMillilitersPerMinute(QuantityValue? millilitersperminute) - { - return millilitersperminute.HasValue ? FromMillilitersPerMinute(millilitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable MillionUsGallonsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromMillionUsGallonsPerDay(QuantityValue? millionusgallonsperday) - { - return millionusgallonsperday.HasValue ? FromMillionUsGallonsPerDay(millionusgallonsperday.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable NanolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromNanolitersPerMinute(QuantityValue? nanolitersperminute) - { - return nanolitersperminute.HasValue ? FromNanolitersPerMinute(nanolitersperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable OilBarrelsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromOilBarrelsPerDay(QuantityValue? oilbarrelsperday) - { - return oilbarrelsperday.HasValue ? FromOilBarrelsPerDay(oilbarrelsperday.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerHour(QuantityValue? usgallonsperhour) - { - return usgallonsperhour.HasValue ? FromUsGallonsPerHour(usgallonsperhour.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerMinute(QuantityValue? usgallonsperminute) - { - return usgallonsperminute.HasValue ? FromUsGallonsPerMinute(usgallonsperminute.Value) : default(Flow?); - } - - /// - /// Get nullable Flow from nullable UsGallonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Flow? FromUsGallonsPerSecond(QuantityValue? usgallonspersecond) - { - return usgallonspersecond.HasValue ? FromUsGallonsPerSecond(usgallonspersecond.Value) : default(Flow?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Flow unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Flow? From(QuantityValue? value, FlowUnit fromUnit) - { - return value.HasValue ? new Flow((double)value.Value, fromUnit) : default(Flow?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index d741260a28..65ab1b6f08 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -60,112 +60,6 @@ public partial struct Force : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Force from nullable Decanewtons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromDecanewtons(QuantityValue? decanewtons) - { - return decanewtons.HasValue ? FromDecanewtons(decanewtons.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable Dyne. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromDyne(QuantityValue? dyne) - { - return dyne.HasValue ? FromDyne(dyne.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable KilogramsForce. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromKilogramsForce(QuantityValue? kilogramsforce) - { - return kilogramsforce.HasValue ? FromKilogramsForce(kilogramsforce.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable Kilonewtons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromKilonewtons(QuantityValue? kilonewtons) - { - return kilonewtons.HasValue ? FromKilonewtons(kilonewtons.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable KiloPonds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromKiloPonds(QuantityValue? kiloponds) - { - return kiloponds.HasValue ? FromKiloPonds(kiloponds.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable Meganewtons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromMeganewtons(QuantityValue? meganewtons) - { - return meganewtons.HasValue ? FromMeganewtons(meganewtons.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable Newtons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromNewtons(QuantityValue? newtons) - { - return newtons.HasValue ? FromNewtons(newtons.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable Poundals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromPoundals(QuantityValue? poundals) - { - return poundals.HasValue ? FromPoundals(poundals.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable PoundsForce. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromPoundsForce(QuantityValue? poundsforce) - { - return poundsforce.HasValue ? FromPoundsForce(poundsforce.Value) : default(Force?); - } - - /// - /// Get nullable Force from nullable TonnesForce. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Force? FromTonnesForce(QuantityValue? tonnesforce) - { - return tonnesforce.HasValue ? FromTonnesForce(tonnesforce.Value) : default(Force?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Force unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Force? From(QuantityValue? value, ForceUnit fromUnit) - { - return value.HasValue ? new Force((double)value.Value, fromUnit) : default(Force?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 1c5ec27ce0..e49d08d2f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -60,121 +60,6 @@ public partial struct ForceChangeRate : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ForceChangeRate from nullable CentinewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromCentinewtonsPerSecond(QuantityValue? centinewtonspersecond) - { - return centinewtonspersecond.HasValue ? FromCentinewtonsPerSecond(centinewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable DecanewtonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromDecanewtonsPerMinute(QuantityValue? decanewtonsperminute) - { - return decanewtonsperminute.HasValue ? FromDecanewtonsPerMinute(decanewtonsperminute.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable DecanewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromDecanewtonsPerSecond(QuantityValue? decanewtonspersecond) - { - return decanewtonspersecond.HasValue ? FromDecanewtonsPerSecond(decanewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable DecinewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromDecinewtonsPerSecond(QuantityValue? decinewtonspersecond) - { - return decinewtonspersecond.HasValue ? FromDecinewtonsPerSecond(decinewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable KilonewtonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromKilonewtonsPerMinute(QuantityValue? kilonewtonsperminute) - { - return kilonewtonsperminute.HasValue ? FromKilonewtonsPerMinute(kilonewtonsperminute.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable KilonewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromKilonewtonsPerSecond(QuantityValue? kilonewtonspersecond) - { - return kilonewtonspersecond.HasValue ? FromKilonewtonsPerSecond(kilonewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable MicronewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromMicronewtonsPerSecond(QuantityValue? micronewtonspersecond) - { - return micronewtonspersecond.HasValue ? FromMicronewtonsPerSecond(micronewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable MillinewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromMillinewtonsPerSecond(QuantityValue? millinewtonspersecond) - { - return millinewtonspersecond.HasValue ? FromMillinewtonsPerSecond(millinewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable NanonewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromNanonewtonsPerSecond(QuantityValue? nanonewtonspersecond) - { - return nanonewtonspersecond.HasValue ? FromNanonewtonsPerSecond(nanonewtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable NewtonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromNewtonsPerMinute(QuantityValue? newtonsperminute) - { - return newtonsperminute.HasValue ? FromNewtonsPerMinute(newtonsperminute.Value) : default(ForceChangeRate?); - } - - /// - /// Get nullable ForceChangeRate from nullable NewtonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForceChangeRate? FromNewtonsPerSecond(QuantityValue? newtonspersecond) - { - return newtonspersecond.HasValue ? FromNewtonsPerSecond(newtonspersecond.Value) : default(ForceChangeRate?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ForceChangeRate unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForceChangeRate? From(QuantityValue? value, ForceChangeRateUnit fromUnit) - { - return value.HasValue ? new ForceChangeRate((double)value.Value, fromUnit) : default(ForceChangeRate?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index a221b700b4..f66b0a5074 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -60,103 +60,6 @@ public partial struct ForcePerLength : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ForcePerLength from nullable CentinewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromCentinewtonsPerMeter(QuantityValue? centinewtonspermeter) - { - return centinewtonspermeter.HasValue ? FromCentinewtonsPerMeter(centinewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable DecinewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromDecinewtonsPerMeter(QuantityValue? decinewtonspermeter) - { - return decinewtonspermeter.HasValue ? FromDecinewtonsPerMeter(decinewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable KilogramsForcePerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromKilogramsForcePerMeter(QuantityValue? kilogramsforcepermeter) - { - return kilogramsforcepermeter.HasValue ? FromKilogramsForcePerMeter(kilogramsforcepermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable KilonewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromKilonewtonsPerMeter(QuantityValue? kilonewtonspermeter) - { - return kilonewtonspermeter.HasValue ? FromKilonewtonsPerMeter(kilonewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable MeganewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromMeganewtonsPerMeter(QuantityValue? meganewtonspermeter) - { - return meganewtonspermeter.HasValue ? FromMeganewtonsPerMeter(meganewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable MicronewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromMicronewtonsPerMeter(QuantityValue? micronewtonspermeter) - { - return micronewtonspermeter.HasValue ? FromMicronewtonsPerMeter(micronewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable MillinewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromMillinewtonsPerMeter(QuantityValue? millinewtonspermeter) - { - return millinewtonspermeter.HasValue ? FromMillinewtonsPerMeter(millinewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable NanonewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromNanonewtonsPerMeter(QuantityValue? nanonewtonspermeter) - { - return nanonewtonspermeter.HasValue ? FromNanonewtonsPerMeter(nanonewtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Get nullable ForcePerLength from nullable NewtonsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ForcePerLength? FromNewtonsPerMeter(QuantityValue? newtonspermeter) - { - return newtonspermeter.HasValue ? FromNewtonsPerMeter(newtonspermeter.Value) : default(ForcePerLength?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ForcePerLength unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ForcePerLength? From(QuantityValue? value, ForcePerLengthUnit fromUnit) - { - return value.HasValue ? new ForcePerLength((double)value.Value, fromUnit) : default(ForcePerLength?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 649b2a2c52..4ad34d9423 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct Frequency : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Frequency from nullable CyclesPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromCyclesPerHour(QuantityValue? cyclesperhour) - { - return cyclesperhour.HasValue ? FromCyclesPerHour(cyclesperhour.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable CyclesPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromCyclesPerMinute(QuantityValue? cyclesperminute) - { - return cyclesperminute.HasValue ? FromCyclesPerMinute(cyclesperminute.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable Gigahertz. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromGigahertz(QuantityValue? gigahertz) - { - return gigahertz.HasValue ? FromGigahertz(gigahertz.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable Hertz. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromHertz(QuantityValue? hertz) - { - return hertz.HasValue ? FromHertz(hertz.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable Kilohertz. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromKilohertz(QuantityValue? kilohertz) - { - return kilohertz.HasValue ? FromKilohertz(kilohertz.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable Megahertz. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromMegahertz(QuantityValue? megahertz) - { - return megahertz.HasValue ? FromMegahertz(megahertz.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable RadiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromRadiansPerSecond(QuantityValue? radianspersecond) - { - return radianspersecond.HasValue ? FromRadiansPerSecond(radianspersecond.Value) : default(Frequency?); - } - - /// - /// Get nullable Frequency from nullable Terahertz. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Frequency? FromTerahertz(QuantityValue? terahertz) - { - return terahertz.HasValue ? FromTerahertz(terahertz.Value) : default(Frequency?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Frequency unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Frequency? From(QuantityValue? value, FrequencyUnit fromUnit) - { - return value.HasValue ? new Frequency((double)value.Value, fromUnit) : default(Frequency?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 3e1fdde1d7..2a82f5a9fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -60,166 +60,6 @@ public partial struct HeatFlux : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable HeatFlux from nullable BtusPerHourSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromBtusPerHourSquareFoot(QuantityValue? btusperhoursquarefoot) - { - return btusperhoursquarefoot.HasValue ? FromBtusPerHourSquareFoot(btusperhoursquarefoot.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable BtusPerMinuteSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromBtusPerMinuteSquareFoot(QuantityValue? btusperminutesquarefoot) - { - return btusperminutesquarefoot.HasValue ? FromBtusPerMinuteSquareFoot(btusperminutesquarefoot.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable BtusPerSecondSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromBtusPerSecondSquareFoot(QuantityValue? btuspersecondsquarefoot) - { - return btuspersecondsquarefoot.HasValue ? FromBtusPerSecondSquareFoot(btuspersecondsquarefoot.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable BtusPerSecondSquareInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromBtusPerSecondSquareInch(QuantityValue? btuspersecondsquareinch) - { - return btuspersecondsquareinch.HasValue ? FromBtusPerSecondSquareInch(btuspersecondsquareinch.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable CaloriesPerSecondSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromCaloriesPerSecondSquareCentimeter(QuantityValue? caloriespersecondsquarecentimeter) - { - return caloriespersecondsquarecentimeter.HasValue ? FromCaloriesPerSecondSquareCentimeter(caloriespersecondsquarecentimeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable CentiwattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromCentiwattsPerSquareMeter(QuantityValue? centiwattspersquaremeter) - { - return centiwattspersquaremeter.HasValue ? FromCentiwattsPerSquareMeter(centiwattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable DeciwattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromDeciwattsPerSquareMeter(QuantityValue? deciwattspersquaremeter) - { - return deciwattspersquaremeter.HasValue ? FromDeciwattsPerSquareMeter(deciwattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable KilocaloriesPerHourSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromKilocaloriesPerHourSquareMeter(QuantityValue? kilocaloriesperhoursquaremeter) - { - return kilocaloriesperhoursquaremeter.HasValue ? FromKilocaloriesPerHourSquareMeter(kilocaloriesperhoursquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable KilocaloriesPerSecondSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromKilocaloriesPerSecondSquareCentimeter(QuantityValue? kilocaloriespersecondsquarecentimeter) - { - return kilocaloriespersecondsquarecentimeter.HasValue ? FromKilocaloriesPerSecondSquareCentimeter(kilocaloriespersecondsquarecentimeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable KilowattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromKilowattsPerSquareMeter(QuantityValue? kilowattspersquaremeter) - { - return kilowattspersquaremeter.HasValue ? FromKilowattsPerSquareMeter(kilowattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable MicrowattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromMicrowattsPerSquareMeter(QuantityValue? microwattspersquaremeter) - { - return microwattspersquaremeter.HasValue ? FromMicrowattsPerSquareMeter(microwattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable MilliwattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromMilliwattsPerSquareMeter(QuantityValue? milliwattspersquaremeter) - { - return milliwattspersquaremeter.HasValue ? FromMilliwattsPerSquareMeter(milliwattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable NanowattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromNanowattsPerSquareMeter(QuantityValue? nanowattspersquaremeter) - { - return nanowattspersquaremeter.HasValue ? FromNanowattsPerSquareMeter(nanowattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable WattsPerSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromWattsPerSquareFoot(QuantityValue? wattspersquarefoot) - { - return wattspersquarefoot.HasValue ? FromWattsPerSquareFoot(wattspersquarefoot.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable WattsPerSquareInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromWattsPerSquareInch(QuantityValue? wattspersquareinch) - { - return wattspersquareinch.HasValue ? FromWattsPerSquareInch(wattspersquareinch.Value) : default(HeatFlux?); - } - - /// - /// Get nullable HeatFlux from nullable WattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatFlux? FromWattsPerSquareMeter(QuantityValue? wattspersquaremeter) - { - return wattspersquaremeter.HasValue ? FromWattsPerSquareMeter(wattspersquaremeter.Value) : default(HeatFlux?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// HeatFlux unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatFlux? From(QuantityValue? value, HeatFluxUnit fromUnit) - { - return value.HasValue ? new HeatFlux((double)value.Value, fromUnit) : default(HeatFlux?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index cf0bf1e253..6cc6e0df4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct HeatTransferCoefficient : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable HeatTransferCoefficient from nullable WattsPerSquareMeterCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatTransferCoefficient? FromWattsPerSquareMeterCelsius(QuantityValue? wattspersquaremetercelsius) - { - return wattspersquaremetercelsius.HasValue ? FromWattsPerSquareMeterCelsius(wattspersquaremetercelsius.Value) : default(HeatTransferCoefficient?); - } - - /// - /// Get nullable HeatTransferCoefficient from nullable WattsPerSquareMeterKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static HeatTransferCoefficient? FromWattsPerSquareMeterKelvin(QuantityValue? wattspersquaremeterkelvin) - { - return wattspersquaremeterkelvin.HasValue ? FromWattsPerSquareMeterKelvin(wattspersquaremeterkelvin.Value) : default(HeatTransferCoefficient?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// HeatTransferCoefficient unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static HeatTransferCoefficient? From(QuantityValue? value, HeatTransferCoefficientUnit fromUnit) - { - return value.HasValue ? new HeatTransferCoefficient((double)value.Value, fromUnit) : default(HeatTransferCoefficient?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 16e9931409..e5b116ca55 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct Illuminance : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Illuminance from nullable Kilolux. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Illuminance? FromKilolux(QuantityValue? kilolux) - { - return kilolux.HasValue ? FromKilolux(kilolux.Value) : default(Illuminance?); - } - - /// - /// Get nullable Illuminance from nullable Lux. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Illuminance? FromLux(QuantityValue? lux) - { - return lux.HasValue ? FromLux(lux.Value) : default(Illuminance?); - } - - /// - /// Get nullable Illuminance from nullable Megalux. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Illuminance? FromMegalux(QuantityValue? megalux) - { - return megalux.HasValue ? FromMegalux(megalux.Value) : default(Illuminance?); - } - - /// - /// Get nullable Illuminance from nullable Millilux. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Illuminance? FromMillilux(QuantityValue? millilux) - { - return millilux.HasValue ? FromMillilux(millilux.Value) : default(Illuminance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Illuminance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Illuminance? From(QuantityValue? value, IlluminanceUnit fromUnit) - { - return value.HasValue ? new Illuminance((double)value.Value, fromUnit) : default(Illuminance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index bf562afe24..6415a8dd75 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -60,256 +60,6 @@ public partial struct Information : IComparable, IComparable ///
public decimal Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Information from nullable Bits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromBits(QuantityValue? bits) - { - return bits.HasValue ? FromBits(bits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Bytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromBytes(QuantityValue? bytes) - { - return bytes.HasValue ? FromBytes(bytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Exabits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromExabits(QuantityValue? exabits) - { - return exabits.HasValue ? FromExabits(exabits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Exabytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromExabytes(QuantityValue? exabytes) - { - return exabytes.HasValue ? FromExabytes(exabytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Exbibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromExbibits(QuantityValue? exbibits) - { - return exbibits.HasValue ? FromExbibits(exbibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Exbibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromExbibytes(QuantityValue? exbibytes) - { - return exbibytes.HasValue ? FromExbibytes(exbibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Gibibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromGibibits(QuantityValue? gibibits) - { - return gibibits.HasValue ? FromGibibits(gibibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Gibibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromGibibytes(QuantityValue? gibibytes) - { - return gibibytes.HasValue ? FromGibibytes(gibibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Gigabits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromGigabits(QuantityValue? gigabits) - { - return gigabits.HasValue ? FromGigabits(gigabits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Gigabytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromGigabytes(QuantityValue? gigabytes) - { - return gigabytes.HasValue ? FromGigabytes(gigabytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Kibibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromKibibits(QuantityValue? kibibits) - { - return kibibits.HasValue ? FromKibibits(kibibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Kibibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromKibibytes(QuantityValue? kibibytes) - { - return kibibytes.HasValue ? FromKibibytes(kibibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Kilobits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromKilobits(QuantityValue? kilobits) - { - return kilobits.HasValue ? FromKilobits(kilobits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Kilobytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromKilobytes(QuantityValue? kilobytes) - { - return kilobytes.HasValue ? FromKilobytes(kilobytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Mebibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromMebibits(QuantityValue? mebibits) - { - return mebibits.HasValue ? FromMebibits(mebibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Mebibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromMebibytes(QuantityValue? mebibytes) - { - return mebibytes.HasValue ? FromMebibytes(mebibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Megabits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromMegabits(QuantityValue? megabits) - { - return megabits.HasValue ? FromMegabits(megabits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Megabytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromMegabytes(QuantityValue? megabytes) - { - return megabytes.HasValue ? FromMegabytes(megabytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Pebibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromPebibits(QuantityValue? pebibits) - { - return pebibits.HasValue ? FromPebibits(pebibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Pebibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromPebibytes(QuantityValue? pebibytes) - { - return pebibytes.HasValue ? FromPebibytes(pebibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Petabits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromPetabits(QuantityValue? petabits) - { - return petabits.HasValue ? FromPetabits(petabits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Petabytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromPetabytes(QuantityValue? petabytes) - { - return petabytes.HasValue ? FromPetabytes(petabytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Tebibits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromTebibits(QuantityValue? tebibits) - { - return tebibits.HasValue ? FromTebibits(tebibits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Tebibytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromTebibytes(QuantityValue? tebibytes) - { - return tebibytes.HasValue ? FromTebibytes(tebibytes.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Terabits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromTerabits(QuantityValue? terabits) - { - return terabits.HasValue ? FromTerabits(terabits.Value) : default(Information?); - } - - /// - /// Get nullable Information from nullable Terabytes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Information? FromTerabytes(QuantityValue? terabytes) - { - return terabytes.HasValue ? FromTerabytes(terabytes.Value) : default(Information?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Information unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Information? From(QuantityValue? value, InformationUnit fromUnit) - { - return value.HasValue ? new Information((decimal)value.Value, fromUnit) : default(Information?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 8a1ef1ab60..839760f5d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct Irradiance : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Irradiance from nullable KilowattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Irradiance? FromKilowattsPerSquareMeter(QuantityValue? kilowattspersquaremeter) - { - return kilowattspersquaremeter.HasValue ? FromKilowattsPerSquareMeter(kilowattspersquaremeter.Value) : default(Irradiance?); - } - - /// - /// Get nullable Irradiance from nullable WattsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Irradiance? FromWattsPerSquareMeter(QuantityValue? wattspersquaremeter) - { - return wattspersquaremeter.HasValue ? FromWattsPerSquareMeter(wattspersquaremeter.Value) : default(Irradiance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Irradiance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiance? From(QuantityValue? value, IrradianceUnit fromUnit) - { - return value.HasValue ? new Irradiance((double)value.Value, fromUnit) : default(Irradiance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 486da8cd88..3f816711ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct Irradiation : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Irradiation from nullable JoulesPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Irradiation? FromJoulesPerSquareMeter(QuantityValue? joulespersquaremeter) - { - return joulespersquaremeter.HasValue ? FromJoulesPerSquareMeter(joulespersquaremeter.Value) : default(Irradiation?); - } - - /// - /// Get nullable Irradiation from nullable KilowattHoursPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Irradiation? FromKilowattHoursPerSquareMeter(QuantityValue? kilowatthourspersquaremeter) - { - return kilowatthourspersquaremeter.HasValue ? FromKilowattHoursPerSquareMeter(kilowatthourspersquaremeter.Value) : default(Irradiation?); - } - - /// - /// Get nullable Irradiation from nullable WattHoursPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Irradiation? FromWattHoursPerSquareMeter(QuantityValue? watthourspersquaremeter) - { - return watthourspersquaremeter.HasValue ? FromWattHoursPerSquareMeter(watthourspersquaremeter.Value) : default(Irradiation?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Irradiation unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Irradiation? From(QuantityValue? value, IrradiationUnit fromUnit) - { - return value.HasValue ? new Irradiation((double)value.Value, fromUnit) : default(Irradiation?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index c9d49d1d19..0e8f501790 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct KinematicViscosity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable KinematicViscosity from nullable Centistokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromCentistokes(QuantityValue? centistokes) - { - return centistokes.HasValue ? FromCentistokes(centistokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Decistokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromDecistokes(QuantityValue? decistokes) - { - return decistokes.HasValue ? FromDecistokes(decistokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Kilostokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromKilostokes(QuantityValue? kilostokes) - { - return kilostokes.HasValue ? FromKilostokes(kilostokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Microstokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromMicrostokes(QuantityValue? microstokes) - { - return microstokes.HasValue ? FromMicrostokes(microstokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Millistokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromMillistokes(QuantityValue? millistokes) - { - return millistokes.HasValue ? FromMillistokes(millistokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Nanostokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromNanostokes(QuantityValue? nanostokes) - { - return nanostokes.HasValue ? FromNanostokes(nanostokes.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable SquareMetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromSquareMetersPerSecond(QuantityValue? squaremeterspersecond) - { - return squaremeterspersecond.HasValue ? FromSquareMetersPerSecond(squaremeterspersecond.Value) : default(KinematicViscosity?); - } - - /// - /// Get nullable KinematicViscosity from nullable Stokes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static KinematicViscosity? FromStokes(QuantityValue? stokes) - { - return stokes.HasValue ? FromStokes(stokes.Value) : default(KinematicViscosity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// KinematicViscosity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static KinematicViscosity? From(QuantityValue? value, KinematicViscosityUnit fromUnit) - { - return value.HasValue ? new KinematicViscosity((double)value.Value, fromUnit) : default(KinematicViscosity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1cd3e7621f..3ab8900aba 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct LapseRate : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable LapseRate from nullable DegreesCelciusPerKilometer. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LapseRate? FromDegreesCelciusPerKilometer(QuantityValue? degreescelciusperkilometer) - { - return degreescelciusperkilometer.HasValue ? FromDegreesCelciusPerKilometer(degreescelciusperkilometer.Value) : default(LapseRate?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// LapseRate unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LapseRate? From(QuantityValue? value, LapseRateUnit fromUnit) - { - return value.HasValue ? new LapseRate((double)value.Value, fromUnit) : default(LapseRate?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index f15c49f2f5..962de75fef 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -60,220 +60,6 @@ public partial struct Length : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Length from nullable Centimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromCentimeters(QuantityValue? centimeters) - { - return centimeters.HasValue ? FromCentimeters(centimeters.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Decimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromDecimeters(QuantityValue? decimeters) - { - return decimeters.HasValue ? FromDecimeters(decimeters.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable DtpPicas. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromDtpPicas(QuantityValue? dtppicas) - { - return dtppicas.HasValue ? FromDtpPicas(dtppicas.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable DtpPoints. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromDtpPoints(QuantityValue? dtppoints) - { - return dtppoints.HasValue ? FromDtpPoints(dtppoints.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Fathoms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromFathoms(QuantityValue? fathoms) - { - return fathoms.HasValue ? FromFathoms(fathoms.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Feet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromFeet(QuantityValue? feet) - { - return feet.HasValue ? FromFeet(feet.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Inches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromInches(QuantityValue? inches) - { - return inches.HasValue ? FromInches(inches.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Kilometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromKilometers(QuantityValue? kilometers) - { - return kilometers.HasValue ? FromKilometers(kilometers.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Meters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMeters(QuantityValue? meters) - { - return meters.HasValue ? FromMeters(meters.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Microinches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMicroinches(QuantityValue? microinches) - { - return microinches.HasValue ? FromMicroinches(microinches.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Micrometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMicrometers(QuantityValue? micrometers) - { - return micrometers.HasValue ? FromMicrometers(micrometers.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Mils. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMils(QuantityValue? mils) - { - return mils.HasValue ? FromMils(mils.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Miles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMiles(QuantityValue? miles) - { - return miles.HasValue ? FromMiles(miles.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Millimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromMillimeters(QuantityValue? millimeters) - { - return millimeters.HasValue ? FromMillimeters(millimeters.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Nanometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromNanometers(QuantityValue? nanometers) - { - return nanometers.HasValue ? FromNanometers(nanometers.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable NauticalMiles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromNauticalMiles(QuantityValue? nauticalmiles) - { - return nauticalmiles.HasValue ? FromNauticalMiles(nauticalmiles.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable PrinterPicas. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromPrinterPicas(QuantityValue? printerpicas) - { - return printerpicas.HasValue ? FromPrinterPicas(printerpicas.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable PrinterPoints. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromPrinterPoints(QuantityValue? printerpoints) - { - return printerpoints.HasValue ? FromPrinterPoints(printerpoints.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Shackles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromShackles(QuantityValue? shackles) - { - return shackles.HasValue ? FromShackles(shackles.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Twips. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromTwips(QuantityValue? twips) - { - return twips.HasValue ? FromTwips(twips.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable UsSurveyFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromUsSurveyFeet(QuantityValue? ussurveyfeet) - { - return ussurveyfeet.HasValue ? FromUsSurveyFeet(ussurveyfeet.Value) : default(Length?); - } - - /// - /// Get nullable Length from nullable Yards. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Length? FromYards(QuantityValue? yards) - { - return yards.HasValue ? FromYards(yards.Value) : default(Length?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Length unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Length? From(QuantityValue? value, LengthUnit fromUnit) - { - return value.HasValue ? new Length((double)value.Value, fromUnit) : default(Length?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 75bab150c4..4531caf715 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct Level : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Level from nullable Decibels. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Level? FromDecibels(QuantityValue? decibels) - { - return decibels.HasValue ? FromDecibels(decibels.Value) : default(Level?); - } - - /// - /// Get nullable Level from nullable Nepers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Level? FromNepers(QuantityValue? nepers) - { - return nepers.HasValue ? FromNepers(nepers.Value) : default(Level?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Level unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Level? From(QuantityValue? value, LevelUnit fromUnit) - { - return value.HasValue ? new Level((double)value.Value, fromUnit) : default(Level?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index b2c1100816..980f16d7ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct LinearDensity : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable LinearDensity from nullable GramsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LinearDensity? FromGramsPerMeter(QuantityValue? gramspermeter) - { - return gramspermeter.HasValue ? FromGramsPerMeter(gramspermeter.Value) : default(LinearDensity?); - } - - /// - /// Get nullable LinearDensity from nullable KilogramsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LinearDensity? FromKilogramsPerMeter(QuantityValue? kilogramspermeter) - { - return kilogramspermeter.HasValue ? FromKilogramsPerMeter(kilogramspermeter.Value) : default(LinearDensity?); - } - - /// - /// Get nullable LinearDensity from nullable PoundsPerFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LinearDensity? FromPoundsPerFoot(QuantityValue? poundsperfoot) - { - return poundsperfoot.HasValue ? FromPoundsPerFoot(poundsperfoot.Value) : default(LinearDensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// LinearDensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LinearDensity? From(QuantityValue? value, LinearDensityUnit fromUnit) - { - return value.HasValue ? new LinearDensity((double)value.Value, fromUnit) : default(LinearDensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 778aabad6d..74c7c24231 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct LuminousFlux : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable LuminousFlux from nullable Lumens. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LuminousFlux? FromLumens(QuantityValue? lumens) - { - return lumens.HasValue ? FromLumens(lumens.Value) : default(LuminousFlux?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// LuminousFlux unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LuminousFlux? From(QuantityValue? value, LuminousFluxUnit fromUnit) - { - return value.HasValue ? new LuminousFlux((double)value.Value, fromUnit) : default(LuminousFlux?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 56388d68d1..68bc476cd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct LuminousIntensity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable LuminousIntensity from nullable Candela. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static LuminousIntensity? FromCandela(QuantityValue? candela) - { - return candela.HasValue ? FromCandela(candela.Value) : default(LuminousIntensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// LuminousIntensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static LuminousIntensity? From(QuantityValue? value, LuminousIntensityUnit fromUnit) - { - return value.HasValue ? new LuminousIntensity((double)value.Value, fromUnit) : default(LuminousIntensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 636e0610cb..e13e5408f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct MagneticField : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MagneticField from nullable Teslas. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MagneticField? FromTeslas(QuantityValue? teslas) - { - return teslas.HasValue ? FromTeslas(teslas.Value) : default(MagneticField?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MagneticField unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MagneticField? From(QuantityValue? value, MagneticFieldUnit fromUnit) - { - return value.HasValue ? new MagneticField((double)value.Value, fromUnit) : default(MagneticField?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index f3f3eefdb3..6283a54595 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct MagneticFlux : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MagneticFlux from nullable Webers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MagneticFlux? FromWebers(QuantityValue? webers) - { - return webers.HasValue ? FromWebers(webers.Value) : default(MagneticFlux?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MagneticFlux unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MagneticFlux? From(QuantityValue? value, MagneticFluxUnit fromUnit) - { - return value.HasValue ? new MagneticFlux((double)value.Value, fromUnit) : default(MagneticFlux?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 9ee47929f2..a631d15df4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct Magnetization : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Magnetization from nullable AmperesPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Magnetization? FromAmperesPerMeter(QuantityValue? amperespermeter) - { - return amperespermeter.HasValue ? FromAmperesPerMeter(amperespermeter.Value) : default(Magnetization?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Magnetization unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Magnetization? From(QuantityValue? value, MagnetizationUnit fromUnit) - { - return value.HasValue ? new Magnetization((double)value.Value, fromUnit) : default(Magnetization?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index a2aff8b53e..ce9566c873 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -60,211 +60,6 @@ public partial struct Mass : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Mass from nullable Centigrams. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromCentigrams(QuantityValue? centigrams) - { - return centigrams.HasValue ? FromCentigrams(centigrams.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Decagrams. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromDecagrams(QuantityValue? decagrams) - { - return decagrams.HasValue ? FromDecagrams(decagrams.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Decigrams. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromDecigrams(QuantityValue? decigrams) - { - return decigrams.HasValue ? FromDecigrams(decigrams.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Grams. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromGrams(QuantityValue? grams) - { - return grams.HasValue ? FromGrams(grams.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Hectograms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromHectograms(QuantityValue? hectograms) - { - return hectograms.HasValue ? FromHectograms(hectograms.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Kilograms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromKilograms(QuantityValue? kilograms) - { - return kilograms.HasValue ? FromKilograms(kilograms.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Kilopounds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromKilopounds(QuantityValue? kilopounds) - { - return kilopounds.HasValue ? FromKilopounds(kilopounds.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Kilotonnes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromKilotonnes(QuantityValue? kilotonnes) - { - return kilotonnes.HasValue ? FromKilotonnes(kilotonnes.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable LongHundredweight. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromLongHundredweight(QuantityValue? longhundredweight) - { - return longhundredweight.HasValue ? FromLongHundredweight(longhundredweight.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable LongTons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromLongTons(QuantityValue? longtons) - { - return longtons.HasValue ? FromLongTons(longtons.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Megapounds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromMegapounds(QuantityValue? megapounds) - { - return megapounds.HasValue ? FromMegapounds(megapounds.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Megatonnes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromMegatonnes(QuantityValue? megatonnes) - { - return megatonnes.HasValue ? FromMegatonnes(megatonnes.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Micrograms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromMicrograms(QuantityValue? micrograms) - { - return micrograms.HasValue ? FromMicrograms(micrograms.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Milligrams. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromMilligrams(QuantityValue? milligrams) - { - return milligrams.HasValue ? FromMilligrams(milligrams.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Nanograms. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromNanograms(QuantityValue? nanograms) - { - return nanograms.HasValue ? FromNanograms(nanograms.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Ounces. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromOunces(QuantityValue? ounces) - { - return ounces.HasValue ? FromOunces(ounces.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Pounds. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromPounds(QuantityValue? pounds) - { - return pounds.HasValue ? FromPounds(pounds.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable ShortHundredweight. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromShortHundredweight(QuantityValue? shorthundredweight) - { - return shorthundredweight.HasValue ? FromShortHundredweight(shorthundredweight.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable ShortTons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromShortTons(QuantityValue? shorttons) - { - return shorttons.HasValue ? FromShortTons(shorttons.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Stone. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromStone(QuantityValue? stone) - { - return stone.HasValue ? FromStone(stone.Value) : default(Mass?); - } - - /// - /// Get nullable Mass from nullable Tonnes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Mass? FromTonnes(QuantityValue? tonnes) - { - return tonnes.HasValue ? FromTonnes(tonnes.Value) : default(Mass?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Mass unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Mass? From(QuantityValue? value, MassUnit fromUnit) - { - return value.HasValue ? new Mass((double)value.Value, fromUnit) : default(Mass?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index e90181d29f..2c22b03ceb 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -60,157 +60,6 @@ public partial struct MassFlow : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MassFlow from nullable CentigramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromCentigramsPerSecond(QuantityValue? centigramspersecond) - { - return centigramspersecond.HasValue ? FromCentigramsPerSecond(centigramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable DecagramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromDecagramsPerSecond(QuantityValue? decagramspersecond) - { - return decagramspersecond.HasValue ? FromDecagramsPerSecond(decagramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable DecigramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromDecigramsPerSecond(QuantityValue? decigramspersecond) - { - return decigramspersecond.HasValue ? FromDecigramsPerSecond(decigramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable GramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromGramsPerSecond(QuantityValue? gramspersecond) - { - return gramspersecond.HasValue ? FromGramsPerSecond(gramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable HectogramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromHectogramsPerSecond(QuantityValue? hectogramspersecond) - { - return hectogramspersecond.HasValue ? FromHectogramsPerSecond(hectogramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable KilogramsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromKilogramsPerHour(QuantityValue? kilogramsperhour) - { - return kilogramsperhour.HasValue ? FromKilogramsPerHour(kilogramsperhour.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable KilogramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromKilogramsPerSecond(QuantityValue? kilogramspersecond) - { - return kilogramspersecond.HasValue ? FromKilogramsPerSecond(kilogramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable MegapoundsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromMegapoundsPerHour(QuantityValue? megapoundsperhour) - { - return megapoundsperhour.HasValue ? FromMegapoundsPerHour(megapoundsperhour.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable MicrogramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromMicrogramsPerSecond(QuantityValue? microgramspersecond) - { - return microgramspersecond.HasValue ? FromMicrogramsPerSecond(microgramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable MilligramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromMilligramsPerSecond(QuantityValue? milligramspersecond) - { - return milligramspersecond.HasValue ? FromMilligramsPerSecond(milligramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable NanogramsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromNanogramsPerSecond(QuantityValue? nanogramspersecond) - { - return nanogramspersecond.HasValue ? FromNanogramsPerSecond(nanogramspersecond.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable PoundsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromPoundsPerHour(QuantityValue? poundsperhour) - { - return poundsperhour.HasValue ? FromPoundsPerHour(poundsperhour.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable ShortTonsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromShortTonsPerHour(QuantityValue? shorttonsperhour) - { - return shorttonsperhour.HasValue ? FromShortTonsPerHour(shorttonsperhour.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable TonnesPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromTonnesPerDay(QuantityValue? tonnesperday) - { - return tonnesperday.HasValue ? FromTonnesPerDay(tonnesperday.Value) : default(MassFlow?); - } - - /// - /// Get nullable MassFlow from nullable TonnesPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlow? FromTonnesPerHour(QuantityValue? tonnesperhour) - { - return tonnesperhour.HasValue ? FromTonnesPerHour(tonnesperhour.Value) : default(MassFlow?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MassFlow unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlow? From(QuantityValue? value, MassFlowUnit fromUnit) - { - return value.HasValue ? new MassFlow((double)value.Value, fromUnit) : default(MassFlow?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index ff966c6ddb..c33c22dbf5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct MassFlux : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MassFlux from nullable GramsPerSecondPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlux? FromGramsPerSecondPerSquareMeter(QuantityValue? gramspersecondpersquaremeter) - { - return gramspersecondpersquaremeter.HasValue ? FromGramsPerSecondPerSquareMeter(gramspersecondpersquaremeter.Value) : default(MassFlux?); - } - - /// - /// Get nullable MassFlux from nullable KilogramsPerSecondPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassFlux? FromKilogramsPerSecondPerSquareMeter(QuantityValue? kilogramspersecondpersquaremeter) - { - return kilogramspersecondpersquaremeter.HasValue ? FromKilogramsPerSecondPerSquareMeter(kilogramspersecondpersquaremeter.Value) : default(MassFlux?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MassFlux unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassFlux? From(QuantityValue? value, MassFluxUnit fromUnit) - { - return value.HasValue ? new MassFlux((double)value.Value, fromUnit) : default(MassFlux?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 009ea8b31d..98cfd17366 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -60,256 +60,6 @@ public partial struct MassMomentOfInertia : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MassMomentOfInertia from nullable GramSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromGramSquareCentimeters(QuantityValue? gramsquarecentimeters) - { - return gramsquarecentimeters.HasValue ? FromGramSquareCentimeters(gramsquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable GramSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromGramSquareDecimeters(QuantityValue? gramsquaredecimeters) - { - return gramsquaredecimeters.HasValue ? FromGramSquareDecimeters(gramsquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable GramSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromGramSquareMeters(QuantityValue? gramsquaremeters) - { - return gramsquaremeters.HasValue ? FromGramSquareMeters(gramsquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable GramSquareMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromGramSquareMillimeters(QuantityValue? gramsquaremillimeters) - { - return gramsquaremillimeters.HasValue ? FromGramSquareMillimeters(gramsquaremillimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilogramSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilogramSquareCentimeters(QuantityValue? kilogramsquarecentimeters) - { - return kilogramsquarecentimeters.HasValue ? FromKilogramSquareCentimeters(kilogramsquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilogramSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilogramSquareDecimeters(QuantityValue? kilogramsquaredecimeters) - { - return kilogramsquaredecimeters.HasValue ? FromKilogramSquareDecimeters(kilogramsquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilogramSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilogramSquareMeters(QuantityValue? kilogramsquaremeters) - { - return kilogramsquaremeters.HasValue ? FromKilogramSquareMeters(kilogramsquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilogramSquareMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilogramSquareMillimeters(QuantityValue? kilogramsquaremillimeters) - { - return kilogramsquaremillimeters.HasValue ? FromKilogramSquareMillimeters(kilogramsquaremillimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilotonneSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilotonneSquareCentimeters(QuantityValue? kilotonnesquarecentimeters) - { - return kilotonnesquarecentimeters.HasValue ? FromKilotonneSquareCentimeters(kilotonnesquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilotonneSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilotonneSquareDecimeters(QuantityValue? kilotonnesquaredecimeters) - { - return kilotonnesquaredecimeters.HasValue ? FromKilotonneSquareDecimeters(kilotonnesquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilotonneSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilotonneSquareMeters(QuantityValue? kilotonnesquaremeters) - { - return kilotonnesquaremeters.HasValue ? FromKilotonneSquareMeters(kilotonnesquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable KilotonneSquareMilimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromKilotonneSquareMilimeters(QuantityValue? kilotonnesquaremilimeters) - { - return kilotonnesquaremilimeters.HasValue ? FromKilotonneSquareMilimeters(kilotonnesquaremilimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MegatonneSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMegatonneSquareCentimeters(QuantityValue? megatonnesquarecentimeters) - { - return megatonnesquarecentimeters.HasValue ? FromMegatonneSquareCentimeters(megatonnesquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MegatonneSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMegatonneSquareDecimeters(QuantityValue? megatonnesquaredecimeters) - { - return megatonnesquaredecimeters.HasValue ? FromMegatonneSquareDecimeters(megatonnesquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MegatonneSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMegatonneSquareMeters(QuantityValue? megatonnesquaremeters) - { - return megatonnesquaremeters.HasValue ? FromMegatonneSquareMeters(megatonnesquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MegatonneSquareMilimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMegatonneSquareMilimeters(QuantityValue? megatonnesquaremilimeters) - { - return megatonnesquaremilimeters.HasValue ? FromMegatonneSquareMilimeters(megatonnesquaremilimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MilligramSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMilligramSquareCentimeters(QuantityValue? milligramsquarecentimeters) - { - return milligramsquarecentimeters.HasValue ? FromMilligramSquareCentimeters(milligramsquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MilligramSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMilligramSquareDecimeters(QuantityValue? milligramsquaredecimeters) - { - return milligramsquaredecimeters.HasValue ? FromMilligramSquareDecimeters(milligramsquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MilligramSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMilligramSquareMeters(QuantityValue? milligramsquaremeters) - { - return milligramsquaremeters.HasValue ? FromMilligramSquareMeters(milligramsquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable MilligramSquareMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromMilligramSquareMillimeters(QuantityValue? milligramsquaremillimeters) - { - return milligramsquaremillimeters.HasValue ? FromMilligramSquareMillimeters(milligramsquaremillimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable PoundSquareFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromPoundSquareFeet(QuantityValue? poundsquarefeet) - { - return poundsquarefeet.HasValue ? FromPoundSquareFeet(poundsquarefeet.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable PoundSquareInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromPoundSquareInches(QuantityValue? poundsquareinches) - { - return poundsquareinches.HasValue ? FromPoundSquareInches(poundsquareinches.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable TonneSquareCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromTonneSquareCentimeters(QuantityValue? tonnesquarecentimeters) - { - return tonnesquarecentimeters.HasValue ? FromTonneSquareCentimeters(tonnesquarecentimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable TonneSquareDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromTonneSquareDecimeters(QuantityValue? tonnesquaredecimeters) - { - return tonnesquaredecimeters.HasValue ? FromTonneSquareDecimeters(tonnesquaredecimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable TonneSquareMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromTonneSquareMeters(QuantityValue? tonnesquaremeters) - { - return tonnesquaremeters.HasValue ? FromTonneSquareMeters(tonnesquaremeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Get nullable MassMomentOfInertia from nullable TonneSquareMilimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MassMomentOfInertia? FromTonneSquareMilimeters(QuantityValue? tonnesquaremilimeters) - { - return tonnesquaremilimeters.HasValue ? FromTonneSquareMilimeters(tonnesquaremilimeters.Value) : default(MassMomentOfInertia?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MassMomentOfInertia unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MassMomentOfInertia? From(QuantityValue? value, MassMomentOfInertiaUnit fromUnit) - { - return value.HasValue ? new MassMomentOfInertia((double)value.Value, fromUnit) : default(MassMomentOfInertia?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 0eedd254a6..dd4aaa2ba3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct MolarEnergy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MolarEnergy from nullable JoulesPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEnergy? FromJoulesPerMole(QuantityValue? joulespermole) - { - return joulespermole.HasValue ? FromJoulesPerMole(joulespermole.Value) : default(MolarEnergy?); - } - - /// - /// Get nullable MolarEnergy from nullable KilojoulesPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEnergy? FromKilojoulesPerMole(QuantityValue? kilojoulespermole) - { - return kilojoulespermole.HasValue ? FromKilojoulesPerMole(kilojoulespermole.Value) : default(MolarEnergy?); - } - - /// - /// Get nullable MolarEnergy from nullable MegajoulesPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEnergy? FromMegajoulesPerMole(QuantityValue? megajoulespermole) - { - return megajoulespermole.HasValue ? FromMegajoulesPerMole(megajoulespermole.Value) : default(MolarEnergy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MolarEnergy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEnergy? From(QuantityValue? value, MolarEnergyUnit fromUnit) - { - return value.HasValue ? new MolarEnergy((double)value.Value, fromUnit) : default(MolarEnergy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 854cf36bea..ff465f7ad6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct MolarEntropy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MolarEntropy from nullable JoulesPerMoleKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEntropy? FromJoulesPerMoleKelvin(QuantityValue? joulespermolekelvin) - { - return joulespermolekelvin.HasValue ? FromJoulesPerMoleKelvin(joulespermolekelvin.Value) : default(MolarEntropy?); - } - - /// - /// Get nullable MolarEntropy from nullable KilojoulesPerMoleKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEntropy? FromKilojoulesPerMoleKelvin(QuantityValue? kilojoulespermolekelvin) - { - return kilojoulespermolekelvin.HasValue ? FromKilojoulesPerMoleKelvin(kilojoulespermolekelvin.Value) : default(MolarEntropy?); - } - - /// - /// Get nullable MolarEntropy from nullable MegajoulesPerMoleKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarEntropy? FromMegajoulesPerMoleKelvin(QuantityValue? megajoulespermolekelvin) - { - return megajoulespermolekelvin.HasValue ? FromMegajoulesPerMoleKelvin(megajoulespermolekelvin.Value) : default(MolarEntropy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MolarEntropy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarEntropy? From(QuantityValue? value, MolarEntropyUnit fromUnit) - { - return value.HasValue ? new MolarEntropy((double)value.Value, fromUnit) : default(MolarEntropy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index a04598777e..d1ad580e8d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -60,130 +60,6 @@ public partial struct MolarMass : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable MolarMass from nullable CentigramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromCentigramsPerMole(QuantityValue? centigramspermole) - { - return centigramspermole.HasValue ? FromCentigramsPerMole(centigramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable DecagramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromDecagramsPerMole(QuantityValue? decagramspermole) - { - return decagramspermole.HasValue ? FromDecagramsPerMole(decagramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable DecigramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromDecigramsPerMole(QuantityValue? decigramspermole) - { - return decigramspermole.HasValue ? FromDecigramsPerMole(decigramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable GramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromGramsPerMole(QuantityValue? gramspermole) - { - return gramspermole.HasValue ? FromGramsPerMole(gramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable HectogramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromHectogramsPerMole(QuantityValue? hectogramspermole) - { - return hectogramspermole.HasValue ? FromHectogramsPerMole(hectogramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable KilogramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromKilogramsPerMole(QuantityValue? kilogramspermole) - { - return kilogramspermole.HasValue ? FromKilogramsPerMole(kilogramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable KilopoundsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromKilopoundsPerMole(QuantityValue? kilopoundspermole) - { - return kilopoundspermole.HasValue ? FromKilopoundsPerMole(kilopoundspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable MegapoundsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromMegapoundsPerMole(QuantityValue? megapoundspermole) - { - return megapoundspermole.HasValue ? FromMegapoundsPerMole(megapoundspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable MicrogramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromMicrogramsPerMole(QuantityValue? microgramspermole) - { - return microgramspermole.HasValue ? FromMicrogramsPerMole(microgramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable MilligramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromMilligramsPerMole(QuantityValue? milligramspermole) - { - return milligramspermole.HasValue ? FromMilligramsPerMole(milligramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable NanogramsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromNanogramsPerMole(QuantityValue? nanogramspermole) - { - return nanogramspermole.HasValue ? FromNanogramsPerMole(nanogramspermole.Value) : default(MolarMass?); - } - - /// - /// Get nullable MolarMass from nullable PoundsPerMole. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static MolarMass? FromPoundsPerMole(QuantityValue? poundspermole) - { - return poundspermole.HasValue ? FromPoundsPerMole(poundspermole.Value) : default(MolarMass?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// MolarMass unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static MolarMass? From(QuantityValue? value, MolarMassUnit fromUnit) - { - return value.HasValue ? new MolarMass((double)value.Value, fromUnit) : default(MolarMass?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index c431a9a647..27639b7b1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct Molarity : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Molarity from nullable CentimolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromCentimolesPerLiter(QuantityValue? centimolesperliter) - { - return centimolesperliter.HasValue ? FromCentimolesPerLiter(centimolesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable DecimolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromDecimolesPerLiter(QuantityValue? decimolesperliter) - { - return decimolesperliter.HasValue ? FromDecimolesPerLiter(decimolesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable MicromolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromMicromolesPerLiter(QuantityValue? micromolesperliter) - { - return micromolesperliter.HasValue ? FromMicromolesPerLiter(micromolesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable MillimolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromMillimolesPerLiter(QuantityValue? millimolesperliter) - { - return millimolesperliter.HasValue ? FromMillimolesPerLiter(millimolesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable MolesPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromMolesPerCubicMeter(QuantityValue? molespercubicmeter) - { - return molespercubicmeter.HasValue ? FromMolesPerCubicMeter(molespercubicmeter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable MolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromMolesPerLiter(QuantityValue? molesperliter) - { - return molesperliter.HasValue ? FromMolesPerLiter(molesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable NanomolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromNanomolesPerLiter(QuantityValue? nanomolesperliter) - { - return nanomolesperliter.HasValue ? FromNanomolesPerLiter(nanomolesperliter.Value) : default(Molarity?); - } - - /// - /// Get nullable Molarity from nullable PicomolesPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Molarity? FromPicomolesPerLiter(QuantityValue? picomolesperliter) - { - return picomolesperliter.HasValue ? FromPicomolesPerLiter(picomolesperliter.Value) : default(Molarity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Molarity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Molarity? From(QuantityValue? value, MolarityUnit fromUnit) - { - return value.HasValue ? new Molarity((double)value.Value, fromUnit) : default(Molarity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index d767808955..649ddcf6c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct Permeability : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Permeability from nullable HenriesPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Permeability? FromHenriesPerMeter(QuantityValue? henriespermeter) - { - return henriespermeter.HasValue ? FromHenriesPerMeter(henriespermeter.Value) : default(Permeability?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Permeability unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Permeability? From(QuantityValue? value, PermeabilityUnit fromUnit) - { - return value.HasValue ? new Permeability((double)value.Value, fromUnit) : default(Permeability?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 4891ceb3de..5be12bc995 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct Permittivity : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Permittivity from nullable FaradsPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Permittivity? FromFaradsPerMeter(QuantityValue? faradspermeter) - { - return faradspermeter.HasValue ? FromFaradsPerMeter(faradspermeter.Value) : default(Permittivity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Permittivity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Permittivity? From(QuantityValue? value, PermittivityUnit fromUnit) - { - return value.HasValue ? new Permittivity((double)value.Value, fromUnit) : default(Permittivity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 9287d3cbb3..b755ff3660 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -60,202 +60,6 @@ public partial struct Power : IComparable, IComparable ///
public decimal Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Power from nullable BoilerHorsepower. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromBoilerHorsepower(QuantityValue? boilerhorsepower) - { - return boilerhorsepower.HasValue ? FromBoilerHorsepower(boilerhorsepower.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable BritishThermalUnitsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromBritishThermalUnitsPerHour(QuantityValue? britishthermalunitsperhour) - { - return britishthermalunitsperhour.HasValue ? FromBritishThermalUnitsPerHour(britishthermalunitsperhour.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Decawatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromDecawatts(QuantityValue? decawatts) - { - return decawatts.HasValue ? FromDecawatts(decawatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Deciwatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromDeciwatts(QuantityValue? deciwatts) - { - return deciwatts.HasValue ? FromDeciwatts(deciwatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable ElectricalHorsepower. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromElectricalHorsepower(QuantityValue? electricalhorsepower) - { - return electricalhorsepower.HasValue ? FromElectricalHorsepower(electricalhorsepower.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Femtowatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromFemtowatts(QuantityValue? femtowatts) - { - return femtowatts.HasValue ? FromFemtowatts(femtowatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Gigawatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromGigawatts(QuantityValue? gigawatts) - { - return gigawatts.HasValue ? FromGigawatts(gigawatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable HydraulicHorsepower. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromHydraulicHorsepower(QuantityValue? hydraulichorsepower) - { - return hydraulichorsepower.HasValue ? FromHydraulicHorsepower(hydraulichorsepower.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable KilobritishThermalUnitsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromKilobritishThermalUnitsPerHour(QuantityValue? kilobritishthermalunitsperhour) - { - return kilobritishthermalunitsperhour.HasValue ? FromKilobritishThermalUnitsPerHour(kilobritishthermalunitsperhour.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Kilowatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromKilowatts(QuantityValue? kilowatts) - { - return kilowatts.HasValue ? FromKilowatts(kilowatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable MechanicalHorsepower. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromMechanicalHorsepower(QuantityValue? mechanicalhorsepower) - { - return mechanicalhorsepower.HasValue ? FromMechanicalHorsepower(mechanicalhorsepower.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Megawatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromMegawatts(QuantityValue? megawatts) - { - return megawatts.HasValue ? FromMegawatts(megawatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable MetricHorsepower. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromMetricHorsepower(QuantityValue? metrichorsepower) - { - return metrichorsepower.HasValue ? FromMetricHorsepower(metrichorsepower.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Microwatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromMicrowatts(QuantityValue? microwatts) - { - return microwatts.HasValue ? FromMicrowatts(microwatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Milliwatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromMilliwatts(QuantityValue? milliwatts) - { - return milliwatts.HasValue ? FromMilliwatts(milliwatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Nanowatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromNanowatts(QuantityValue? nanowatts) - { - return nanowatts.HasValue ? FromNanowatts(nanowatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Petawatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromPetawatts(QuantityValue? petawatts) - { - return petawatts.HasValue ? FromPetawatts(petawatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Picowatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromPicowatts(QuantityValue? picowatts) - { - return picowatts.HasValue ? FromPicowatts(picowatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Terawatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromTerawatts(QuantityValue? terawatts) - { - return terawatts.HasValue ? FromTerawatts(terawatts.Value) : default(Power?); - } - - /// - /// Get nullable Power from nullable Watts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Power? FromWatts(QuantityValue? watts) - { - return watts.HasValue ? FromWatts(watts.Value) : default(Power?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Power unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Power? From(QuantityValue? value, PowerUnit fromUnit) - { - return value.HasValue ? new Power((decimal)value.Value, fromUnit) : default(Power?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index c1612bea8f..183c4b30d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -60,418 +60,6 @@ public partial struct PowerDensity : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable PowerDensity from nullable DecawattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDecawattsPerCubicFoot(QuantityValue? decawattspercubicfoot) - { - return decawattspercubicfoot.HasValue ? FromDecawattsPerCubicFoot(decawattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DecawattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDecawattsPerCubicInch(QuantityValue? decawattspercubicinch) - { - return decawattspercubicinch.HasValue ? FromDecawattsPerCubicInch(decawattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DecawattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDecawattsPerCubicMeter(QuantityValue? decawattspercubicmeter) - { - return decawattspercubicmeter.HasValue ? FromDecawattsPerCubicMeter(decawattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DecawattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDecawattsPerLiter(QuantityValue? decawattsperliter) - { - return decawattsperliter.HasValue ? FromDecawattsPerLiter(decawattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DeciwattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDeciwattsPerCubicFoot(QuantityValue? deciwattspercubicfoot) - { - return deciwattspercubicfoot.HasValue ? FromDeciwattsPerCubicFoot(deciwattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DeciwattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDeciwattsPerCubicInch(QuantityValue? deciwattspercubicinch) - { - return deciwattspercubicinch.HasValue ? FromDeciwattsPerCubicInch(deciwattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DeciwattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDeciwattsPerCubicMeter(QuantityValue? deciwattspercubicmeter) - { - return deciwattspercubicmeter.HasValue ? FromDeciwattsPerCubicMeter(deciwattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable DeciwattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromDeciwattsPerLiter(QuantityValue? deciwattsperliter) - { - return deciwattsperliter.HasValue ? FromDeciwattsPerLiter(deciwattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable GigawattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromGigawattsPerCubicFoot(QuantityValue? gigawattspercubicfoot) - { - return gigawattspercubicfoot.HasValue ? FromGigawattsPerCubicFoot(gigawattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable GigawattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromGigawattsPerCubicInch(QuantityValue? gigawattspercubicinch) - { - return gigawattspercubicinch.HasValue ? FromGigawattsPerCubicInch(gigawattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable GigawattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromGigawattsPerCubicMeter(QuantityValue? gigawattspercubicmeter) - { - return gigawattspercubicmeter.HasValue ? FromGigawattsPerCubicMeter(gigawattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable GigawattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromGigawattsPerLiter(QuantityValue? gigawattsperliter) - { - return gigawattsperliter.HasValue ? FromGigawattsPerLiter(gigawattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable KilowattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromKilowattsPerCubicFoot(QuantityValue? kilowattspercubicfoot) - { - return kilowattspercubicfoot.HasValue ? FromKilowattsPerCubicFoot(kilowattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable KilowattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromKilowattsPerCubicInch(QuantityValue? kilowattspercubicinch) - { - return kilowattspercubicinch.HasValue ? FromKilowattsPerCubicInch(kilowattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable KilowattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromKilowattsPerCubicMeter(QuantityValue? kilowattspercubicmeter) - { - return kilowattspercubicmeter.HasValue ? FromKilowattsPerCubicMeter(kilowattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable KilowattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromKilowattsPerLiter(QuantityValue? kilowattsperliter) - { - return kilowattsperliter.HasValue ? FromKilowattsPerLiter(kilowattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MegawattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMegawattsPerCubicFoot(QuantityValue? megawattspercubicfoot) - { - return megawattspercubicfoot.HasValue ? FromMegawattsPerCubicFoot(megawattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MegawattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMegawattsPerCubicInch(QuantityValue? megawattspercubicinch) - { - return megawattspercubicinch.HasValue ? FromMegawattsPerCubicInch(megawattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MegawattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMegawattsPerCubicMeter(QuantityValue? megawattspercubicmeter) - { - return megawattspercubicmeter.HasValue ? FromMegawattsPerCubicMeter(megawattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MegawattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMegawattsPerLiter(QuantityValue? megawattsperliter) - { - return megawattsperliter.HasValue ? FromMegawattsPerLiter(megawattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MicrowattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMicrowattsPerCubicFoot(QuantityValue? microwattspercubicfoot) - { - return microwattspercubicfoot.HasValue ? FromMicrowattsPerCubicFoot(microwattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MicrowattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMicrowattsPerCubicInch(QuantityValue? microwattspercubicinch) - { - return microwattspercubicinch.HasValue ? FromMicrowattsPerCubicInch(microwattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MicrowattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMicrowattsPerCubicMeter(QuantityValue? microwattspercubicmeter) - { - return microwattspercubicmeter.HasValue ? FromMicrowattsPerCubicMeter(microwattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MicrowattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMicrowattsPerLiter(QuantityValue? microwattsperliter) - { - return microwattsperliter.HasValue ? FromMicrowattsPerLiter(microwattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MilliwattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMilliwattsPerCubicFoot(QuantityValue? milliwattspercubicfoot) - { - return milliwattspercubicfoot.HasValue ? FromMilliwattsPerCubicFoot(milliwattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MilliwattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMilliwattsPerCubicInch(QuantityValue? milliwattspercubicinch) - { - return milliwattspercubicinch.HasValue ? FromMilliwattsPerCubicInch(milliwattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MilliwattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMilliwattsPerCubicMeter(QuantityValue? milliwattspercubicmeter) - { - return milliwattspercubicmeter.HasValue ? FromMilliwattsPerCubicMeter(milliwattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable MilliwattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromMilliwattsPerLiter(QuantityValue? milliwattsperliter) - { - return milliwattsperliter.HasValue ? FromMilliwattsPerLiter(milliwattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable NanowattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromNanowattsPerCubicFoot(QuantityValue? nanowattspercubicfoot) - { - return nanowattspercubicfoot.HasValue ? FromNanowattsPerCubicFoot(nanowattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable NanowattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromNanowattsPerCubicInch(QuantityValue? nanowattspercubicinch) - { - return nanowattspercubicinch.HasValue ? FromNanowattsPerCubicInch(nanowattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable NanowattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromNanowattsPerCubicMeter(QuantityValue? nanowattspercubicmeter) - { - return nanowattspercubicmeter.HasValue ? FromNanowattsPerCubicMeter(nanowattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable NanowattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromNanowattsPerLiter(QuantityValue? nanowattsperliter) - { - return nanowattsperliter.HasValue ? FromNanowattsPerLiter(nanowattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable PicowattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromPicowattsPerCubicFoot(QuantityValue? picowattspercubicfoot) - { - return picowattspercubicfoot.HasValue ? FromPicowattsPerCubicFoot(picowattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable PicowattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromPicowattsPerCubicInch(QuantityValue? picowattspercubicinch) - { - return picowattspercubicinch.HasValue ? FromPicowattsPerCubicInch(picowattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable PicowattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromPicowattsPerCubicMeter(QuantityValue? picowattspercubicmeter) - { - return picowattspercubicmeter.HasValue ? FromPicowattsPerCubicMeter(picowattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable PicowattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromPicowattsPerLiter(QuantityValue? picowattsperliter) - { - return picowattsperliter.HasValue ? FromPicowattsPerLiter(picowattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable TerawattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromTerawattsPerCubicFoot(QuantityValue? terawattspercubicfoot) - { - return terawattspercubicfoot.HasValue ? FromTerawattsPerCubicFoot(terawattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable TerawattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromTerawattsPerCubicInch(QuantityValue? terawattspercubicinch) - { - return terawattspercubicinch.HasValue ? FromTerawattsPerCubicInch(terawattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable TerawattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromTerawattsPerCubicMeter(QuantityValue? terawattspercubicmeter) - { - return terawattspercubicmeter.HasValue ? FromTerawattsPerCubicMeter(terawattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable TerawattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromTerawattsPerLiter(QuantityValue? terawattsperliter) - { - return terawattsperliter.HasValue ? FromTerawattsPerLiter(terawattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable WattsPerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromWattsPerCubicFoot(QuantityValue? wattspercubicfoot) - { - return wattspercubicfoot.HasValue ? FromWattsPerCubicFoot(wattspercubicfoot.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable WattsPerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromWattsPerCubicInch(QuantityValue? wattspercubicinch) - { - return wattspercubicinch.HasValue ? FromWattsPerCubicInch(wattspercubicinch.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable WattsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromWattsPerCubicMeter(QuantityValue? wattspercubicmeter) - { - return wattspercubicmeter.HasValue ? FromWattsPerCubicMeter(wattspercubicmeter.Value) : default(PowerDensity?); - } - - /// - /// Get nullable PowerDensity from nullable WattsPerLiter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerDensity? FromWattsPerLiter(QuantityValue? wattsperliter) - { - return wattsperliter.HasValue ? FromWattsPerLiter(wattsperliter.Value) : default(PowerDensity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// PowerDensity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerDensity? From(QuantityValue? value, PowerDensityUnit fromUnit) - { - return value.HasValue ? new PowerDensity((double)value.Value, fromUnit) : default(PowerDensity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index fb8b9b3639..7ed507dbe4 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct PowerRatio : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable PowerRatio from nullable DecibelMilliwatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerRatio? FromDecibelMilliwatts(QuantityValue? decibelmilliwatts) - { - return decibelmilliwatts.HasValue ? FromDecibelMilliwatts(decibelmilliwatts.Value) : default(PowerRatio?); - } - - /// - /// Get nullable PowerRatio from nullable DecibelWatts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PowerRatio? FromDecibelWatts(QuantityValue? decibelwatts) - { - return decibelwatts.HasValue ? FromDecibelWatts(decibelwatts.Value) : default(PowerRatio?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// PowerRatio unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PowerRatio? From(QuantityValue? value, PowerRatioUnit fromUnit) - { - return value.HasValue ? new PowerRatio((double)value.Value, fromUnit) : default(PowerRatio?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 251ae0bce2..61c85b42bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -60,364 +60,6 @@ public partial struct Pressure : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Pressure from nullable Atmospheres. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromAtmospheres(QuantityValue? atmospheres) - { - return atmospheres.HasValue ? FromAtmospheres(atmospheres.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Bars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromBars(QuantityValue? bars) - { - return bars.HasValue ? FromBars(bars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Centibars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromCentibars(QuantityValue? centibars) - { - return centibars.HasValue ? FromCentibars(centibars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Decapascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromDecapascals(QuantityValue? decapascals) - { - return decapascals.HasValue ? FromDecapascals(decapascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Decibars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromDecibars(QuantityValue? decibars) - { - return decibars.HasValue ? FromDecibars(decibars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable FeetOfHead. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromFeetOfHead(QuantityValue? feetofhead) - { - return feetofhead.HasValue ? FromFeetOfHead(feetofhead.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Gigapascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromGigapascals(QuantityValue? gigapascals) - { - return gigapascals.HasValue ? FromGigapascals(gigapascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Hectopascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromHectopascals(QuantityValue? hectopascals) - { - return hectopascals.HasValue ? FromHectopascals(hectopascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable InchesOfMercury. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromInchesOfMercury(QuantityValue? inchesofmercury) - { - return inchesofmercury.HasValue ? FromInchesOfMercury(inchesofmercury.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Kilobars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilobars(QuantityValue? kilobars) - { - return kilobars.HasValue ? FromKilobars(kilobars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilogramsForcePerSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilogramsForcePerSquareCentimeter(QuantityValue? kilogramsforcepersquarecentimeter) - { - return kilogramsforcepersquarecentimeter.HasValue ? FromKilogramsForcePerSquareCentimeter(kilogramsforcepersquarecentimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilogramsForcePerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilogramsForcePerSquareMeter(QuantityValue? kilogramsforcepersquaremeter) - { - return kilogramsforcepersquaremeter.HasValue ? FromKilogramsForcePerSquareMeter(kilogramsforcepersquaremeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilogramsForcePerSquareMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilogramsForcePerSquareMillimeter(QuantityValue? kilogramsforcepersquaremillimeter) - { - return kilogramsforcepersquaremillimeter.HasValue ? FromKilogramsForcePerSquareMillimeter(kilogramsforcepersquaremillimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilonewtonsPerSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilonewtonsPerSquareCentimeter(QuantityValue? kilonewtonspersquarecentimeter) - { - return kilonewtonspersquarecentimeter.HasValue ? FromKilonewtonsPerSquareCentimeter(kilonewtonspersquarecentimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilonewtonsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilonewtonsPerSquareMeter(QuantityValue? kilonewtonspersquaremeter) - { - return kilonewtonspersquaremeter.HasValue ? FromKilonewtonsPerSquareMeter(kilonewtonspersquaremeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilonewtonsPerSquareMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilonewtonsPerSquareMillimeter(QuantityValue? kilonewtonspersquaremillimeter) - { - return kilonewtonspersquaremillimeter.HasValue ? FromKilonewtonsPerSquareMillimeter(kilonewtonspersquaremillimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Kilopascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilopascals(QuantityValue? kilopascals) - { - return kilopascals.HasValue ? FromKilopascals(kilopascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilopoundsForcePerSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilopoundsForcePerSquareFoot(QuantityValue? kilopoundsforcepersquarefoot) - { - return kilopoundsforcepersquarefoot.HasValue ? FromKilopoundsForcePerSquareFoot(kilopoundsforcepersquarefoot.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable KilopoundsForcePerSquareInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromKilopoundsForcePerSquareInch(QuantityValue? kilopoundsforcepersquareinch) - { - return kilopoundsforcepersquareinch.HasValue ? FromKilopoundsForcePerSquareInch(kilopoundsforcepersquareinch.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Megabars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMegabars(QuantityValue? megabars) - { - return megabars.HasValue ? FromMegabars(megabars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable MeganewtonsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMeganewtonsPerSquareMeter(QuantityValue? meganewtonspersquaremeter) - { - return meganewtonspersquaremeter.HasValue ? FromMeganewtonsPerSquareMeter(meganewtonspersquaremeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Megapascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMegapascals(QuantityValue? megapascals) - { - return megapascals.HasValue ? FromMegapascals(megapascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable MetersOfHead. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMetersOfHead(QuantityValue? metersofhead) - { - return metersofhead.HasValue ? FromMetersOfHead(metersofhead.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Micropascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMicropascals(QuantityValue? micropascals) - { - return micropascals.HasValue ? FromMicropascals(micropascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Millibars. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMillibars(QuantityValue? millibars) - { - return millibars.HasValue ? FromMillibars(millibars.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable MillimetersOfMercury. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromMillimetersOfMercury(QuantityValue? millimetersofmercury) - { - return millimetersofmercury.HasValue ? FromMillimetersOfMercury(millimetersofmercury.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable NewtonsPerSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromNewtonsPerSquareCentimeter(QuantityValue? newtonspersquarecentimeter) - { - return newtonspersquarecentimeter.HasValue ? FromNewtonsPerSquareCentimeter(newtonspersquarecentimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable NewtonsPerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromNewtonsPerSquareMeter(QuantityValue? newtonspersquaremeter) - { - return newtonspersquaremeter.HasValue ? FromNewtonsPerSquareMeter(newtonspersquaremeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable NewtonsPerSquareMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromNewtonsPerSquareMillimeter(QuantityValue? newtonspersquaremillimeter) - { - return newtonspersquaremillimeter.HasValue ? FromNewtonsPerSquareMillimeter(newtonspersquaremillimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Pascals. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromPascals(QuantityValue? pascals) - { - return pascals.HasValue ? FromPascals(pascals.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable PoundsForcePerSquareFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromPoundsForcePerSquareFoot(QuantityValue? poundsforcepersquarefoot) - { - return poundsforcepersquarefoot.HasValue ? FromPoundsForcePerSquareFoot(poundsforcepersquarefoot.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable PoundsForcePerSquareInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromPoundsForcePerSquareInch(QuantityValue? poundsforcepersquareinch) - { - return poundsforcepersquareinch.HasValue ? FromPoundsForcePerSquareInch(poundsforcepersquareinch.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Psi. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromPsi(QuantityValue? psi) - { - return psi.HasValue ? FromPsi(psi.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable TechnicalAtmospheres. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromTechnicalAtmospheres(QuantityValue? technicalatmospheres) - { - return technicalatmospheres.HasValue ? FromTechnicalAtmospheres(technicalatmospheres.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable TonnesForcePerSquareCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromTonnesForcePerSquareCentimeter(QuantityValue? tonnesforcepersquarecentimeter) - { - return tonnesforcepersquarecentimeter.HasValue ? FromTonnesForcePerSquareCentimeter(tonnesforcepersquarecentimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable TonnesForcePerSquareMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromTonnesForcePerSquareMeter(QuantityValue? tonnesforcepersquaremeter) - { - return tonnesforcepersquaremeter.HasValue ? FromTonnesForcePerSquareMeter(tonnesforcepersquaremeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable TonnesForcePerSquareMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromTonnesForcePerSquareMillimeter(QuantityValue? tonnesforcepersquaremillimeter) - { - return tonnesforcepersquaremillimeter.HasValue ? FromTonnesForcePerSquareMillimeter(tonnesforcepersquaremillimeter.Value) : default(Pressure?); - } - - /// - /// Get nullable Pressure from nullable Torrs. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Pressure? FromTorrs(QuantityValue? torrs) - { - return torrs.HasValue ? FromTorrs(torrs.Value) : default(Pressure?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Pressure unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Pressure? From(QuantityValue? value, PressureUnit fromUnit) - { - return value.HasValue ? new Pressure((double)value.Value, fromUnit) : default(Pressure?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index e9133a77a8..cadf4edc38 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct PressureChangeRate : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable PressureChangeRate from nullable AtmospheresPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PressureChangeRate? FromAtmospheresPerSecond(QuantityValue? atmospherespersecond) - { - return atmospherespersecond.HasValue ? FromAtmospheresPerSecond(atmospherespersecond.Value) : default(PressureChangeRate?); - } - - /// - /// Get nullable PressureChangeRate from nullable KilopascalsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PressureChangeRate? FromKilopascalsPerSecond(QuantityValue? kilopascalspersecond) - { - return kilopascalspersecond.HasValue ? FromKilopascalsPerSecond(kilopascalspersecond.Value) : default(PressureChangeRate?); - } - - /// - /// Get nullable PressureChangeRate from nullable MegapascalsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PressureChangeRate? FromMegapascalsPerSecond(QuantityValue? megapascalspersecond) - { - return megapascalspersecond.HasValue ? FromMegapascalsPerSecond(megapascalspersecond.Value) : default(PressureChangeRate?); - } - - /// - /// Get nullable PressureChangeRate from nullable PascalsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static PressureChangeRate? FromPascalsPerSecond(QuantityValue? pascalspersecond) - { - return pascalspersecond.HasValue ? FromPascalsPerSecond(pascalspersecond.Value) : default(PressureChangeRate?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// PressureChangeRate unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static PressureChangeRate? From(QuantityValue? value, PressureChangeRateUnit fromUnit) - { - return value.HasValue ? new PressureChangeRate((double)value.Value, fromUnit) : default(PressureChangeRate?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 993c2015d3..e0a699a55c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -60,76 +60,6 @@ public partial struct Ratio : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Ratio from nullable DecimalFractions. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromDecimalFractions(QuantityValue? decimalfractions) - { - return decimalfractions.HasValue ? FromDecimalFractions(decimalfractions.Value) : default(Ratio?); - } - - /// - /// Get nullable Ratio from nullable PartsPerBillion. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromPartsPerBillion(QuantityValue? partsperbillion) - { - return partsperbillion.HasValue ? FromPartsPerBillion(partsperbillion.Value) : default(Ratio?); - } - - /// - /// Get nullable Ratio from nullable PartsPerMillion. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromPartsPerMillion(QuantityValue? partspermillion) - { - return partspermillion.HasValue ? FromPartsPerMillion(partspermillion.Value) : default(Ratio?); - } - - /// - /// Get nullable Ratio from nullable PartsPerThousand. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromPartsPerThousand(QuantityValue? partsperthousand) - { - return partsperthousand.HasValue ? FromPartsPerThousand(partsperthousand.Value) : default(Ratio?); - } - - /// - /// Get nullable Ratio from nullable PartsPerTrillion. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromPartsPerTrillion(QuantityValue? partspertrillion) - { - return partspertrillion.HasValue ? FromPartsPerTrillion(partspertrillion.Value) : default(Ratio?); - } - - /// - /// Get nullable Ratio from nullable Percent. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Ratio? FromPercent(QuantityValue? percent) - { - return percent.HasValue ? FromPercent(percent.Value) : default(Ratio?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Ratio unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Ratio? From(QuantityValue? value, RatioUnit fromUnit) - { - return value.HasValue ? new Ratio((double)value.Value, fromUnit) : default(Ratio?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 390183475b..b21efbd3f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct ReactiveEnergy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ReactiveEnergy from nullable KilovoltampereReactiveHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactiveEnergy? FromKilovoltampereReactiveHours(QuantityValue? kilovoltamperereactivehours) - { - return kilovoltamperereactivehours.HasValue ? FromKilovoltampereReactiveHours(kilovoltamperereactivehours.Value) : default(ReactiveEnergy?); - } - - /// - /// Get nullable ReactiveEnergy from nullable MegavoltampereReactiveHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactiveEnergy? FromMegavoltampereReactiveHours(QuantityValue? megavoltamperereactivehours) - { - return megavoltamperereactivehours.HasValue ? FromMegavoltampereReactiveHours(megavoltamperereactivehours.Value) : default(ReactiveEnergy?); - } - - /// - /// Get nullable ReactiveEnergy from nullable VoltampereReactiveHours. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactiveEnergy? FromVoltampereReactiveHours(QuantityValue? voltamperereactivehours) - { - return voltamperereactivehours.HasValue ? FromVoltampereReactiveHours(voltamperereactivehours.Value) : default(ReactiveEnergy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ReactiveEnergy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactiveEnergy? From(QuantityValue? value, ReactiveEnergyUnit fromUnit) - { - return value.HasValue ? new ReactiveEnergy((double)value.Value, fromUnit) : default(ReactiveEnergy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 086effb16a..dd28e8171e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -60,58 +60,6 @@ public partial struct ReactivePower : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ReactivePower from nullable GigavoltamperesReactive. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactivePower? FromGigavoltamperesReactive(QuantityValue? gigavoltamperesreactive) - { - return gigavoltamperesreactive.HasValue ? FromGigavoltamperesReactive(gigavoltamperesreactive.Value) : default(ReactivePower?); - } - - /// - /// Get nullable ReactivePower from nullable KilovoltamperesReactive. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactivePower? FromKilovoltamperesReactive(QuantityValue? kilovoltamperesreactive) - { - return kilovoltamperesreactive.HasValue ? FromKilovoltamperesReactive(kilovoltamperesreactive.Value) : default(ReactivePower?); - } - - /// - /// Get nullable ReactivePower from nullable MegavoltamperesReactive. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactivePower? FromMegavoltamperesReactive(QuantityValue? megavoltamperesreactive) - { - return megavoltamperesreactive.HasValue ? FromMegavoltamperesReactive(megavoltamperesreactive.Value) : default(ReactivePower?); - } - - /// - /// Get nullable ReactivePower from nullable VoltamperesReactive. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ReactivePower? FromVoltamperesReactive(QuantityValue? voltamperesreactive) - { - return voltamperesreactive.HasValue ? FromVoltamperesReactive(voltamperesreactive.Value) : default(ReactivePower?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ReactivePower unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ReactivePower? From(QuantityValue? value, ReactivePowerUnit fromUnit) - { - return value.HasValue ? new ReactivePower((double)value.Value, fromUnit) : default(ReactivePower?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 16b0a47185..f080c98165 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct RotationalAcceleration : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable RotationalAcceleration from nullable DegreesPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalAcceleration? FromDegreesPerSecondSquared(QuantityValue? degreespersecondsquared) - { - return degreespersecondsquared.HasValue ? FromDegreesPerSecondSquared(degreespersecondsquared.Value) : default(RotationalAcceleration?); - } - - /// - /// Get nullable RotationalAcceleration from nullable RadiansPerSecondSquared. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalAcceleration? FromRadiansPerSecondSquared(QuantityValue? radianspersecondsquared) - { - return radianspersecondsquared.HasValue ? FromRadiansPerSecondSquared(radianspersecondsquared.Value) : default(RotationalAcceleration?); - } - - /// - /// Get nullable RotationalAcceleration from nullable RevolutionsPerMinutePerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalAcceleration? FromRevolutionsPerMinutePerSecond(QuantityValue? revolutionsperminutepersecond) - { - return revolutionsperminutepersecond.HasValue ? FromRevolutionsPerMinutePerSecond(revolutionsperminutepersecond.Value) : default(RotationalAcceleration?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// RotationalAcceleration unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalAcceleration? From(QuantityValue? value, RotationalAccelerationUnit fromUnit) - { - return value.HasValue ? new RotationalAcceleration((double)value.Value, fromUnit) : default(RotationalAcceleration?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index baf25cc9cf..f2e653a169 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -60,139 +60,6 @@ public partial struct RotationalSpeed : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable RotationalSpeed from nullable CentiradiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromCentiradiansPerSecond(QuantityValue? centiradianspersecond) - { - return centiradianspersecond.HasValue ? FromCentiradiansPerSecond(centiradianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable DeciradiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromDeciradiansPerSecond(QuantityValue? deciradianspersecond) - { - return deciradianspersecond.HasValue ? FromDeciradiansPerSecond(deciradianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable DegreesPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromDegreesPerMinute(QuantityValue? degreesperminute) - { - return degreesperminute.HasValue ? FromDegreesPerMinute(degreesperminute.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable DegreesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromDegreesPerSecond(QuantityValue? degreespersecond) - { - return degreespersecond.HasValue ? FromDegreesPerSecond(degreespersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable MicrodegreesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromMicrodegreesPerSecond(QuantityValue? microdegreespersecond) - { - return microdegreespersecond.HasValue ? FromMicrodegreesPerSecond(microdegreespersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable MicroradiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromMicroradiansPerSecond(QuantityValue? microradianspersecond) - { - return microradianspersecond.HasValue ? FromMicroradiansPerSecond(microradianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable MillidegreesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromMillidegreesPerSecond(QuantityValue? millidegreespersecond) - { - return millidegreespersecond.HasValue ? FromMillidegreesPerSecond(millidegreespersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable MilliradiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromMilliradiansPerSecond(QuantityValue? milliradianspersecond) - { - return milliradianspersecond.HasValue ? FromMilliradiansPerSecond(milliradianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable NanodegreesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromNanodegreesPerSecond(QuantityValue? nanodegreespersecond) - { - return nanodegreespersecond.HasValue ? FromNanodegreesPerSecond(nanodegreespersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable NanoradiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromNanoradiansPerSecond(QuantityValue? nanoradianspersecond) - { - return nanoradianspersecond.HasValue ? FromNanoradiansPerSecond(nanoradianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable RadiansPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromRadiansPerSecond(QuantityValue? radianspersecond) - { - return radianspersecond.HasValue ? FromRadiansPerSecond(radianspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable RevolutionsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromRevolutionsPerMinute(QuantityValue? revolutionsperminute) - { - return revolutionsperminute.HasValue ? FromRevolutionsPerMinute(revolutionsperminute.Value) : default(RotationalSpeed?); - } - - /// - /// Get nullable RotationalSpeed from nullable RevolutionsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalSpeed? FromRevolutionsPerSecond(QuantityValue? revolutionspersecond) - { - return revolutionspersecond.HasValue ? FromRevolutionsPerSecond(revolutionspersecond.Value) : default(RotationalSpeed?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// RotationalSpeed unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalSpeed? From(QuantityValue? value, RotationalSpeedUnit fromUnit) - { - return value.HasValue ? new RotationalSpeed((double)value.Value, fromUnit) : default(RotationalSpeed?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index db4b15e846..a72a9e4b34 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct RotationalStiffness : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable RotationalStiffness from nullable KilonewtonMetersPerRadian. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffness? FromKilonewtonMetersPerRadian(QuantityValue? kilonewtonmetersperradian) - { - return kilonewtonmetersperradian.HasValue ? FromKilonewtonMetersPerRadian(kilonewtonmetersperradian.Value) : default(RotationalStiffness?); - } - - /// - /// Get nullable RotationalStiffness from nullable MeganewtonMetersPerRadian. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffness? FromMeganewtonMetersPerRadian(QuantityValue? meganewtonmetersperradian) - { - return meganewtonmetersperradian.HasValue ? FromMeganewtonMetersPerRadian(meganewtonmetersperradian.Value) : default(RotationalStiffness?); - } - - /// - /// Get nullable RotationalStiffness from nullable NewtonMetersPerRadian. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffness? FromNewtonMetersPerRadian(QuantityValue? newtonmetersperradian) - { - return newtonmetersperradian.HasValue ? FromNewtonMetersPerRadian(newtonmetersperradian.Value) : default(RotationalStiffness?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// RotationalStiffness unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffness? From(QuantityValue? value, RotationalStiffnessUnit fromUnit) - { - return value.HasValue ? new RotationalStiffness((double)value.Value, fromUnit) : default(RotationalStiffness?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 0a41d0fef4..1cea909409 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -60,49 +60,6 @@ public partial struct RotationalStiffnessPerLength : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable RotationalStiffnessPerLength from nullable KilonewtonMetersPerRadianPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffnessPerLength? FromKilonewtonMetersPerRadianPerMeter(QuantityValue? kilonewtonmetersperradianpermeter) - { - return kilonewtonmetersperradianpermeter.HasValue ? FromKilonewtonMetersPerRadianPerMeter(kilonewtonmetersperradianpermeter.Value) : default(RotationalStiffnessPerLength?); - } - - /// - /// Get nullable RotationalStiffnessPerLength from nullable MeganewtonMetersPerRadianPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffnessPerLength? FromMeganewtonMetersPerRadianPerMeter(QuantityValue? meganewtonmetersperradianpermeter) - { - return meganewtonmetersperradianpermeter.HasValue ? FromMeganewtonMetersPerRadianPerMeter(meganewtonmetersperradianpermeter.Value) : default(RotationalStiffnessPerLength?); - } - - /// - /// Get nullable RotationalStiffnessPerLength from nullable NewtonMetersPerRadianPerMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static RotationalStiffnessPerLength? FromNewtonMetersPerRadianPerMeter(QuantityValue? newtonmetersperradianpermeter) - { - return newtonmetersperradianpermeter.HasValue ? FromNewtonMetersPerRadianPerMeter(newtonmetersperradianpermeter.Value) : default(RotationalStiffnessPerLength?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// RotationalStiffnessPerLength unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static RotationalStiffnessPerLength? From(QuantityValue? value, RotationalStiffnessPerLengthUnit fromUnit) - { - return value.HasValue ? new RotationalStiffnessPerLength((double)value.Value, fromUnit) : default(RotationalStiffnessPerLength?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 802e37b63a..753cc4908d 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct SolidAngle : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable SolidAngle from nullable Steradians. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SolidAngle? FromSteradians(QuantityValue? steradians) - { - return steradians.HasValue ? FromSteradians(steradians.Value) : default(SolidAngle?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// SolidAngle unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SolidAngle? From(QuantityValue? value, SolidAngleUnit fromUnit) - { - return value.HasValue ? new SolidAngle((double)value.Value, fromUnit) : default(SolidAngle?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 5d6fd503d4..d14c8373a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct SpecificEnergy : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable SpecificEnergy from nullable CaloriesPerGram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromCaloriesPerGram(QuantityValue? caloriespergram) - { - return caloriespergram.HasValue ? FromCaloriesPerGram(caloriespergram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable JoulesPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromJoulesPerKilogram(QuantityValue? joulesperkilogram) - { - return joulesperkilogram.HasValue ? FromJoulesPerKilogram(joulesperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable KilocaloriesPerGram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromKilocaloriesPerGram(QuantityValue? kilocaloriespergram) - { - return kilocaloriespergram.HasValue ? FromKilocaloriesPerGram(kilocaloriespergram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable KilojoulesPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromKilojoulesPerKilogram(QuantityValue? kilojoulesperkilogram) - { - return kilojoulesperkilogram.HasValue ? FromKilojoulesPerKilogram(kilojoulesperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable KilowattHoursPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromKilowattHoursPerKilogram(QuantityValue? kilowatthoursperkilogram) - { - return kilowatthoursperkilogram.HasValue ? FromKilowattHoursPerKilogram(kilowatthoursperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable MegajoulesPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromMegajoulesPerKilogram(QuantityValue? megajoulesperkilogram) - { - return megajoulesperkilogram.HasValue ? FromMegajoulesPerKilogram(megajoulesperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable MegawattHoursPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromMegawattHoursPerKilogram(QuantityValue? megawatthoursperkilogram) - { - return megawatthoursperkilogram.HasValue ? FromMegawattHoursPerKilogram(megawatthoursperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Get nullable SpecificEnergy from nullable WattHoursPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEnergy? FromWattHoursPerKilogram(QuantityValue? watthoursperkilogram) - { - return watthoursperkilogram.HasValue ? FromWattHoursPerKilogram(watthoursperkilogram.Value) : default(SpecificEnergy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// SpecificEnergy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEnergy? From(QuantityValue? value, SpecificEnergyUnit fromUnit) - { - return value.HasValue ? new SpecificEnergy((double)value.Value, fromUnit) : default(SpecificEnergy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index df6ff742b1..01cab081c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct SpecificEntropy : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable SpecificEntropy from nullable CaloriesPerGramKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromCaloriesPerGramKelvin(QuantityValue? caloriespergramkelvin) - { - return caloriespergramkelvin.HasValue ? FromCaloriesPerGramKelvin(caloriespergramkelvin.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable JoulesPerKilogramDegreeCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromJoulesPerKilogramDegreeCelsius(QuantityValue? joulesperkilogramdegreecelsius) - { - return joulesperkilogramdegreecelsius.HasValue ? FromJoulesPerKilogramDegreeCelsius(joulesperkilogramdegreecelsius.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable JoulesPerKilogramKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromJoulesPerKilogramKelvin(QuantityValue? joulesperkilogramkelvin) - { - return joulesperkilogramkelvin.HasValue ? FromJoulesPerKilogramKelvin(joulesperkilogramkelvin.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable KilocaloriesPerGramKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromKilocaloriesPerGramKelvin(QuantityValue? kilocaloriespergramkelvin) - { - return kilocaloriespergramkelvin.HasValue ? FromKilocaloriesPerGramKelvin(kilocaloriespergramkelvin.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable KilojoulesPerKilogramDegreeCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromKilojoulesPerKilogramDegreeCelsius(QuantityValue? kilojoulesperkilogramdegreecelsius) - { - return kilojoulesperkilogramdegreecelsius.HasValue ? FromKilojoulesPerKilogramDegreeCelsius(kilojoulesperkilogramdegreecelsius.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable KilojoulesPerKilogramKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromKilojoulesPerKilogramKelvin(QuantityValue? kilojoulesperkilogramkelvin) - { - return kilojoulesperkilogramkelvin.HasValue ? FromKilojoulesPerKilogramKelvin(kilojoulesperkilogramkelvin.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable MegajoulesPerKilogramDegreeCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromMegajoulesPerKilogramDegreeCelsius(QuantityValue? megajoulesperkilogramdegreecelsius) - { - return megajoulesperkilogramdegreecelsius.HasValue ? FromMegajoulesPerKilogramDegreeCelsius(megajoulesperkilogramdegreecelsius.Value) : default(SpecificEntropy?); - } - - /// - /// Get nullable SpecificEntropy from nullable MegajoulesPerKilogramKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificEntropy? FromMegajoulesPerKilogramKelvin(QuantityValue? megajoulesperkilogramkelvin) - { - return megajoulesperkilogramkelvin.HasValue ? FromMegajoulesPerKilogramKelvin(megajoulesperkilogramkelvin.Value) : default(SpecificEntropy?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// SpecificEntropy unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificEntropy? From(QuantityValue? value, SpecificEntropyUnit fromUnit) - { - return value.HasValue ? new SpecificEntropy((double)value.Value, fromUnit) : default(SpecificEntropy?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 1e06b97f10..09239402e0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct SpecificVolume : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable SpecificVolume from nullable CubicFeetPerPound. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificVolume? FromCubicFeetPerPound(QuantityValue? cubicfeetperpound) - { - return cubicfeetperpound.HasValue ? FromCubicFeetPerPound(cubicfeetperpound.Value) : default(SpecificVolume?); - } - - /// - /// Get nullable SpecificVolume from nullable CubicMetersPerKilogram. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificVolume? FromCubicMetersPerKilogram(QuantityValue? cubicmetersperkilogram) - { - return cubicmetersperkilogram.HasValue ? FromCubicMetersPerKilogram(cubicmetersperkilogram.Value) : default(SpecificVolume?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// SpecificVolume unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificVolume? From(QuantityValue? value, SpecificVolumeUnit fromUnit) - { - return value.HasValue ? new SpecificVolume((double)value.Value, fromUnit) : default(SpecificVolume?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 417b4170e6..663448a8c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -60,175 +60,6 @@ public partial struct SpecificWeight : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable SpecificWeight from nullable KilogramsForcePerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilogramsForcePerCubicCentimeter(QuantityValue? kilogramsforcepercubiccentimeter) - { - return kilogramsforcepercubiccentimeter.HasValue ? FromKilogramsForcePerCubicCentimeter(kilogramsforcepercubiccentimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilogramsForcePerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilogramsForcePerCubicMeter(QuantityValue? kilogramsforcepercubicmeter) - { - return kilogramsforcepercubicmeter.HasValue ? FromKilogramsForcePerCubicMeter(kilogramsforcepercubicmeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilogramsForcePerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilogramsForcePerCubicMillimeter(QuantityValue? kilogramsforcepercubicmillimeter) - { - return kilogramsforcepercubicmillimeter.HasValue ? FromKilogramsForcePerCubicMillimeter(kilogramsforcepercubicmillimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilonewtonsPerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilonewtonsPerCubicCentimeter(QuantityValue? kilonewtonspercubiccentimeter) - { - return kilonewtonspercubiccentimeter.HasValue ? FromKilonewtonsPerCubicCentimeter(kilonewtonspercubiccentimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilonewtonsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilonewtonsPerCubicMeter(QuantityValue? kilonewtonspercubicmeter) - { - return kilonewtonspercubicmeter.HasValue ? FromKilonewtonsPerCubicMeter(kilonewtonspercubicmeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilonewtonsPerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilonewtonsPerCubicMillimeter(QuantityValue? kilonewtonspercubicmillimeter) - { - return kilonewtonspercubicmillimeter.HasValue ? FromKilonewtonsPerCubicMillimeter(kilonewtonspercubicmillimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilopoundsForcePerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilopoundsForcePerCubicFoot(QuantityValue? kilopoundsforcepercubicfoot) - { - return kilopoundsforcepercubicfoot.HasValue ? FromKilopoundsForcePerCubicFoot(kilopoundsforcepercubicfoot.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable KilopoundsForcePerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromKilopoundsForcePerCubicInch(QuantityValue? kilopoundsforcepercubicinch) - { - return kilopoundsforcepercubicinch.HasValue ? FromKilopoundsForcePerCubicInch(kilopoundsforcepercubicinch.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable MeganewtonsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromMeganewtonsPerCubicMeter(QuantityValue? meganewtonspercubicmeter) - { - return meganewtonspercubicmeter.HasValue ? FromMeganewtonsPerCubicMeter(meganewtonspercubicmeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable NewtonsPerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromNewtonsPerCubicCentimeter(QuantityValue? newtonspercubiccentimeter) - { - return newtonspercubiccentimeter.HasValue ? FromNewtonsPerCubicCentimeter(newtonspercubiccentimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable NewtonsPerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromNewtonsPerCubicMeter(QuantityValue? newtonspercubicmeter) - { - return newtonspercubicmeter.HasValue ? FromNewtonsPerCubicMeter(newtonspercubicmeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable NewtonsPerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromNewtonsPerCubicMillimeter(QuantityValue? newtonspercubicmillimeter) - { - return newtonspercubicmillimeter.HasValue ? FromNewtonsPerCubicMillimeter(newtonspercubicmillimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable PoundsForcePerCubicFoot. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromPoundsForcePerCubicFoot(QuantityValue? poundsforcepercubicfoot) - { - return poundsforcepercubicfoot.HasValue ? FromPoundsForcePerCubicFoot(poundsforcepercubicfoot.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable PoundsForcePerCubicInch. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromPoundsForcePerCubicInch(QuantityValue? poundsforcepercubicinch) - { - return poundsforcepercubicinch.HasValue ? FromPoundsForcePerCubicInch(poundsforcepercubicinch.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable TonnesForcePerCubicCentimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromTonnesForcePerCubicCentimeter(QuantityValue? tonnesforcepercubiccentimeter) - { - return tonnesforcepercubiccentimeter.HasValue ? FromTonnesForcePerCubicCentimeter(tonnesforcepercubiccentimeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable TonnesForcePerCubicMeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromTonnesForcePerCubicMeter(QuantityValue? tonnesforcepercubicmeter) - { - return tonnesforcepercubicmeter.HasValue ? FromTonnesForcePerCubicMeter(tonnesforcepercubicmeter.Value) : default(SpecificWeight?); - } - - /// - /// Get nullable SpecificWeight from nullable TonnesForcePerCubicMillimeter. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static SpecificWeight? FromTonnesForcePerCubicMillimeter(QuantityValue? tonnesforcepercubicmillimeter) - { - return tonnesforcepercubicmillimeter.HasValue ? FromTonnesForcePerCubicMillimeter(tonnesforcepercubicmillimeter.Value) : default(SpecificWeight?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// SpecificWeight unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static SpecificWeight? From(QuantityValue? value, SpecificWeightUnit fromUnit) - { - return value.HasValue ? new SpecificWeight((double)value.Value, fromUnit) : default(SpecificWeight?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index daf8ab45d8..67c8cadfb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -60,310 +60,6 @@ public partial struct Speed : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Speed from nullable CentimetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromCentimetersPerHour(QuantityValue? centimetersperhour) - { - return centimetersperhour.HasValue ? FromCentimetersPerHour(centimetersperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable CentimetersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromCentimetersPerMinutes(QuantityValue? centimetersperminutes) - { - return centimetersperminutes.HasValue ? FromCentimetersPerMinutes(centimetersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable CentimetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromCentimetersPerSecond(QuantityValue? centimeterspersecond) - { - return centimeterspersecond.HasValue ? FromCentimetersPerSecond(centimeterspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable DecimetersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromDecimetersPerMinutes(QuantityValue? decimetersperminutes) - { - return decimetersperminutes.HasValue ? FromDecimetersPerMinutes(decimetersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable DecimetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromDecimetersPerSecond(QuantityValue? decimeterspersecond) - { - return decimeterspersecond.HasValue ? FromDecimetersPerSecond(decimeterspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable FeetPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromFeetPerHour(QuantityValue? feetperhour) - { - return feetperhour.HasValue ? FromFeetPerHour(feetperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable FeetPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromFeetPerMinute(QuantityValue? feetperminute) - { - return feetperminute.HasValue ? FromFeetPerMinute(feetperminute.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable FeetPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromFeetPerSecond(QuantityValue? feetpersecond) - { - return feetpersecond.HasValue ? FromFeetPerSecond(feetpersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable InchesPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromInchesPerHour(QuantityValue? inchesperhour) - { - return inchesperhour.HasValue ? FromInchesPerHour(inchesperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable InchesPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromInchesPerMinute(QuantityValue? inchesperminute) - { - return inchesperminute.HasValue ? FromInchesPerMinute(inchesperminute.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable InchesPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromInchesPerSecond(QuantityValue? inchespersecond) - { - return inchespersecond.HasValue ? FromInchesPerSecond(inchespersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable KilometersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromKilometersPerHour(QuantityValue? kilometersperhour) - { - return kilometersperhour.HasValue ? FromKilometersPerHour(kilometersperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable KilometersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromKilometersPerMinutes(QuantityValue? kilometersperminutes) - { - return kilometersperminutes.HasValue ? FromKilometersPerMinutes(kilometersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable KilometersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromKilometersPerSecond(QuantityValue? kilometerspersecond) - { - return kilometerspersecond.HasValue ? FromKilometersPerSecond(kilometerspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable Knots. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromKnots(QuantityValue? knots) - { - return knots.HasValue ? FromKnots(knots.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMetersPerHour(QuantityValue? metersperhour) - { - return metersperhour.HasValue ? FromMetersPerHour(metersperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MetersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMetersPerMinutes(QuantityValue? metersperminutes) - { - return metersperminutes.HasValue ? FromMetersPerMinutes(metersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMetersPerSecond(QuantityValue? meterspersecond) - { - return meterspersecond.HasValue ? FromMetersPerSecond(meterspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MicrometersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMicrometersPerMinutes(QuantityValue? micrometersperminutes) - { - return micrometersperminutes.HasValue ? FromMicrometersPerMinutes(micrometersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MicrometersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMicrometersPerSecond(QuantityValue? micrometerspersecond) - { - return micrometerspersecond.HasValue ? FromMicrometersPerSecond(micrometerspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MilesPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMilesPerHour(QuantityValue? milesperhour) - { - return milesperhour.HasValue ? FromMilesPerHour(milesperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MillimetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMillimetersPerHour(QuantityValue? millimetersperhour) - { - return millimetersperhour.HasValue ? FromMillimetersPerHour(millimetersperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MillimetersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMillimetersPerMinutes(QuantityValue? millimetersperminutes) - { - return millimetersperminutes.HasValue ? FromMillimetersPerMinutes(millimetersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable MillimetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromMillimetersPerSecond(QuantityValue? millimeterspersecond) - { - return millimeterspersecond.HasValue ? FromMillimetersPerSecond(millimeterspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable NanometersPerMinutes. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromNanometersPerMinutes(QuantityValue? nanometersperminutes) - { - return nanometersperminutes.HasValue ? FromNanometersPerMinutes(nanometersperminutes.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable NanometersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromNanometersPerSecond(QuantityValue? nanometerspersecond) - { - return nanometerspersecond.HasValue ? FromNanometersPerSecond(nanometerspersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable UsSurveyFeetPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromUsSurveyFeetPerHour(QuantityValue? ussurveyfeetperhour) - { - return ussurveyfeetperhour.HasValue ? FromUsSurveyFeetPerHour(ussurveyfeetperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable UsSurveyFeetPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromUsSurveyFeetPerMinute(QuantityValue? ussurveyfeetperminute) - { - return ussurveyfeetperminute.HasValue ? FromUsSurveyFeetPerMinute(ussurveyfeetperminute.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable UsSurveyFeetPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromUsSurveyFeetPerSecond(QuantityValue? ussurveyfeetpersecond) - { - return ussurveyfeetpersecond.HasValue ? FromUsSurveyFeetPerSecond(ussurveyfeetpersecond.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable YardsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromYardsPerHour(QuantityValue? yardsperhour) - { - return yardsperhour.HasValue ? FromYardsPerHour(yardsperhour.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable YardsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromYardsPerMinute(QuantityValue? yardsperminute) - { - return yardsperminute.HasValue ? FromYardsPerMinute(yardsperminute.Value) : default(Speed?); - } - - /// - /// Get nullable Speed from nullable YardsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Speed? FromYardsPerSecond(QuantityValue? yardspersecond) - { - return yardspersecond.HasValue ? FromYardsPerSecond(yardspersecond.Value) : default(Speed?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Speed unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Speed? From(QuantityValue? value, SpeedUnit fromUnit) - { - return value.HasValue ? new Speed((double)value.Value, fromUnit) : default(Speed?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 920828df1b..7ab3a5d8e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -60,94 +60,6 @@ public partial struct Temperature : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Temperature from nullable DegreesCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesCelsius(QuantityValue? degreescelsius) - { - return degreescelsius.HasValue ? FromDegreesCelsius(degreescelsius.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesDelisle. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesDelisle(QuantityValue? degreesdelisle) - { - return degreesdelisle.HasValue ? FromDegreesDelisle(degreesdelisle.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesFahrenheit. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesFahrenheit(QuantityValue? degreesfahrenheit) - { - return degreesfahrenheit.HasValue ? FromDegreesFahrenheit(degreesfahrenheit.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesNewton. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesNewton(QuantityValue? degreesnewton) - { - return degreesnewton.HasValue ? FromDegreesNewton(degreesnewton.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesRankine. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesRankine(QuantityValue? degreesrankine) - { - return degreesrankine.HasValue ? FromDegreesRankine(degreesrankine.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesReaumur. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesReaumur(QuantityValue? degreesreaumur) - { - return degreesreaumur.HasValue ? FromDegreesReaumur(degreesreaumur.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable DegreesRoemer. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromDegreesRoemer(QuantityValue? degreesroemer) - { - return degreesroemer.HasValue ? FromDegreesRoemer(degreesroemer.Value) : default(Temperature?); - } - - /// - /// Get nullable Temperature from nullable Kelvins. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Temperature? FromKelvins(QuantityValue? kelvins) - { - return kelvins.HasValue ? FromKelvins(kelvins.Value) : default(Temperature?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Temperature unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Temperature? From(QuantityValue? value, TemperatureUnit fromUnit) - { - return value.HasValue ? new Temperature((double)value.Value, fromUnit) : default(Temperature?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 87c254bb63..062ab65d8c 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -60,112 +60,6 @@ public partial struct TemperatureChangeRate : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable TemperatureChangeRate from nullable CentidegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromCentidegreesCelsiusPerSecond(QuantityValue? centidegreescelsiuspersecond) - { - return centidegreescelsiuspersecond.HasValue ? FromCentidegreesCelsiusPerSecond(centidegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable DecadegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromDecadegreesCelsiusPerSecond(QuantityValue? decadegreescelsiuspersecond) - { - return decadegreescelsiuspersecond.HasValue ? FromDecadegreesCelsiusPerSecond(decadegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable DecidegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromDecidegreesCelsiusPerSecond(QuantityValue? decidegreescelsiuspersecond) - { - return decidegreescelsiuspersecond.HasValue ? FromDecidegreesCelsiusPerSecond(decidegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable DegreesCelsiusPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromDegreesCelsiusPerMinute(QuantityValue? degreescelsiusperminute) - { - return degreescelsiusperminute.HasValue ? FromDegreesCelsiusPerMinute(degreescelsiusperminute.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable DegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromDegreesCelsiusPerSecond(QuantityValue? degreescelsiuspersecond) - { - return degreescelsiuspersecond.HasValue ? FromDegreesCelsiusPerSecond(degreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable HectodegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromHectodegreesCelsiusPerSecond(QuantityValue? hectodegreescelsiuspersecond) - { - return hectodegreescelsiuspersecond.HasValue ? FromHectodegreesCelsiusPerSecond(hectodegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable KilodegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromKilodegreesCelsiusPerSecond(QuantityValue? kilodegreescelsiuspersecond) - { - return kilodegreescelsiuspersecond.HasValue ? FromKilodegreesCelsiusPerSecond(kilodegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable MicrodegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromMicrodegreesCelsiusPerSecond(QuantityValue? microdegreescelsiuspersecond) - { - return microdegreescelsiuspersecond.HasValue ? FromMicrodegreesCelsiusPerSecond(microdegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable MillidegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromMillidegreesCelsiusPerSecond(QuantityValue? millidegreescelsiuspersecond) - { - return millidegreescelsiuspersecond.HasValue ? FromMillidegreesCelsiusPerSecond(millidegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Get nullable TemperatureChangeRate from nullable NanodegreesCelsiusPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureChangeRate? FromNanodegreesCelsiusPerSecond(QuantityValue? nanodegreescelsiuspersecond) - { - return nanodegreescelsiuspersecond.HasValue ? FromNanodegreesCelsiusPerSecond(nanodegreescelsiuspersecond.Value) : default(TemperatureChangeRate?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// TemperatureChangeRate unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureChangeRate? From(QuantityValue? value, TemperatureChangeRateUnit fromUnit) - { - return value.HasValue ? new TemperatureChangeRate((double)value.Value, fromUnit) : default(TemperatureChangeRate?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1a85aa86c7..0f8d0ae327 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -60,166 +60,6 @@ public partial struct TemperatureDelta : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable TemperatureDelta from nullable DegreesCelsius. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesCelsius(QuantityValue? degreescelsius) - { - return degreescelsius.HasValue ? FromDegreesCelsius(degreescelsius.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesCelsiusDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesCelsiusDelta(QuantityValue? degreescelsiusdelta) - { - return degreescelsiusdelta.HasValue ? FromDegreesCelsiusDelta(degreescelsiusdelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesDelisle. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesDelisle(QuantityValue? degreesdelisle) - { - return degreesdelisle.HasValue ? FromDegreesDelisle(degreesdelisle.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesDelisleDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesDelisleDelta(QuantityValue? degreesdelisledelta) - { - return degreesdelisledelta.HasValue ? FromDegreesDelisleDelta(degreesdelisledelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesFahrenheit. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesFahrenheit(QuantityValue? degreesfahrenheit) - { - return degreesfahrenheit.HasValue ? FromDegreesFahrenheit(degreesfahrenheit.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesFahrenheitDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesFahrenheitDelta(QuantityValue? degreesfahrenheitdelta) - { - return degreesfahrenheitdelta.HasValue ? FromDegreesFahrenheitDelta(degreesfahrenheitdelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesNewton. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesNewton(QuantityValue? degreesnewton) - { - return degreesnewton.HasValue ? FromDegreesNewton(degreesnewton.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesNewtonDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesNewtonDelta(QuantityValue? degreesnewtondelta) - { - return degreesnewtondelta.HasValue ? FromDegreesNewtonDelta(degreesnewtondelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesRankine. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRankine(QuantityValue? degreesrankine) - { - return degreesrankine.HasValue ? FromDegreesRankine(degreesrankine.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesRankineDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRankineDelta(QuantityValue? degreesrankinedelta) - { - return degreesrankinedelta.HasValue ? FromDegreesRankineDelta(degreesrankinedelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesReaumur. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesReaumur(QuantityValue? degreesreaumur) - { - return degreesreaumur.HasValue ? FromDegreesReaumur(degreesreaumur.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesReaumurDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesReaumurDelta(QuantityValue? degreesreaumurdelta) - { - return degreesreaumurdelta.HasValue ? FromDegreesReaumurDelta(degreesreaumurdelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesRoemer. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRoemer(QuantityValue? degreesroemer) - { - return degreesroemer.HasValue ? FromDegreesRoemer(degreesroemer.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable DegreesRoemerDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromDegreesRoemerDelta(QuantityValue? degreesroemerdelta) - { - return degreesroemerdelta.HasValue ? FromDegreesRoemerDelta(degreesroemerdelta.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable Kelvins. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromKelvins(QuantityValue? kelvins) - { - return kelvins.HasValue ? FromKelvins(kelvins.Value) : default(TemperatureDelta?); - } - - /// - /// Get nullable TemperatureDelta from nullable KelvinsDelta. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static TemperatureDelta? FromKelvinsDelta(QuantityValue? kelvinsdelta) - { - return kelvinsdelta.HasValue ? FromKelvinsDelta(kelvinsdelta.Value) : default(TemperatureDelta?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// TemperatureDelta unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static TemperatureDelta? From(QuantityValue? value, TemperatureDeltaUnit fromUnit) - { - return value.HasValue ? new TemperatureDelta((double)value.Value, fromUnit) : default(TemperatureDelta?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 9d4eb1d11e..81ffdd2ffa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -60,40 +60,6 @@ public partial struct ThermalConductivity : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ThermalConductivity from nullable BtusPerHourFootFahrenheit. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalConductivity? FromBtusPerHourFootFahrenheit(QuantityValue? btusperhourfootfahrenheit) - { - return btusperhourfootfahrenheit.HasValue ? FromBtusPerHourFootFahrenheit(btusperhourfootfahrenheit.Value) : default(ThermalConductivity?); - } - - /// - /// Get nullable ThermalConductivity from nullable WattsPerMeterKelvin. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalConductivity? FromWattsPerMeterKelvin(QuantityValue? wattspermeterkelvin) - { - return wattspermeterkelvin.HasValue ? FromWattsPerMeterKelvin(wattspermeterkelvin.Value) : default(ThermalConductivity?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ThermalConductivity unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalConductivity? From(QuantityValue? value, ThermalConductivityUnit fromUnit) - { - return value.HasValue ? new ThermalConductivity((double)value.Value, fromUnit) : default(ThermalConductivity?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 8924ea7ab4..3b45d7d689 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -60,67 +60,6 @@ public partial struct ThermalResistance : IComparable, IComparable public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable ThermalResistance from nullable HourSquareFeetDegreesFahrenheitPerBtu. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalResistance? FromHourSquareFeetDegreesFahrenheitPerBtu(QuantityValue? hoursquarefeetdegreesfahrenheitperbtu) - { - return hoursquarefeetdegreesfahrenheitperbtu.HasValue ? FromHourSquareFeetDegreesFahrenheitPerBtu(hoursquarefeetdegreesfahrenheitperbtu.Value) : default(ThermalResistance?); - } - - /// - /// Get nullable ThermalResistance from nullable SquareCentimeterHourDegreesCelsiusPerKilocalorie. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalResistance? FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(QuantityValue? squarecentimeterhourdegreescelsiusperkilocalorie) - { - return squarecentimeterhourdegreescelsiusperkilocalorie.HasValue ? FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(squarecentimeterhourdegreescelsiusperkilocalorie.Value) : default(ThermalResistance?); - } - - /// - /// Get nullable ThermalResistance from nullable SquareCentimeterKelvinsPerWatt. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalResistance? FromSquareCentimeterKelvinsPerWatt(QuantityValue? squarecentimeterkelvinsperwatt) - { - return squarecentimeterkelvinsperwatt.HasValue ? FromSquareCentimeterKelvinsPerWatt(squarecentimeterkelvinsperwatt.Value) : default(ThermalResistance?); - } - - /// - /// Get nullable ThermalResistance from nullable SquareMeterDegreesCelsiusPerWatt. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalResistance? FromSquareMeterDegreesCelsiusPerWatt(QuantityValue? squaremeterdegreescelsiusperwatt) - { - return squaremeterdegreescelsiusperwatt.HasValue ? FromSquareMeterDegreesCelsiusPerWatt(squaremeterdegreescelsiusperwatt.Value) : default(ThermalResistance?); - } - - /// - /// Get nullable ThermalResistance from nullable SquareMeterKelvinsPerKilowatt. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static ThermalResistance? FromSquareMeterKelvinsPerKilowatt(QuantityValue? squaremeterkelvinsperkilowatt) - { - return squaremeterkelvinsperkilowatt.HasValue ? FromSquareMeterKelvinsPerKilowatt(squaremeterkelvinsperkilowatt.Value) : default(ThermalResistance?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// ThermalResistance unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static ThermalResistance? From(QuantityValue? value, ThermalResistanceUnit fromUnit) - { - return value.HasValue ? new ThermalResistance((double)value.Value, fromUnit) : default(ThermalResistance?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 3f03228011..50170a5ffa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -60,211 +60,6 @@ public partial struct Torque : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Torque from nullable KilogramForceCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilogramForceCentimeters(QuantityValue? kilogramforcecentimeters) - { - return kilogramforcecentimeters.HasValue ? FromKilogramForceCentimeters(kilogramforcecentimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilogramForceMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilogramForceMeters(QuantityValue? kilogramforcemeters) - { - return kilogramforcemeters.HasValue ? FromKilogramForceMeters(kilogramforcemeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilogramForceMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilogramForceMillimeters(QuantityValue? kilogramforcemillimeters) - { - return kilogramforcemillimeters.HasValue ? FromKilogramForceMillimeters(kilogramforcemillimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilonewtonCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilonewtonCentimeters(QuantityValue? kilonewtoncentimeters) - { - return kilonewtoncentimeters.HasValue ? FromKilonewtonCentimeters(kilonewtoncentimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilonewtonMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilonewtonMeters(QuantityValue? kilonewtonmeters) - { - return kilonewtonmeters.HasValue ? FromKilonewtonMeters(kilonewtonmeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilonewtonMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilonewtonMillimeters(QuantityValue? kilonewtonmillimeters) - { - return kilonewtonmillimeters.HasValue ? FromKilonewtonMillimeters(kilonewtonmillimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilopoundForceFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilopoundForceFeet(QuantityValue? kilopoundforcefeet) - { - return kilopoundforcefeet.HasValue ? FromKilopoundForceFeet(kilopoundforcefeet.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable KilopoundForceInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromKilopoundForceInches(QuantityValue? kilopoundforceinches) - { - return kilopoundforceinches.HasValue ? FromKilopoundForceInches(kilopoundforceinches.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable MeganewtonCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromMeganewtonCentimeters(QuantityValue? meganewtoncentimeters) - { - return meganewtoncentimeters.HasValue ? FromMeganewtonCentimeters(meganewtoncentimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable MeganewtonMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromMeganewtonMeters(QuantityValue? meganewtonmeters) - { - return meganewtonmeters.HasValue ? FromMeganewtonMeters(meganewtonmeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable MeganewtonMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromMeganewtonMillimeters(QuantityValue? meganewtonmillimeters) - { - return meganewtonmillimeters.HasValue ? FromMeganewtonMillimeters(meganewtonmillimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable MegapoundForceFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromMegapoundForceFeet(QuantityValue? megapoundforcefeet) - { - return megapoundforcefeet.HasValue ? FromMegapoundForceFeet(megapoundforcefeet.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable MegapoundForceInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromMegapoundForceInches(QuantityValue? megapoundforceinches) - { - return megapoundforceinches.HasValue ? FromMegapoundForceInches(megapoundforceinches.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable NewtonCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromNewtonCentimeters(QuantityValue? newtoncentimeters) - { - return newtoncentimeters.HasValue ? FromNewtonCentimeters(newtoncentimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable NewtonMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromNewtonMeters(QuantityValue? newtonmeters) - { - return newtonmeters.HasValue ? FromNewtonMeters(newtonmeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable NewtonMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromNewtonMillimeters(QuantityValue? newtonmillimeters) - { - return newtonmillimeters.HasValue ? FromNewtonMillimeters(newtonmillimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable PoundForceFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromPoundForceFeet(QuantityValue? poundforcefeet) - { - return poundforcefeet.HasValue ? FromPoundForceFeet(poundforcefeet.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable PoundForceInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromPoundForceInches(QuantityValue? poundforceinches) - { - return poundforceinches.HasValue ? FromPoundForceInches(poundforceinches.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable TonneForceCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromTonneForceCentimeters(QuantityValue? tonneforcecentimeters) - { - return tonneforcecentimeters.HasValue ? FromTonneForceCentimeters(tonneforcecentimeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable TonneForceMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromTonneForceMeters(QuantityValue? tonneforcemeters) - { - return tonneforcemeters.HasValue ? FromTonneForceMeters(tonneforcemeters.Value) : default(Torque?); - } - - /// - /// Get nullable Torque from nullable TonneForceMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Torque? FromTonneForceMillimeters(QuantityValue? tonneforcemillimeters) - { - return tonneforcemillimeters.HasValue ? FromTonneForceMillimeters(tonneforcemillimeters.Value) : default(Torque?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Torque unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Torque? From(QuantityValue? value, TorqueUnit fromUnit) - { - return value.HasValue ? new Torque((double)value.Value, fromUnit) : default(Torque?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index b8ff7ad03b..6c99c82e48 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -60,31 +60,6 @@ public partial struct VitaminA : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable VitaminA from nullable InternationalUnits. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VitaminA? FromInternationalUnits(QuantityValue? internationalunits) - { - return internationalunits.HasValue ? FromInternationalUnits(internationalunits.Value) : default(VitaminA?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// VitaminA unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VitaminA? From(QuantityValue? value, VitaminAUnit fromUnit) - { - return value.HasValue ? new VitaminA((double)value.Value, fromUnit) : default(VitaminA?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 17ec35b34f..edf3e0e025 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -60,418 +60,6 @@ public partial struct Volume : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable Volume from nullable AuTablespoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromAuTablespoons(QuantityValue? autablespoons) - { - return autablespoons.HasValue ? FromAuTablespoons(autablespoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Centiliters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCentiliters(QuantityValue? centiliters) - { - return centiliters.HasValue ? FromCentiliters(centiliters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicCentimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicCentimeters(QuantityValue? cubiccentimeters) - { - return cubiccentimeters.HasValue ? FromCubicCentimeters(cubiccentimeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicDecimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicDecimeters(QuantityValue? cubicdecimeters) - { - return cubicdecimeters.HasValue ? FromCubicDecimeters(cubicdecimeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicFeet(QuantityValue? cubicfeet) - { - return cubicfeet.HasValue ? FromCubicFeet(cubicfeet.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicInches. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicInches(QuantityValue? cubicinches) - { - return cubicinches.HasValue ? FromCubicInches(cubicinches.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicKilometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicKilometers(QuantityValue? cubickilometers) - { - return cubickilometers.HasValue ? FromCubicKilometers(cubickilometers.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicMeters(QuantityValue? cubicmeters) - { - return cubicmeters.HasValue ? FromCubicMeters(cubicmeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicMicrometers. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicMicrometers(QuantityValue? cubicmicrometers) - { - return cubicmicrometers.HasValue ? FromCubicMicrometers(cubicmicrometers.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicMiles. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicMiles(QuantityValue? cubicmiles) - { - return cubicmiles.HasValue ? FromCubicMiles(cubicmiles.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicMillimeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicMillimeters(QuantityValue? cubicmillimeters) - { - return cubicmillimeters.HasValue ? FromCubicMillimeters(cubicmillimeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable CubicYards. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromCubicYards(QuantityValue? cubicyards) - { - return cubicyards.HasValue ? FromCubicYards(cubicyards.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Deciliters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromDeciliters(QuantityValue? deciliters) - { - return deciliters.HasValue ? FromDeciliters(deciliters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable HectocubicFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromHectocubicFeet(QuantityValue? hectocubicfeet) - { - return hectocubicfeet.HasValue ? FromHectocubicFeet(hectocubicfeet.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable HectocubicMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromHectocubicMeters(QuantityValue? hectocubicmeters) - { - return hectocubicmeters.HasValue ? FromHectocubicMeters(hectocubicmeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Hectoliters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromHectoliters(QuantityValue? hectoliters) - { - return hectoliters.HasValue ? FromHectoliters(hectoliters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable ImperialBeerBarrels. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromImperialBeerBarrels(QuantityValue? imperialbeerbarrels) - { - return imperialbeerbarrels.HasValue ? FromImperialBeerBarrels(imperialbeerbarrels.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable ImperialGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromImperialGallons(QuantityValue? imperialgallons) - { - return imperialgallons.HasValue ? FromImperialGallons(imperialgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable ImperialOunces. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromImperialOunces(QuantityValue? imperialounces) - { - return imperialounces.HasValue ? FromImperialOunces(imperialounces.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable KilocubicFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromKilocubicFeet(QuantityValue? kilocubicfeet) - { - return kilocubicfeet.HasValue ? FromKilocubicFeet(kilocubicfeet.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable KilocubicMeters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromKilocubicMeters(QuantityValue? kilocubicmeters) - { - return kilocubicmeters.HasValue ? FromKilocubicMeters(kilocubicmeters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable KiloimperialGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromKiloimperialGallons(QuantityValue? kiloimperialgallons) - { - return kiloimperialgallons.HasValue ? FromKiloimperialGallons(kiloimperialgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable KilousGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromKilousGallons(QuantityValue? kilousgallons) - { - return kilousgallons.HasValue ? FromKilousGallons(kilousgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Liters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromLiters(QuantityValue? liters) - { - return liters.HasValue ? FromLiters(liters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable MegacubicFeet. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMegacubicFeet(QuantityValue? megacubicfeet) - { - return megacubicfeet.HasValue ? FromMegacubicFeet(megacubicfeet.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable MegaimperialGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMegaimperialGallons(QuantityValue? megaimperialgallons) - { - return megaimperialgallons.HasValue ? FromMegaimperialGallons(megaimperialgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable MegausGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMegausGallons(QuantityValue? megausgallons) - { - return megausgallons.HasValue ? FromMegausGallons(megausgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable MetricCups. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMetricCups(QuantityValue? metriccups) - { - return metriccups.HasValue ? FromMetricCups(metriccups.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable MetricTeaspoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMetricTeaspoons(QuantityValue? metricteaspoons) - { - return metricteaspoons.HasValue ? FromMetricTeaspoons(metricteaspoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Microliters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMicroliters(QuantityValue? microliters) - { - return microliters.HasValue ? FromMicroliters(microliters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Milliliters. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromMilliliters(QuantityValue? milliliters) - { - return milliliters.HasValue ? FromMilliliters(milliliters.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable OilBarrels. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromOilBarrels(QuantityValue? oilbarrels) - { - return oilbarrels.HasValue ? FromOilBarrels(oilbarrels.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Tablespoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromTablespoons(QuantityValue? tablespoons) - { - return tablespoons.HasValue ? FromTablespoons(tablespoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable Teaspoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromTeaspoons(QuantityValue? teaspoons) - { - return teaspoons.HasValue ? FromTeaspoons(teaspoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UkTablespoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUkTablespoons(QuantityValue? uktablespoons) - { - return uktablespoons.HasValue ? FromUkTablespoons(uktablespoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsBeerBarrels. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsBeerBarrels(QuantityValue? usbeerbarrels) - { - return usbeerbarrels.HasValue ? FromUsBeerBarrels(usbeerbarrels.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsCustomaryCups. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsCustomaryCups(QuantityValue? uscustomarycups) - { - return uscustomarycups.HasValue ? FromUsCustomaryCups(uscustomarycups.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsGallons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsGallons(QuantityValue? usgallons) - { - return usgallons.HasValue ? FromUsGallons(usgallons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsLegalCups. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsLegalCups(QuantityValue? uslegalcups) - { - return uslegalcups.HasValue ? FromUsLegalCups(uslegalcups.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsOunces. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsOunces(QuantityValue? usounces) - { - return usounces.HasValue ? FromUsOunces(usounces.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsPints. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsPints(QuantityValue? uspints) - { - return uspints.HasValue ? FromUsPints(uspints.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsQuarts. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsQuarts(QuantityValue? usquarts) - { - return usquarts.HasValue ? FromUsQuarts(usquarts.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsTablespoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsTablespoons(QuantityValue? ustablespoons) - { - return ustablespoons.HasValue ? FromUsTablespoons(ustablespoons.Value) : default(Volume?); - } - - /// - /// Get nullable Volume from nullable UsTeaspoons. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static Volume? FromUsTeaspoons(QuantityValue? usteaspoons) - { - return usteaspoons.HasValue ? FromUsTeaspoons(usteaspoons.Value) : default(Volume?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// Volume unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static Volume? From(QuantityValue? value, VolumeUnit fromUnit) - { - return value.HasValue ? new Volume((double)value.Value, fromUnit) : default(Volume?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index c4f7944647..e3c5183310 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -60,256 +60,6 @@ public partial struct VolumeFlow : IComparable, IComparable ///
public double Value => _value; - #region Nullable From Methods - - /// - /// Get nullable VolumeFlow from nullable CentilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCentilitersPerMinute(QuantityValue? centilitersperminute) - { - return centilitersperminute.HasValue ? FromCentilitersPerMinute(centilitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicDecimetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicDecimetersPerMinute(QuantityValue? cubicdecimetersperminute) - { - return cubicdecimetersperminute.HasValue ? FromCubicDecimetersPerMinute(cubicdecimetersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicFeetPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicFeetPerHour(QuantityValue? cubicfeetperhour) - { - return cubicfeetperhour.HasValue ? FromCubicFeetPerHour(cubicfeetperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicFeetPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicFeetPerMinute(QuantityValue? cubicfeetperminute) - { - return cubicfeetperminute.HasValue ? FromCubicFeetPerMinute(cubicfeetperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicFeetPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicFeetPerSecond(QuantityValue? cubicfeetpersecond) - { - return cubicfeetpersecond.HasValue ? FromCubicFeetPerSecond(cubicfeetpersecond.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicMetersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicMetersPerHour(QuantityValue? cubicmetersperhour) - { - return cubicmetersperhour.HasValue ? FromCubicMetersPerHour(cubicmetersperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicMetersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicMetersPerMinute(QuantityValue? cubicmetersperminute) - { - return cubicmetersperminute.HasValue ? FromCubicMetersPerMinute(cubicmetersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicMetersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicMetersPerSecond(QuantityValue? cubicmeterspersecond) - { - return cubicmeterspersecond.HasValue ? FromCubicMetersPerSecond(cubicmeterspersecond.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicYardsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicYardsPerHour(QuantityValue? cubicyardsperhour) - { - return cubicyardsperhour.HasValue ? FromCubicYardsPerHour(cubicyardsperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicYardsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicYardsPerMinute(QuantityValue? cubicyardsperminute) - { - return cubicyardsperminute.HasValue ? FromCubicYardsPerMinute(cubicyardsperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable CubicYardsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromCubicYardsPerSecond(QuantityValue? cubicyardspersecond) - { - return cubicyardspersecond.HasValue ? FromCubicYardsPerSecond(cubicyardspersecond.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable DecilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromDecilitersPerMinute(QuantityValue? decilitersperminute) - { - return decilitersperminute.HasValue ? FromDecilitersPerMinute(decilitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable KilolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromKilolitersPerMinute(QuantityValue? kilolitersperminute) - { - return kilolitersperminute.HasValue ? FromKilolitersPerMinute(kilolitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable LitersPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromLitersPerHour(QuantityValue? litersperhour) - { - return litersperhour.HasValue ? FromLitersPerHour(litersperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable LitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromLitersPerMinute(QuantityValue? litersperminute) - { - return litersperminute.HasValue ? FromLitersPerMinute(litersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable LitersPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromLitersPerSecond(QuantityValue? literspersecond) - { - return literspersecond.HasValue ? FromLitersPerSecond(literspersecond.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable MicrolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromMicrolitersPerMinute(QuantityValue? microlitersperminute) - { - return microlitersperminute.HasValue ? FromMicrolitersPerMinute(microlitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable MillilitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromMillilitersPerMinute(QuantityValue? millilitersperminute) - { - return millilitersperminute.HasValue ? FromMillilitersPerMinute(millilitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable MillionUsGallonsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromMillionUsGallonsPerDay(QuantityValue? millionusgallonsperday) - { - return millionusgallonsperday.HasValue ? FromMillionUsGallonsPerDay(millionusgallonsperday.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable NanolitersPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromNanolitersPerMinute(QuantityValue? nanolitersperminute) - { - return nanolitersperminute.HasValue ? FromNanolitersPerMinute(nanolitersperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable OilBarrelsPerDay. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromOilBarrelsPerDay(QuantityValue? oilbarrelsperday) - { - return oilbarrelsperday.HasValue ? FromOilBarrelsPerDay(oilbarrelsperday.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable OilBarrelsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromOilBarrelsPerHour(QuantityValue? oilbarrelsperhour) - { - return oilbarrelsperhour.HasValue ? FromOilBarrelsPerHour(oilbarrelsperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable OilBarrelsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromOilBarrelsPerMinute(QuantityValue? oilbarrelsperminute) - { - return oilbarrelsperminute.HasValue ? FromOilBarrelsPerMinute(oilbarrelsperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable UsGallonsPerHour. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromUsGallonsPerHour(QuantityValue? usgallonsperhour) - { - return usgallonsperhour.HasValue ? FromUsGallonsPerHour(usgallonsperhour.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable UsGallonsPerMinute. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromUsGallonsPerMinute(QuantityValue? usgallonsperminute) - { - return usgallonsperminute.HasValue ? FromUsGallonsPerMinute(usgallonsperminute.Value) : default(VolumeFlow?); - } - - /// - /// Get nullable VolumeFlow from nullable UsGallonsPerSecond. - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static VolumeFlow? FromUsGallonsPerSecond(QuantityValue? usgallonspersecond) - { - return usgallonspersecond.HasValue ? FromUsGallonsPerSecond(usgallonspersecond.Value) : default(VolumeFlow?); - } - - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// VolumeFlow unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static VolumeFlow? From(QuantityValue? value, VolumeFlowUnit fromUnit) - { - return value.HasValue ? new VolumeFlow((double)value.Value, fromUnit) : default(VolumeFlow?); - } - - #endregion - /// /// Get unit abbreviation string. /// diff --git a/UnitsNet/Scripts/Include-GenerateNumberExtensionsSourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateNumberExtensionsSourceCode.ps1 index 2c931d79f1..b571c0ee0c 100644 --- a/UnitsNet/Scripts/Include-GenerateNumberExtensionsSourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateNumberExtensionsSourceCode.ps1 @@ -60,17 +60,9 @@ namespace UnitsNet.Extensions.NumberTo$quantityName # We add "OmitExtensionMethod": true on all but one of the conflicting units in JSON. if ($unit.OmitExtensionMethod) { continue } @" - #region $($unit.SingularName) - /// $($obsoleteAttribute) public static $quantityName $($unit.PluralName)(this T value) => $quantityName.From$($unit.PluralName)(Convert.ToDouble(value)); - /// - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static $($quantityName)? $($unit.PluralName)(this T? value) where T : struct => $quantityName.From$($unit.PluralName)(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - "@; }@" } } diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 6baf780cb9..a3b5d20a85 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -101,34 +101,6 @@ namespace UnitsNet ///
public $baseType Value => _value; - #region Nullable From Methods - -"@; foreach ($unit in $units) { - $valueParamName = $unit.PluralName.ToLowerInvariant();@" - /// - /// Get nullable $quantityName from nullable $($unit.PluralName). - /// - [Obsolete("Nullable type support is obsolete and will be removed in a future release.")] - public static $($quantityName)? From$($unit.PluralName)($($quantityValueType)? $valueParamName) - { - return $($valueParamName).HasValue ? From$($unit.PluralName)($($valueParamName).Value) : default($($quantityName)?); - } - -"@; }@" - /// - /// Dynamically convert from value and unit enum to . - /// - /// Value to convert from. - /// Unit to convert from. - /// $quantityName unit value. - [Obsolete("Nullable type support has been deprecated and will be removed in a future release.")] - public static $($quantityName)? From($($quantityValueType)? value, $unitEnumName fromUnit) - { - return value.HasValue ? new $quantityName(($baseType)value.Value, fromUnit) : default($($quantityName)?); - } - - #endregion - /// /// Get unit abbreviation string. /// From 71c0b1f4c172e3c03ca71170e53d589511e1193c Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Fri, 28 Sep 2018 10:23:20 -0400 Subject: [PATCH 4/5] ParseUnit(string, string) needs to be split in code generators. The .NET Framwork version is obsolete and will be removed in the future, but the WRC version is not and would be a breaking change to remove. --- .../Quantities/Acceleration.Common.g.cs | 16 ---------------- .../Quantities/AmountOfSubstance.Common.g.cs | 16 ---------------- .../Quantities/AmplitudeRatio.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Angle.Common.g.cs | 16 ---------------- .../Quantities/ApparentEnergy.Common.g.cs | 16 ---------------- .../Quantities/ApparentPower.Common.g.cs | 16 ---------------- Common/GeneratedCode/Quantities/Area.Common.g.cs | 16 ---------------- .../Quantities/AreaDensity.Common.g.cs | 16 ---------------- .../Quantities/AreaMomentOfInertia.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/BitRate.Common.g.cs | 16 ---------------- .../BrakeSpecificFuelConsumption.Common.g.cs | 16 ---------------- .../Quantities/Capacitance.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Density.Common.g.cs | 16 ---------------- .../Quantities/Duration.Common.g.cs | 16 ---------------- .../Quantities/DynamicViscosity.Common.g.cs | 16 ---------------- .../Quantities/ElectricAdmittance.Common.g.cs | 16 ---------------- .../Quantities/ElectricCharge.Common.g.cs | 16 ---------------- .../Quantities/ElectricChargeDensity.Common.g.cs | 16 ---------------- .../Quantities/ElectricConductance.Common.g.cs | 16 ---------------- .../Quantities/ElectricConductivity.Common.g.cs | 16 ---------------- .../Quantities/ElectricCurrent.Common.g.cs | 16 ---------------- .../ElectricCurrentDensity.Common.g.cs | 16 ---------------- .../ElectricCurrentGradient.Common.g.cs | 16 ---------------- .../Quantities/ElectricField.Common.g.cs | 16 ---------------- .../Quantities/ElectricInductance.Common.g.cs | 16 ---------------- .../Quantities/ElectricPotential.Common.g.cs | 16 ---------------- .../Quantities/ElectricPotentialAc.Common.g.cs | 16 ---------------- .../Quantities/ElectricPotentialDc.Common.g.cs | 16 ---------------- .../Quantities/ElectricResistance.Common.g.cs | 16 ---------------- .../Quantities/ElectricResistivity.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Energy.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Entropy.Common.g.cs | 16 ---------------- Common/GeneratedCode/Quantities/Flow.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Force.Common.g.cs | 16 ---------------- .../Quantities/ForceChangeRate.Common.g.cs | 16 ---------------- .../Quantities/ForcePerLength.Common.g.cs | 16 ---------------- .../Quantities/Frequency.Common.g.cs | 16 ---------------- .../Quantities/HeatFlux.Common.g.cs | 16 ---------------- .../HeatTransferCoefficient.Common.g.cs | 16 ---------------- .../Quantities/Illuminance.Common.g.cs | 16 ---------------- .../Quantities/Information.Common.g.cs | 16 ---------------- .../Quantities/Irradiance.Common.g.cs | 16 ---------------- .../Quantities/Irradiation.Common.g.cs | 16 ---------------- .../Quantities/KinematicViscosity.Common.g.cs | 16 ---------------- .../Quantities/LapseRate.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Length.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Level.Common.g.cs | 16 ---------------- .../Quantities/LinearDensity.Common.g.cs | 16 ---------------- .../Quantities/LuminousFlux.Common.g.cs | 16 ---------------- .../Quantities/LuminousIntensity.Common.g.cs | 16 ---------------- .../Quantities/MagneticField.Common.g.cs | 16 ---------------- .../Quantities/MagneticFlux.Common.g.cs | 16 ---------------- .../Quantities/Magnetization.Common.g.cs | 16 ---------------- Common/GeneratedCode/Quantities/Mass.Common.g.cs | 16 ---------------- .../Quantities/MassFlow.Common.g.cs | 16 ---------------- .../Quantities/MassFlux.Common.g.cs | 16 ---------------- .../Quantities/MassMomentOfInertia.Common.g.cs | 16 ---------------- .../Quantities/MolarEnergy.Common.g.cs | 16 ---------------- .../Quantities/MolarEntropy.Common.g.cs | 16 ---------------- .../Quantities/MolarMass.Common.g.cs | 16 ---------------- .../Quantities/Molarity.Common.g.cs | 16 ---------------- .../Quantities/Permeability.Common.g.cs | 16 ---------------- .../Quantities/Permittivity.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Power.Common.g.cs | 16 ---------------- .../Quantities/PowerDensity.Common.g.cs | 16 ---------------- .../Quantities/PowerRatio.Common.g.cs | 16 ---------------- .../Quantities/Pressure.Common.g.cs | 16 ---------------- .../Quantities/PressureChangeRate.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Ratio.Common.g.cs | 16 ---------------- .../Quantities/ReactiveEnergy.Common.g.cs | 16 ---------------- .../Quantities/ReactivePower.Common.g.cs | 16 ---------------- .../RotationalAcceleration.Common.g.cs | 16 ---------------- .../Quantities/RotationalSpeed.Common.g.cs | 16 ---------------- .../Quantities/RotationalStiffness.Common.g.cs | 16 ---------------- .../RotationalStiffnessPerLength.Common.g.cs | 16 ---------------- .../Quantities/SolidAngle.Common.g.cs | 16 ---------------- .../Quantities/SpecificEnergy.Common.g.cs | 16 ---------------- .../Quantities/SpecificEntropy.Common.g.cs | 16 ---------------- .../Quantities/SpecificVolume.Common.g.cs | 16 ---------------- .../Quantities/SpecificWeight.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Speed.Common.g.cs | 16 ---------------- .../Quantities/Temperature.Common.g.cs | 16 ---------------- .../Quantities/TemperatureChangeRate.Common.g.cs | 16 ---------------- .../Quantities/TemperatureDelta.Common.g.cs | 16 ---------------- .../Quantities/ThermalConductivity.Common.g.cs | 16 ---------------- .../Quantities/ThermalResistance.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Torque.Common.g.cs | 16 ---------------- .../Quantities/VitaminA.Common.g.cs | 16 ---------------- .../GeneratedCode/Quantities/Volume.Common.g.cs | 16 ---------------- .../Quantities/VolumeFlow.Common.g.cs | 16 ---------------- .../Acceleration.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...mountOfSubstance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../AmplitudeRatio.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Angle.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ApparentEnergy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ApparentPower.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Quantities/Area.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../AreaDensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...aMomentOfInertia.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../BitRate.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...cFuelConsumption.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Capacitance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Density.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Duration.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...DynamicViscosity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ectricAdmittance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ElectricCharge.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ricChargeDensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ctricConductance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...tricConductivity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ElectricCurrent.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...icCurrentDensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...cCurrentGradient.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ElectricField.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ectricInductance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...lectricPotential.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ctricPotentialAc.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ctricPotentialDc.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ectricResistance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ctricResistivity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Energy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Entropy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Quantities/Flow.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Force.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ForceChangeRate.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ForcePerLength.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Frequency.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../HeatFlux.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...nsferCoefficient.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Illuminance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Information.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Irradiance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Irradiation.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...nematicViscosity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../LapseRate.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Length.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Level.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../LinearDensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../LuminousFlux.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...uminousIntensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MagneticField.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MagneticFlux.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Magnetization.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Quantities/Mass.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MassFlow.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MassFlux.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...sMomentOfInertia.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MolarEnergy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MolarEntropy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../MolarMass.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Molarity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Permeability.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Permittivity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Power.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../PowerDensity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../PowerRatio.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Pressure.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...essureChangeRate.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Ratio.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ReactiveEnergy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../ReactivePower.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...onalAcceleration.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../RotationalSpeed.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ationalStiffness.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...iffnessPerLength.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../SolidAngle.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../SpecificEnergy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../SpecificEntropy.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../SpecificVolume.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../SpecificWeight.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Speed.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Temperature.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...ratureChangeRate.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...TemperatureDelta.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...rmalConductivity.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ ...hermalResistance.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Torque.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../VitaminA.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Volume.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../VolumeFlow.WindowsRuntimeComponent.g.cs | 15 +++++++++++++++ .../Quantities/Acceleration.NetFramework.g.cs | 16 ++++++++++++++++ .../AmountOfSubstance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/AmplitudeRatio.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Angle.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ApparentEnergy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ApparentPower.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Area.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/AreaDensity.NetFramework.g.cs | 16 ++++++++++++++++ .../AreaMomentOfInertia.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/BitRate.NetFramework.g.cs | 16 ++++++++++++++++ ...rakeSpecificFuelConsumption.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Capacitance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Density.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Duration.NetFramework.g.cs | 16 ++++++++++++++++ .../DynamicViscosity.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricAdmittance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ElectricCharge.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricChargeDensity.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricConductance.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricConductivity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ElectricCurrent.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricCurrentDensity.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricCurrentGradient.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ElectricField.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricInductance.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricPotential.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricPotentialAc.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricPotentialDc.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricResistance.NetFramework.g.cs | 16 ++++++++++++++++ .../ElectricResistivity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Energy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Entropy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Flow.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Force.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ForceChangeRate.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ForcePerLength.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Frequency.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/HeatFlux.NetFramework.g.cs | 16 ++++++++++++++++ .../HeatTransferCoefficient.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Illuminance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Information.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Irradiance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Irradiation.NetFramework.g.cs | 16 ++++++++++++++++ .../KinematicViscosity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/LapseRate.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Length.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Level.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/LinearDensity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/LuminousFlux.NetFramework.g.cs | 16 ++++++++++++++++ .../LuminousIntensity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MagneticField.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MagneticFlux.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Magnetization.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Mass.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MassFlow.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MassFlux.NetFramework.g.cs | 16 ++++++++++++++++ .../MassMomentOfInertia.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MolarEnergy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MolarEntropy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/MolarMass.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Molarity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Permeability.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Permittivity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Power.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/PowerDensity.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/PowerRatio.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Pressure.NetFramework.g.cs | 16 ++++++++++++++++ .../PressureChangeRate.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Ratio.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ReactiveEnergy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/ReactivePower.NetFramework.g.cs | 16 ++++++++++++++++ .../RotationalAcceleration.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/RotationalSpeed.NetFramework.g.cs | 16 ++++++++++++++++ .../RotationalStiffness.NetFramework.g.cs | 16 ++++++++++++++++ ...otationalStiffnessPerLength.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/SolidAngle.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/SpecificEnergy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/SpecificEntropy.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/SpecificVolume.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/SpecificWeight.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Speed.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Temperature.NetFramework.g.cs | 16 ++++++++++++++++ .../TemperatureChangeRate.NetFramework.g.cs | 16 ++++++++++++++++ .../TemperatureDelta.NetFramework.g.cs | 16 ++++++++++++++++ .../ThermalConductivity.NetFramework.g.cs | 16 ++++++++++++++++ .../ThermalResistance.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Torque.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/VitaminA.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/Volume.NetFramework.g.cs | 16 ++++++++++++++++ .../Quantities/VolumeFlow.NetFramework.g.cs | 16 ++++++++++++++++ .../Include-GenerateQuantitySourceCodeCommon.ps1 | 16 ---------------- ...de-GenerateQuantitySourceCodeNetFramework.ps1 | 16 ++++++++++++++++ ...QuantitySourceCodeWindowsRuntimeComponent.ps1 | 15 +++++++++++++++ 273 files changed, 2821 insertions(+), 1456 deletions(-) diff --git a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs index 32ed95e2f8..20cdb98eb1 100644 --- a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs @@ -692,22 +692,6 @@ public static AccelerationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs index e09c313bdc..4a37a5e1db 100644 --- a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs @@ -713,22 +713,6 @@ public static AmountOfSubstanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AmountOfSubstanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs index 8bb678bbd7..8f76f2ceda 100644 --- a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs @@ -502,22 +502,6 @@ public static AmplitudeRatioUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AmplitudeRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Angle.Common.g.cs b/Common/GeneratedCode/Quantities/Angle.Common.g.cs index 224eb7ae1d..6fc2f691d6 100644 --- a/Common/GeneratedCode/Quantities/Angle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Angle.Common.g.cs @@ -712,22 +712,6 @@ public static AngleUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AngleUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs index b360e90d45..c63c38b73c 100644 --- a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs @@ -482,22 +482,6 @@ public static ApparentEnergyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ApparentEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs index 20c782523c..f9983c34cc 100644 --- a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs @@ -503,22 +503,6 @@ public static ApparentPowerUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ApparentPowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Area.Common.g.cs b/Common/GeneratedCode/Quantities/Area.Common.g.cs index cabdafbce9..7cda67fda6 100644 --- a/Common/GeneratedCode/Quantities/Area.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Area.Common.g.cs @@ -692,22 +692,6 @@ public static AreaUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AreaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs index d016ade809..5c826bd6d9 100644 --- a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs @@ -440,22 +440,6 @@ public static AreaDensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AreaDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs index 1cee90c5dc..d374af505b 100644 --- a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs @@ -545,22 +545,6 @@ public static AreaMomentOfInertiaUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static AreaMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs index 7f7fb55004..4f23de2ee9 100644 --- a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs @@ -963,22 +963,6 @@ public static BitRateUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static BitRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs index c762e6824c..775e0bb39d 100644 --- a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs @@ -482,22 +482,6 @@ public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs index 97b3266b6b..51f4d7b426 100644 --- a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs @@ -440,22 +440,6 @@ public static CapacitanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static CapacitanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Density.Common.g.cs b/Common/GeneratedCode/Quantities/Density.Common.g.cs index 23a093e167..6b166783bf 100644 --- a/Common/GeneratedCode/Quantities/Density.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Density.Common.g.cs @@ -1217,22 +1217,6 @@ public static DensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static DensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Duration.Common.g.cs b/Common/GeneratedCode/Quantities/Duration.Common.g.cs index 58ea15708b..c8a999f8c4 100644 --- a/Common/GeneratedCode/Quantities/Duration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Duration.Common.g.cs @@ -675,22 +675,6 @@ public static DurationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static DurationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs index 5f1007380f..e9c8c5f187 100644 --- a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs @@ -545,22 +545,6 @@ public static DynamicViscosityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static DynamicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs index 4627181f9c..b2f51a20a4 100644 --- a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs @@ -503,22 +503,6 @@ public static ElectricAdmittanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricAdmittanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs index f011e1a311..7ee46b9a56 100644 --- a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricChargeUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricChargeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs index 7e73beedd0..2077ea5219 100644 --- a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricChargeDensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricChargeDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs index f3099fd9d3..8065fca67c 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs @@ -482,22 +482,6 @@ public static ElectricConductanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricConductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs index 9487fe3df1..7dd8478447 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricConductivityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs index 28fc1e4f78..c0f97fdbf2 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs @@ -587,22 +587,6 @@ public static ElectricCurrentUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricCurrentUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs index 71a8cdcc34..e2e803a3da 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricCurrentDensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricCurrentDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs index 3a777bb953..be91a65f38 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricCurrentGradientUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricCurrentGradientUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs index 5f48bcba7a..39eb12dd61 100644 --- a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricFieldUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs index dce93b68a0..2a41581253 100644 --- a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs @@ -440,22 +440,6 @@ public static ElectricInductanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricInductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs index 8a90e4bc1f..451df6f235 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs @@ -524,22 +524,6 @@ public static ElectricPotentialUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricPotentialUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs index 452a3b6bab..d1e7d7ecec 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs @@ -523,22 +523,6 @@ public static ElectricPotentialAcUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricPotentialAcUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs index 7ad0595e08..cf468b8609 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs @@ -523,22 +523,6 @@ public static ElectricPotentialDcUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricPotentialDcUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs index 6985c1d234..ba6709d508 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs @@ -503,22 +503,6 @@ public static ElectricResistanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs index 6860758317..caceb042e2 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs @@ -503,22 +503,6 @@ public static ElectricResistivityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ElectricResistivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Energy.Common.g.cs b/Common/GeneratedCode/Quantities/Energy.Common.g.cs index 1d79af5c50..d28b309327 100644 --- a/Common/GeneratedCode/Quantities/Energy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Energy.Common.g.cs @@ -881,22 +881,6 @@ public static EnergyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static EnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs index c5b077145d..1a8e7f5189 100644 --- a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs @@ -566,22 +566,6 @@ public static EntropyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static EntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Flow.Common.g.cs b/Common/GeneratedCode/Quantities/Flow.Common.g.cs index 92500edca9..52770f9207 100644 --- a/Common/GeneratedCode/Quantities/Flow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Flow.Common.g.cs @@ -960,22 +960,6 @@ public static FlowUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static FlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Force.Common.g.cs b/Common/GeneratedCode/Quantities/Force.Common.g.cs index 827cc1a107..0f3f1abca3 100644 --- a/Common/GeneratedCode/Quantities/Force.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Force.Common.g.cs @@ -629,22 +629,6 @@ public static ForceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ForceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs index f3b7e04db9..6bc35ab155 100644 --- a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs @@ -650,22 +650,6 @@ public static ForceChangeRateUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ForceChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs index c60955e3c1..7abcf9092d 100644 --- a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs @@ -608,22 +608,6 @@ public static ForcePerLengthUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ForcePerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs index 3814aaabb5..ea915a7d87 100644 --- a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs @@ -587,22 +587,6 @@ public static FrequencyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static FrequencyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs index af17a5b614..c5a1aa0b19 100644 --- a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs @@ -755,22 +755,6 @@ public static HeatFluxUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static HeatFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs index 6c1e6e297b..7d88dfbfbe 100644 --- a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs @@ -461,22 +461,6 @@ public static HeatTransferCoefficientUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static HeatTransferCoefficientUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs index abd8790909..40dfb97600 100644 --- a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs @@ -503,22 +503,6 @@ public static IlluminanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static IlluminanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Information.Common.g.cs b/Common/GeneratedCode/Quantities/Information.Common.g.cs index 9183d31d8f..d1c7c36a27 100644 --- a/Common/GeneratedCode/Quantities/Information.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Information.Common.g.cs @@ -963,22 +963,6 @@ public static InformationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static InformationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs index 7f1b4252ad..1c7ea1efcb 100644 --- a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs @@ -461,22 +461,6 @@ public static IrradianceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static IrradianceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs index 58db172b3f..3b1b356b93 100644 --- a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs @@ -482,22 +482,6 @@ public static IrradiationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static IrradiationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs index fe75567216..2cdb78317d 100644 --- a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs @@ -587,22 +587,6 @@ public static KinematicViscosityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static KinematicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs index 2c37adad8f..8608f18fee 100644 --- a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs @@ -440,22 +440,6 @@ public static LapseRateUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LapseRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Length.Common.g.cs b/Common/GeneratedCode/Quantities/Length.Common.g.cs index 2e3d2a38d3..64a2dce872 100644 --- a/Common/GeneratedCode/Quantities/Length.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Length.Common.g.cs @@ -881,22 +881,6 @@ public static LengthUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Level.Common.g.cs b/Common/GeneratedCode/Quantities/Level.Common.g.cs index ad48a43d85..9cc06211bc 100644 --- a/Common/GeneratedCode/Quantities/Level.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Level.Common.g.cs @@ -460,22 +460,6 @@ public static LevelUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LevelUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs index 4193003fb0..d0264b8d31 100644 --- a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs @@ -482,22 +482,6 @@ public static LinearDensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LinearDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs index a5b0e63900..00de3fcba2 100644 --- a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs @@ -440,22 +440,6 @@ public static LuminousFluxUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LuminousFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs index b5fd94601d..bd8d4ae623 100644 --- a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs @@ -440,22 +440,6 @@ public static LuminousIntensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static LuminousIntensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs index b5f5d2dde5..e3096d06f2 100644 --- a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs @@ -440,22 +440,6 @@ public static MagneticFieldUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MagneticFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs index b09af34da0..dc783e24e2 100644 --- a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs @@ -440,22 +440,6 @@ public static MagneticFluxUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MagneticFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs index 0a04d5753e..7d3ddbed73 100644 --- a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs @@ -440,22 +440,6 @@ public static MagnetizationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MagnetizationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Mass.Common.g.cs b/Common/GeneratedCode/Quantities/Mass.Common.g.cs index 0e9f53d699..30c7e1fe1d 100644 --- a/Common/GeneratedCode/Quantities/Mass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Mass.Common.g.cs @@ -860,22 +860,6 @@ public static MassUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MassUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs index c1f884aea2..5e53f133aa 100644 --- a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs @@ -734,22 +734,6 @@ public static MassFlowUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MassFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs index 12b507c25c..5056e19a6a 100644 --- a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs @@ -461,22 +461,6 @@ public static MassFluxUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MassFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs index 90e30652cb..3ed0389d76 100644 --- a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs @@ -965,22 +965,6 @@ public static MassMomentOfInertiaUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MassMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs index f4164e95c9..7e16c5551f 100644 --- a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs @@ -482,22 +482,6 @@ public static MolarEnergyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MolarEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs index abb87a58f9..f8af941059 100644 --- a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs @@ -482,22 +482,6 @@ public static MolarEntropyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MolarEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs index 6cbe02d28d..3c4d10424a 100644 --- a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs @@ -671,22 +671,6 @@ public static MolarMassUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MolarMassUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs index 19a4f20720..a5a589a4c4 100644 --- a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs @@ -587,22 +587,6 @@ public static MolarityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static MolarityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs index 032dec27e5..5e2f56764a 100644 --- a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs @@ -440,22 +440,6 @@ public static PermeabilityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PermeabilityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs index a8a40f1c0a..3e1ff4bcb9 100644 --- a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs @@ -440,22 +440,6 @@ public static PermittivityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PermittivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Power.Common.g.cs b/Common/GeneratedCode/Quantities/Power.Common.g.cs index ed9cbba62d..24421b01df 100644 --- a/Common/GeneratedCode/Quantities/Power.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Power.Common.g.cs @@ -838,22 +838,6 @@ public static PowerUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs index 1acfabad4e..13ff7f06cf 100644 --- a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs @@ -1343,22 +1343,6 @@ public static PowerDensityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PowerDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs index ab16e2fdc9..7410b89210 100644 --- a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs @@ -460,22 +460,6 @@ public static PowerRatioUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PowerRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs index 26a39fe932..3959f4452a 100644 --- a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs @@ -1219,22 +1219,6 @@ public static PressureUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PressureUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs index 11c7fdc4a8..e512852ff3 100644 --- a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs @@ -503,22 +503,6 @@ public static PressureChangeRateUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static PressureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs index b3629babf9..d25b618e70 100644 --- a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs @@ -544,22 +544,6 @@ public static RatioUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static RatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs index fc1272c6f8..d84b66a21e 100644 --- a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs @@ -482,22 +482,6 @@ public static ReactiveEnergyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ReactiveEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs index ba8679fd10..2ceda5b598 100644 --- a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs @@ -503,22 +503,6 @@ public static ReactivePowerUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ReactivePowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs index 992d9acab6..ecc79c8309 100644 --- a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs @@ -482,22 +482,6 @@ public static RotationalAccelerationUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static RotationalAccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs index 430347c970..36103e8ff5 100644 --- a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs @@ -692,22 +692,6 @@ public static RotationalSpeedUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static RotationalSpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs index 5ec21ca384..f876c05722 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs @@ -482,22 +482,6 @@ public static RotationalStiffnessUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static RotationalStiffnessUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs index e994b6ed9b..a2bba468f9 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs @@ -482,22 +482,6 @@ public static RotationalStiffnessPerLengthUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static RotationalStiffnessPerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs index 2f258256e0..c740b0e871 100644 --- a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs @@ -439,22 +439,6 @@ public static SolidAngleUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SolidAngleUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs index 944ba7474b..793837c4b0 100644 --- a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs @@ -587,22 +587,6 @@ public static SpecificEnergyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SpecificEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs index c31a618029..82c05e4ae7 100644 --- a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs @@ -587,22 +587,6 @@ public static SpecificEntropyUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SpecificEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs index 081afdbe8e..7eca216f6c 100644 --- a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs @@ -461,22 +461,6 @@ public static SpecificVolumeUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SpecificVolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs index f3752b3ec5..5cbdc51bed 100644 --- a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs @@ -776,22 +776,6 @@ public static SpecificWeightUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SpecificWeightUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Speed.Common.g.cs b/Common/GeneratedCode/Quantities/Speed.Common.g.cs index 3bd6a717fd..965f41f5e6 100644 --- a/Common/GeneratedCode/Quantities/Speed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Speed.Common.g.cs @@ -1091,22 +1091,6 @@ public static SpeedUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static SpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs index 3e5e6b2891..359d34c6e3 100644 --- a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs @@ -587,22 +587,6 @@ public static TemperatureUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static TemperatureUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs index 842e3a13bd..4ff17cca4f 100644 --- a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs @@ -629,22 +629,6 @@ public static TemperatureChangeRateUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static TemperatureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs index f450738404..e8550789c0 100644 --- a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs @@ -770,22 +770,6 @@ public static TemperatureDeltaUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static TemperatureDeltaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs index 799d338c54..1c2ef610f4 100644 --- a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs @@ -461,22 +461,6 @@ public static ThermalConductivityUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ThermalConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs index 89f752dae9..4334da12cc 100644 --- a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs @@ -524,22 +524,6 @@ public static ThermalResistanceUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static ThermalResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Torque.Common.g.cs b/Common/GeneratedCode/Quantities/Torque.Common.g.cs index b81e935d7c..c5d451a342 100644 --- a/Common/GeneratedCode/Quantities/Torque.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Torque.Common.g.cs @@ -860,22 +860,6 @@ public static TorqueUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static TorqueUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs index 5764238125..f982df818c 100644 --- a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs @@ -439,22 +439,6 @@ public static VitaminAUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static VitaminAUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/Volume.Common.g.cs b/Common/GeneratedCode/Quantities/Volume.Common.g.cs index 7af8d0bd50..ef358c635e 100644 --- a/Common/GeneratedCode/Quantities/Volume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Volume.Common.g.cs @@ -1347,22 +1347,6 @@ public static VolumeUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static VolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs index 706449f20d..db1e565585 100644 --- a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs @@ -965,22 +965,6 @@ public static VolumeFlowUnit ParseUnit(string str) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static VolumeFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs index 5d08aac859..1832f89807 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs index 2361083dd8..47a945e754 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AmountOfSubstanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs index bc57d2464d..71328ad967 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AmplitudeRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs index 68bec05e7e..9300463407 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AngleUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs index ec5e16f647..44e60f0419 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ApparentEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs index 28ea2ee4dc..3ccc80c7a9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ApparentPowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs index 29e68d974c..1a618f6b96 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AreaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs index ab2ce3d21e..14910ca0b6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AreaDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs index becf1d39eb..eef219081f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static AreaMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs index 7680252856..3a5e50f278 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static BitRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs index dd2f5671b6..cb392121fb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs index e29d794d68..673e10abbd 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static CapacitanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs index 9305713b78..b36da8240a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static DensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs index 81527a00b6..6629015d75 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static DurationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs index 8c7439b184..c618b94c4a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static DynamicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs index 7a43dad8fb..9eef04267e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricAdmittanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs index 5a4a50c28f..a967b0fd5f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricChargeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs index d0a2ccf03a..b964325a3e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricChargeDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs index 37dc806e61..ec4734b3f5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricConductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs index a4493a40ad..659eb4a048 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs index 77d48cf84c..74dc0b4cfb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricCurrentUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs index dd2162aa81..c0893a10d3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricCurrentDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs index 8316cc4428..8f7055a8ff 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricCurrentGradientUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs index 64eaa06a42..0d3882d3fb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs index c256289e43..306892156d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricInductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs index feee8b2789..d2e374ae8d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricPotentialUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs index 4b1a9104d0..8db3b6ef8f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricPotentialAcUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs index ae544de53a..9446dfaee1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricPotentialDcUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs index 35342d73f2..fcc1d95375 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs index 1a002b4a61..e8259ace93 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ElectricResistivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs index 99379b168b..8ecbcbd9b8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static EnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs index b9e1491f79..9388a4a857 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static EntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs index 2d92d5144b..401f367c0c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Flow.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static FlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs index 454a6db9c7..cfcd6b7e06 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ForceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs index c543bac9af..f7eae0b524 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ForceChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs index e1913404ac..08af39e126 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ForcePerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs index eae164cd38..faa4ffba54 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static FrequencyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs index 7a3cb5b4fd..e48abae075 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static HeatFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs index bfb15a2a34..68cce5ecda 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static HeatTransferCoefficientUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs index ae312daaa8..6e9cdd4b6c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static IlluminanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs index 717cbb4530..a976942c87 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static InformationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs index c39a6e3a8f..2fa88e6256 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static IrradianceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs index 39b7d748a3..0d20227817 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static IrradiationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs index f693a52e9e..2419cc1607 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static KinematicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs index bf78438269..baa0846609 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LapseRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs index 671b6e65bb..0153958518 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs index fb8e3661b1..da2464eb8b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LevelUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs index e090a3a9e5..581e09735a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LinearDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs index 2f4cb310a3..1d4f6a0277 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LuminousFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs index ff7fc8377b..a2f7408e30 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static LuminousIntensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs index e761bc831c..ccf856bbf4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MagneticFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs index 3a06c5b88a..99daf87c26 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MagneticFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs index cfd24f0578..cadd0acb99 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MagnetizationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs index e85cb7ef8d..8be9a9df40 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MassUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs index c882126d69..a83681536d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MassFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs index 1a69884f8c..011f10d707 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MassFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs index a8f9ecd0be..a3002b38e7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MassMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs index 1990b60711..2ce16e7f46 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MolarEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs index d61f89e52d..9884724641 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MolarEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs index 0bcf00daf3..cb4669e427 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MolarMassUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs index c4c6fc5ebf..55ab72cfa5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static MolarityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs index fc7d49629a..4da2995f20 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PermeabilityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs index a0afc22b73..affe190eb0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PermittivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs index 65e4724842..a59fa54f37 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs index 6f9c251cf0..b914aef018 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PowerDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs index 1c6eb6633b..568003e2d4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PowerRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs index c6e14c2a54..47af2646de 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PressureUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs index 670ec392f9..0dde9096ad 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static PressureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs index d79f892acd..b20e662734 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static RatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs index 191516708c..5264152de7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ReactiveEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs index 2e9d2249d7..52599537a8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ReactivePowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs index efccc0076c..8b3430abee 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static RotationalAccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs index bc98d55f61..48fdd0b7bb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static RotationalSpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs index 376eb49462..4bf0f028cc 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static RotationalStiffnessUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs index f201506efe..8f07a81fee 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static RotationalStiffnessPerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs index 417969a2c4..f29c944af5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SolidAngleUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs index c88afe1a0c..1fb196ef50 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SpecificEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs index 1bc99dc598..3bb722e5d0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SpecificEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs index abb560c8de..60ed38e097 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SpecificVolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs index 000ccb5370..142cd79d25 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SpecificWeightUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs index 9a1c0107fc..761ba4fbe3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static SpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs index c7aecb3a8c..be55387c1f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static TemperatureUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs index 8e8d4ddb77..53014f02b2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static TemperatureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs index 3e59ff0e09..a2ebc7ac84 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static TemperatureDeltaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs index e618c35a33..319d539066 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ThermalConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs index 391d18f5df..4025d018a6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static ThermalResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs index ebfad445d0..e157f03a47 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static TorqueUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs index 0430572518..9c5a83161d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static VitaminAUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs index 3180839ae3..84d4e028ab 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static VolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs index edd4337843..52ec8f1b72 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs @@ -154,6 +154,21 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureNa } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static VolumeFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index afe7bad3d2..3ae4ff7b8d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -345,6 +345,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 61e24dca68..9ba0a7cd78 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -354,6 +354,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AmountOfSubstanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 23c643afd5..e5fd059584 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -272,6 +272,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AmplitudeRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index ca02498de4..5d2c7cae14 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -354,6 +354,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AngleUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 05dfc23e9d..1b3e7a86f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ApparentEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index aea8d678f7..c495aa558c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ApparentPowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 5235e24c0d..0c0c0fc4c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -345,6 +345,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AreaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 842a74b281..5a6cd239c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AreaDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 76f090fc9d..b614b4fc09 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -282,6 +282,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static AreaMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 222a886e70..d6e6e0745f 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -460,6 +460,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static BitRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 9de58b5023..088fdf37b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 1a0f3a3dd9..1dc30e6ec2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static CapacitanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index adc1b74e5f..eb92e62f56 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -570,6 +570,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static DensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 351f373794..4484c60708 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -336,6 +336,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static DurationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 40c15616e8..cc0d989fef 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -282,6 +282,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static DynamicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index d1814b926c..acc6d15dc1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricAdmittanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index de311c02d2..b21e0e49dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricChargeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index e5ac919058..6e7a719cd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricChargeDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index c8e5ee97db..b322840f4b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricConductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d74de9be33..6072fe8a8c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 0f5858fe1b..65c8b3ff0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricCurrentUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4ac621d58f..a8cd7bb599 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricCurrentDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 1bdea233a1..4a1ca2a0fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricCurrentGradientUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 5f7b4d55cd..318599f382 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 8b8e0060e5..6bdc9e379c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricInductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index f9cebf55a4..cd10ced2c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -273,6 +273,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricPotentialUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index f3df5f0762..8955c03853 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -273,6 +273,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricPotentialAcUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index ea6f85c7ae..0beb09ac45 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -273,6 +273,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricPotentialDcUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index df944cce7a..36a0a415e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index e909be0ec1..bbdfa81ace 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ElectricResistivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 0aab5ee9a9..c956445b91 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -426,6 +426,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static EnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 1e174a2486..2a6b48229b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -291,6 +291,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static EntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs index 1530fa6888..a5fcd34873 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.NetFramework.g.cs @@ -444,6 +444,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static FlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index d741260a28..0c4f5a070b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -318,6 +318,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ForceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 1c5ec27ce0..28a61eb0c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -327,6 +327,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ForceChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index a221b700b4..e1269c8f0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -309,6 +309,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ForcePerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 649b2a2c52..6d32133aaa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static FrequencyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 3e1fdde1d7..c993022e29 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -372,6 +372,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static HeatFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index cf0bf1e253..e4c66ccaa1 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -246,6 +246,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static HeatTransferCoefficientUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 16e9931409..1ae922c34e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static IlluminanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index bf562afe24..47ef375171 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -460,6 +460,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static InformationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 8a1ef1ab60..28c8008fba 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -246,6 +246,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static IrradianceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 486da8cd88..dc83c05c73 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static IrradiationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index c9d49d1d19..9b08a58736 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static KinematicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1cd3e7621f..6106ecd247 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LapseRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index f15c49f2f5..86b0d9cc9a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -426,6 +426,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 75bab150c4..3c8671d281 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -254,6 +254,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LevelUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index b2c1100816..bbb23fa77b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LinearDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 778aabad6d..9925f5cb7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LuminousFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 56388d68d1..6ddc553acd 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static LuminousIntensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 636e0610cb..cccadd78f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MagneticFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index f3f3eefdb3..29a119cc4b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MagneticFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 9ee47929f2..40ad15e434 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MagnetizationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index a2aff8b53e..d46b197b76 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -417,6 +417,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MassUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index e90181d29f..f9dc0335a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -363,6 +363,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MassFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index ff966c6ddb..fc76f4d5a0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -246,6 +246,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MassFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 009ea8b31d..50054640fd 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -462,6 +462,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MassMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 0eedd254a6..158fbb10b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MolarEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 854cf36bea..397507a37c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MolarEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index a04598777e..44c9b2a116 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -336,6 +336,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MolarMassUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index c431a9a647..a3ea27a190 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static MolarityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index d767808955..4a922c0989 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PermeabilityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 4891ceb3de..3c60c545a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PermittivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 9287d3cbb3..1f5c656fcc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -406,6 +406,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index c1612bea8f..7be4fd0d64 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -624,6 +624,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PowerDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index fb8b9b3639..6c65c161da 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -254,6 +254,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PowerRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 251ae0bce2..188b9fcdda 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -570,6 +570,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PressureUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index e9133a77a8..e5f397c6dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static PressureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 993c2015d3..9768505b44 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -282,6 +282,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static RatioUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 390183475b..73621e977c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ReactiveEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 086effb16a..1f0a7ca201 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -264,6 +264,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ReactivePowerUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 16b0a47185..84a620414e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static RotationalAccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index baf25cc9cf..88dfe37282 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -345,6 +345,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static RotationalSpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index db4b15e846..d7e23068d2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static RotationalStiffnessUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 0a41d0fef4..8baa6fc521 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -255,6 +255,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static RotationalStiffnessPerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 802e37b63a..e70634f9f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SolidAngleUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 5d6fd503d4..f04a617565 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SpecificEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index df6ff742b1..9361d47e87 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -300,6 +300,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SpecificEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 1e06b97f10..cf2106da7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -246,6 +246,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SpecificVolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 417b4170e6..4a44f54a09 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -381,6 +381,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SpecificWeightUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index daf8ab45d8..db74fac14c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -516,6 +516,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static SpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 920828df1b..49e1c4a9ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -261,6 +261,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static TemperatureUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 87c254bb63..e1aca81b57 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -318,6 +318,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static TemperatureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1a85aa86c7..b3f1c83697 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -372,6 +372,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static TemperatureDeltaUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 9d4eb1d11e..9f586dc94e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -246,6 +246,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ThermalConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 8924ea7ab4..48cb14961f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -273,6 +273,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static ThermalResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 3f03228011..d11466f16d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -417,6 +417,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static TorqueUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index b8ff7ad03b..b7e4953430 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -237,6 +237,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static VitaminAUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 17ec35b34f..dbe1afd7ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -624,6 +624,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static VolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index c4f7944647..77c28a8562 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -462,6 +462,22 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static VolumeFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 index a95f59ca75..765955f3fd 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 @@ -519,22 +519,6 @@ if ($obsoleteAttribute) return ParseUnit(str, (IFormatProvider)null); } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")] - public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - #endregion /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 6baf780cb9..00797b9055 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -286,6 +286,22 @@ namespace UnitsNet } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] + public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeWindowsRuntimeComponent.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeWindowsRuntimeComponent.ps1 index 0173984142..022f406f83 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeWindowsRuntimeComponent.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeWindowsRuntimeComponent.ps1 @@ -195,6 +195,21 @@ namespace UnitsNet } } + /// + /// Parse a unit string. + /// + /// String to parse. Typically in the form: {number} {unit} + /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. + /// + /// Length.ParseUnit("m", new CultureInfo("en-US")); + /// + /// The value of 'str' cannot be null. + /// Error parsing string. + public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) + { + return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); + } + /// /// Parse a unit string. /// From c32c9d22e95cf60e861f33909b57d21c88da8ded Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Fri, 28 Sep 2018 11:33:24 -0400 Subject: [PATCH 5/5] Removing obsolete methods --- .../Quantities/Acceleration.Common.g.cs | 47 +------------------ .../Quantities/AmountOfSubstance.Common.g.cs | 47 +------------------ .../Quantities/AmplitudeRatio.Common.g.cs | 47 +------------------ .../Quantities/Angle.Common.g.cs | 47 +------------------ .../Quantities/ApparentEnergy.Common.g.cs | 47 +------------------ .../Quantities/ApparentPower.Common.g.cs | 47 +------------------ .../GeneratedCode/Quantities/Area.Common.g.cs | 47 +------------------ .../Quantities/AreaDensity.Common.g.cs | 47 +------------------ .../AreaMomentOfInertia.Common.g.cs | 47 +------------------ .../Quantities/BitRate.Common.g.cs | 47 +------------------ .../BrakeSpecificFuelConsumption.Common.g.cs | 47 +------------------ .../Quantities/Capacitance.Common.g.cs | 47 +------------------ .../Quantities/Density.Common.g.cs | 47 +------------------ .../Quantities/Duration.Common.g.cs | 47 +------------------ .../Quantities/DynamicViscosity.Common.g.cs | 47 +------------------ .../Quantities/ElectricAdmittance.Common.g.cs | 47 +------------------ .../Quantities/ElectricCharge.Common.g.cs | 47 +------------------ .../ElectricChargeDensity.Common.g.cs | 47 +------------------ .../ElectricConductance.Common.g.cs | 47 +------------------ .../ElectricConductivity.Common.g.cs | 47 +------------------ .../Quantities/ElectricCurrent.Common.g.cs | 47 +------------------ .../ElectricCurrentDensity.Common.g.cs | 47 +------------------ .../ElectricCurrentGradient.Common.g.cs | 47 +------------------ .../Quantities/ElectricField.Common.g.cs | 47 +------------------ .../Quantities/ElectricInductance.Common.g.cs | 47 +------------------ .../Quantities/ElectricPotential.Common.g.cs | 47 +------------------ .../ElectricPotentialAc.Common.g.cs | 47 +------------------ .../ElectricPotentialDc.Common.g.cs | 47 +------------------ .../Quantities/ElectricResistance.Common.g.cs | 47 +------------------ .../ElectricResistivity.Common.g.cs | 47 +------------------ .../Quantities/Energy.Common.g.cs | 47 +------------------ .../Quantities/Entropy.Common.g.cs | 47 +------------------ .../Quantities/Force.Common.g.cs | 47 +------------------ .../Quantities/ForceChangeRate.Common.g.cs | 47 +------------------ .../Quantities/ForcePerLength.Common.g.cs | 47 +------------------ .../Quantities/Frequency.Common.g.cs | 47 +------------------ .../Quantities/HeatFlux.Common.g.cs | 47 +------------------ .../HeatTransferCoefficient.Common.g.cs | 47 +------------------ .../Quantities/Illuminance.Common.g.cs | 47 +------------------ .../Quantities/Information.Common.g.cs | 47 +------------------ .../Quantities/Irradiance.Common.g.cs | 47 +------------------ .../Quantities/Irradiation.Common.g.cs | 47 +------------------ .../Quantities/KinematicViscosity.Common.g.cs | 47 +------------------ .../Quantities/LapseRate.Common.g.cs | 47 +------------------ .../Quantities/Length.Common.g.cs | 47 +------------------ .../Quantities/Level.Common.g.cs | 47 +------------------ .../Quantities/LinearDensity.Common.g.cs | 47 +------------------ .../Quantities/LuminousFlux.Common.g.cs | 47 +------------------ .../Quantities/LuminousIntensity.Common.g.cs | 47 +------------------ .../Quantities/MagneticField.Common.g.cs | 47 +------------------ .../Quantities/MagneticFlux.Common.g.cs | 47 +------------------ .../Quantities/Magnetization.Common.g.cs | 47 +------------------ .../GeneratedCode/Quantities/Mass.Common.g.cs | 47 +------------------ .../Quantities/MassFlow.Common.g.cs | 47 +------------------ .../Quantities/MassFlux.Common.g.cs | 47 +------------------ .../MassMomentOfInertia.Common.g.cs | 47 +------------------ .../Quantities/MolarEnergy.Common.g.cs | 47 +------------------ .../Quantities/MolarEntropy.Common.g.cs | 47 +------------------ .../Quantities/MolarMass.Common.g.cs | 47 +------------------ .../Quantities/Molarity.Common.g.cs | 47 +------------------ .../Quantities/Permeability.Common.g.cs | 47 +------------------ .../Quantities/Permittivity.Common.g.cs | 47 +------------------ .../Quantities/Power.Common.g.cs | 47 +------------------ .../Quantities/PowerDensity.Common.g.cs | 47 +------------------ .../Quantities/PowerRatio.Common.g.cs | 47 +------------------ .../Quantities/Pressure.Common.g.cs | 47 +------------------ .../Quantities/PressureChangeRate.Common.g.cs | 47 +------------------ .../Quantities/Ratio.Common.g.cs | 47 +------------------ .../Quantities/ReactiveEnergy.Common.g.cs | 47 +------------------ .../Quantities/ReactivePower.Common.g.cs | 47 +------------------ .../RotationalAcceleration.Common.g.cs | 47 +------------------ .../Quantities/RotationalSpeed.Common.g.cs | 47 +------------------ .../RotationalStiffness.Common.g.cs | 47 +------------------ .../RotationalStiffnessPerLength.Common.g.cs | 47 +------------------ .../Quantities/SolidAngle.Common.g.cs | 47 +------------------ .../Quantities/SpecificEnergy.Common.g.cs | 47 +------------------ .../Quantities/SpecificEntropy.Common.g.cs | 47 +------------------ .../Quantities/SpecificVolume.Common.g.cs | 47 +------------------ .../Quantities/SpecificWeight.Common.g.cs | 47 +------------------ .../Quantities/Speed.Common.g.cs | 47 +------------------ .../Quantities/Temperature.Common.g.cs | 47 +------------------ .../TemperatureChangeRate.Common.g.cs | 47 +------------------ .../Quantities/TemperatureDelta.Common.g.cs | 47 +------------------ .../ThermalConductivity.Common.g.cs | 47 +------------------ .../Quantities/ThermalResistance.Common.g.cs | 47 +------------------ .../Quantities/Torque.Common.g.cs | 47 +------------------ .../Quantities/VitaminA.Common.g.cs | 47 +------------------ .../Quantities/Volume.Common.g.cs | 47 +------------------ .../Quantities/VolumeFlow.Common.g.cs | 47 +------------------ UnitsNet.Tests/CustomCode/LengthTests.cs | 14 ++---- UnitsNet.Tests/CustomCode/ParseTests.cs | 6 +-- UnitsNet.Tests/QuantityTests.Ctor.cs | 30 +++++------- UnitsNet.Tests/QuantityTests.ToString.cs | 15 +++--- .../CustomCode/Quantities/Density.extra.cs | 4 +- UnitsNet/CustomCode/Quantities/Force.extra.cs | 10 ++-- UnitsNet/CustomCode/Quantities/Mass.extra.cs | 2 +- .../Quantities/Temperature.extra.cs | 8 ++-- UnitsNet/CustomCode/UnitSystem.cs | 13 ----- .../Quantities/Acceleration.NetFramework.g.cs | 16 ------- .../AmountOfSubstance.NetFramework.g.cs | 16 ------- .../AmplitudeRatio.NetFramework.g.cs | 16 ------- .../Quantities/Angle.NetFramework.g.cs | 16 ------- .../ApparentEnergy.NetFramework.g.cs | 16 ------- .../ApparentPower.NetFramework.g.cs | 16 ------- .../Quantities/Area.NetFramework.g.cs | 16 ------- .../Quantities/AreaDensity.NetFramework.g.cs | 16 ------- .../AreaMomentOfInertia.NetFramework.g.cs | 16 ------- .../Quantities/BitRate.NetFramework.g.cs | 16 ------- ...eSpecificFuelConsumption.NetFramework.g.cs | 16 ------- .../Quantities/Capacitance.NetFramework.g.cs | 16 ------- .../Quantities/Density.NetFramework.g.cs | 16 ------- .../Quantities/Duration.NetFramework.g.cs | 16 ------- .../DynamicViscosity.NetFramework.g.cs | 16 ------- .../ElectricAdmittance.NetFramework.g.cs | 16 ------- .../ElectricCharge.NetFramework.g.cs | 16 ------- .../ElectricChargeDensity.NetFramework.g.cs | 16 ------- .../ElectricConductance.NetFramework.g.cs | 16 ------- .../ElectricConductivity.NetFramework.g.cs | 16 ------- .../ElectricCurrent.NetFramework.g.cs | 16 ------- .../ElectricCurrentDensity.NetFramework.g.cs | 16 ------- .../ElectricCurrentGradient.NetFramework.g.cs | 16 ------- .../ElectricField.NetFramework.g.cs | 16 ------- .../ElectricInductance.NetFramework.g.cs | 16 ------- .../ElectricPotential.NetFramework.g.cs | 16 ------- .../ElectricPotentialAc.NetFramework.g.cs | 16 ------- .../ElectricPotentialDc.NetFramework.g.cs | 16 ------- .../ElectricResistance.NetFramework.g.cs | 16 ------- .../ElectricResistivity.NetFramework.g.cs | 16 ------- .../Quantities/Energy.NetFramework.g.cs | 16 ------- .../Quantities/Entropy.NetFramework.g.cs | 16 ------- .../Quantities/Force.NetFramework.g.cs | 16 ------- .../ForceChangeRate.NetFramework.g.cs | 16 ------- .../ForcePerLength.NetFramework.g.cs | 16 ------- .../Quantities/Frequency.NetFramework.g.cs | 16 ------- .../Quantities/HeatFlux.NetFramework.g.cs | 16 ------- .../HeatTransferCoefficient.NetFramework.g.cs | 16 ------- .../Quantities/Illuminance.NetFramework.g.cs | 16 ------- .../Quantities/Information.NetFramework.g.cs | 16 ------- .../Quantities/Irradiance.NetFramework.g.cs | 16 ------- .../Quantities/Irradiation.NetFramework.g.cs | 16 ------- .../KinematicViscosity.NetFramework.g.cs | 16 ------- .../Quantities/LapseRate.NetFramework.g.cs | 16 ------- .../Quantities/Length.NetFramework.g.cs | 16 ------- .../Quantities/Level.NetFramework.g.cs | 16 ------- .../LinearDensity.NetFramework.g.cs | 16 ------- .../Quantities/LuminousFlux.NetFramework.g.cs | 16 ------- .../LuminousIntensity.NetFramework.g.cs | 16 ------- .../MagneticField.NetFramework.g.cs | 16 ------- .../Quantities/MagneticFlux.NetFramework.g.cs | 16 ------- .../Magnetization.NetFramework.g.cs | 16 ------- .../Quantities/Mass.NetFramework.g.cs | 16 ------- .../Quantities/MassFlow.NetFramework.g.cs | 16 ------- .../Quantities/MassFlux.NetFramework.g.cs | 16 ------- .../MassMomentOfInertia.NetFramework.g.cs | 16 ------- .../Quantities/MolarEnergy.NetFramework.g.cs | 16 ------- .../Quantities/MolarEntropy.NetFramework.g.cs | 16 ------- .../Quantities/MolarMass.NetFramework.g.cs | 16 ------- .../Quantities/Molarity.NetFramework.g.cs | 16 ------- .../Quantities/Permeability.NetFramework.g.cs | 16 ------- .../Quantities/Permittivity.NetFramework.g.cs | 16 ------- .../Quantities/Power.NetFramework.g.cs | 16 ------- .../Quantities/PowerDensity.NetFramework.g.cs | 16 ------- .../Quantities/PowerRatio.NetFramework.g.cs | 16 ------- .../Quantities/Pressure.NetFramework.g.cs | 16 ------- .../PressureChangeRate.NetFramework.g.cs | 16 ------- .../Quantities/Ratio.NetFramework.g.cs | 16 ------- .../ReactiveEnergy.NetFramework.g.cs | 16 ------- .../ReactivePower.NetFramework.g.cs | 16 ------- .../RotationalAcceleration.NetFramework.g.cs | 16 ------- .../RotationalSpeed.NetFramework.g.cs | 16 ------- .../RotationalStiffness.NetFramework.g.cs | 16 ------- ...tionalStiffnessPerLength.NetFramework.g.cs | 16 ------- .../Quantities/SolidAngle.NetFramework.g.cs | 16 ------- .../SpecificEnergy.NetFramework.g.cs | 16 ------- .../SpecificEntropy.NetFramework.g.cs | 16 ------- .../SpecificVolume.NetFramework.g.cs | 16 ------- .../SpecificWeight.NetFramework.g.cs | 16 ------- .../Quantities/Speed.NetFramework.g.cs | 16 ------- .../Quantities/Temperature.NetFramework.g.cs | 16 ------- .../TemperatureChangeRate.NetFramework.g.cs | 16 ------- .../TemperatureDelta.NetFramework.g.cs | 16 ------- .../ThermalConductivity.NetFramework.g.cs | 16 ------- .../ThermalResistance.NetFramework.g.cs | 16 ------- .../Quantities/Torque.NetFramework.g.cs | 16 ------- .../Quantities/VitaminA.NetFramework.g.cs | 16 ------- .../Quantities/Volume.NetFramework.g.cs | 16 ------- .../Quantities/VolumeFlow.NetFramework.g.cs | 16 ------- UnitsNet/Length2d.cs | 4 +- ...clude-GenerateQuantitySourceCodeCommon.ps1 | 47 +------------------ ...GenerateQuantitySourceCodeNetFramework.ps1 | 16 ------- 190 files changed, 220 insertions(+), 5556 deletions(-) diff --git a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs index 9a15ce08d6..c78845e10f 100644 --- a/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Acceleration.Common.g.cs @@ -82,21 +82,11 @@ static Acceleration() BaseDimensions = new BaseDimensions(1, 0, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit MeterPerSecondSquared. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Acceleration(double meterspersecondsquared) - { - _value = Convert.ToDouble(meterspersecondsquared); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Acceleration(double meterspersecondsquared) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit MeterPerSecondSquared. - /// - /// Value assuming base unit MeterPerSecondSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Acceleration(long meterspersecondsquared) : this(Convert.ToDouble(meterspersecondsquared), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit MeterPerSecondSquared. - /// - /// Value assuming base unit MeterPerSecondSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Acceleration(decimal meterspersecondsquared) : this(Convert.ToDouble(meterspersecondsquared), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Acceleration(double meterspersecondsquared) public static QuantityType QuantityType => QuantityType.Acceleration; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Acceleration, which is MeterPerSecondSquared. All conversions go via this value. /// public static AccelerationUnit BaseUnit => AccelerationUnit.MeterPerSecondSquared; @@ -670,12 +633,6 @@ public static AccelerationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is MeterPerSecondSquared - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AccelerationUnit ToStringDefaultUnit { get; set; } = AccelerationUnit.MeterPerSecondSquared; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs index 71847ea832..2ae69c2105 100644 --- a/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmountOfSubstance.Common.g.cs @@ -82,21 +82,11 @@ static AmountOfSubstance() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 1, 0); } - /// - /// Creates the quantity with the given value in the base unit Mole. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public AmountOfSubstance(double moles) - { - _value = Convert.ToDouble(moles); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public AmountOfSubstance(double moles) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Mole. - /// - /// Value assuming base unit Mole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AmountOfSubstance(long moles) : this(Convert.ToDouble(moles), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Mole. - /// - /// Value assuming base unit Mole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AmountOfSubstance(decimal moles) : this(Convert.ToDouble(moles), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public AmountOfSubstance(double moles) public static QuantityType QuantityType => QuantityType.AmountOfSubstance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of AmountOfSubstance, which is Mole. All conversions go via this value. /// public static AmountOfSubstanceUnit BaseUnit => AmountOfSubstanceUnit.Mole; @@ -691,12 +654,6 @@ public static AmountOfSubstanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Mole - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AmountOfSubstanceUnit ToStringDefaultUnit { get; set; } = AmountOfSubstanceUnit.Mole; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs index e0934fd483..21908ddbc5 100644 --- a/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs @@ -81,21 +81,11 @@ static AmplitudeRatio() { } - /// - /// Creates the quantity with the given value in the base unit DecibelVolt. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public AmplitudeRatio(double decibelvolts) - { - _value = Convert.ToDouble(decibelvolts); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public AmplitudeRatio(double decibelvolts) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit DecibelVolt. - /// - /// Value assuming base unit DecibelVolt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AmplitudeRatio(long decibelvolts) : this(Convert.ToDouble(decibelvolts), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit DecibelVolt. - /// - /// Value assuming base unit DecibelVolt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AmplitudeRatio(decimal decibelvolts) : this(Convert.ToDouble(decibelvolts), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public AmplitudeRatio(double decibelvolts) public static QuantityType QuantityType => QuantityType.AmplitudeRatio; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of AmplitudeRatio, which is DecibelVolt. All conversions go via this value. /// public static AmplitudeRatioUnit BaseUnit => AmplitudeRatioUnit.DecibelVolt; @@ -480,12 +443,6 @@ public static AmplitudeRatioUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is DecibelVolt - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AmplitudeRatioUnit ToStringDefaultUnit { get; set; } = AmplitudeRatioUnit.DecibelVolt; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Angle.Common.g.cs b/Common/GeneratedCode/Quantities/Angle.Common.g.cs index 9dbfc907d3..31f12e70d5 100644 --- a/Common/GeneratedCode/Quantities/Angle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Angle.Common.g.cs @@ -81,21 +81,11 @@ static Angle() { } - /// - /// Creates the quantity with the given value in the base unit Degree. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Angle(double degrees) - { - _value = Convert.ToDouble(degrees); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public Angle(double degrees) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Degree. - /// - /// Value assuming base unit Degree. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Angle(long degrees) : this(Convert.ToDouble(degrees), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Degree. - /// - /// Value assuming base unit Degree. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Angle(decimal degrees) : this(Convert.ToDouble(degrees), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public Angle(double degrees) public static QuantityType QuantityType => QuantityType.Angle; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Angle, which is Degree. All conversions go via this value. /// public static AngleUnit BaseUnit => AngleUnit.Degree; @@ -690,12 +653,6 @@ public static AngleUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Degree - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AngleUnit ToStringDefaultUnit { get; set; } = AngleUnit.Degree; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs index 02a2b3b251..d3b738c28f 100644 --- a/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs @@ -82,21 +82,11 @@ static ApparentEnergy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit VoltampereHour. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ApparentEnergy(double voltamperehours) - { - _value = Convert.ToDouble(voltamperehours); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ApparentEnergy(double voltamperehours) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltampereHour. - /// - /// Value assuming base unit VoltampereHour. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ApparentEnergy(long voltamperehours) : this(Convert.ToDouble(voltamperehours), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltampereHour. - /// - /// Value assuming base unit VoltampereHour. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ApparentEnergy(decimal voltamperehours) : this(Convert.ToDouble(voltamperehours), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ApparentEnergy(double voltamperehours) public static QuantityType QuantityType => QuantityType.ApparentEnergy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ApparentEnergy, which is VoltampereHour. All conversions go via this value. /// public static ApparentEnergyUnit BaseUnit => ApparentEnergyUnit.VoltampereHour; @@ -460,12 +423,6 @@ public static ApparentEnergyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltampereHour - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ApparentEnergyUnit ToStringDefaultUnit { get; set; } = ApparentEnergyUnit.VoltampereHour; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs index cebc7b60d3..0c92300625 100644 --- a/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs @@ -82,21 +82,11 @@ static ApparentPower() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Voltampere. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ApparentPower(double voltamperes) - { - _value = Convert.ToDouble(voltamperes); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ApparentPower(double voltamperes) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Voltampere. - /// - /// Value assuming base unit Voltampere. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ApparentPower(long voltamperes) : this(Convert.ToDouble(voltamperes), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Voltampere. - /// - /// Value assuming base unit Voltampere. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ApparentPower(decimal voltamperes) : this(Convert.ToDouble(voltamperes), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ApparentPower(double voltamperes) public static QuantityType QuantityType => QuantityType.ApparentPower; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ApparentPower, which is Voltampere. All conversions go via this value. /// public static ApparentPowerUnit BaseUnit => ApparentPowerUnit.Voltampere; @@ -481,12 +444,6 @@ public static ApparentPowerUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Voltampere - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ApparentPowerUnit ToStringDefaultUnit { get; set; } = ApparentPowerUnit.Voltampere; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Area.Common.g.cs b/Common/GeneratedCode/Quantities/Area.Common.g.cs index c7477b8453..55d5d0612c 100644 --- a/Common/GeneratedCode/Quantities/Area.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Area.Common.g.cs @@ -82,21 +82,11 @@ static Area() BaseDimensions = new BaseDimensions(2, 0, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit SquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Area(double squaremeters) - { - _value = Convert.ToDouble(squaremeters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Area(double squaremeters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit SquareMeter. - /// - /// Value assuming base unit SquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Area(long squaremeters) : this(Convert.ToDouble(squaremeters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit SquareMeter. - /// - /// Value assuming base unit SquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Area(decimal squaremeters) : this(Convert.ToDouble(squaremeters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Area(double squaremeters) public static QuantityType QuantityType => QuantityType.Area; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Area, which is SquareMeter. All conversions go via this value. /// public static AreaUnit BaseUnit => AreaUnit.SquareMeter; @@ -670,12 +633,6 @@ public static AreaUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is SquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AreaUnit ToStringDefaultUnit { get; set; } = AreaUnit.SquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs index 96776b2677..cb1cfba4d1 100644 --- a/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs @@ -82,21 +82,11 @@ static AreaDensity() BaseDimensions = new BaseDimensions(-2, 1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public AreaDensity(double kilogramspersquaremeter) - { - _value = Convert.ToDouble(kilogramspersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public AreaDensity(double kilogramspersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerSquareMeter. - /// - /// Value assuming base unit KilogramPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AreaDensity(long kilogramspersquaremeter) : this(Convert.ToDouble(kilogramspersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerSquareMeter. - /// - /// Value assuming base unit KilogramPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AreaDensity(decimal kilogramspersquaremeter) : this(Convert.ToDouble(kilogramspersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public AreaDensity(double kilogramspersquaremeter) public static QuantityType QuantityType => QuantityType.AreaDensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of AreaDensity, which is KilogramPerSquareMeter. All conversions go via this value. /// public static AreaDensityUnit BaseUnit => AreaDensityUnit.KilogramPerSquareMeter; @@ -418,12 +381,6 @@ public static AreaDensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AreaDensityUnit ToStringDefaultUnit { get; set; } = AreaDensityUnit.KilogramPerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs index 0d781c8805..0c8c11b930 100644 --- a/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/AreaMomentOfInertia.Common.g.cs @@ -82,21 +82,11 @@ static AreaMomentOfInertia() BaseDimensions = new BaseDimensions(4, 0, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit MeterToTheFourth. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public AreaMomentOfInertia(double meterstothefourth) - { - _value = Convert.ToDouble(meterstothefourth); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public AreaMomentOfInertia(double meterstothefourth) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit MeterToTheFourth. - /// - /// Value assuming base unit MeterToTheFourth. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AreaMomentOfInertia(long meterstothefourth) : this(Convert.ToDouble(meterstothefourth), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit MeterToTheFourth. - /// - /// Value assuming base unit MeterToTheFourth. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - AreaMomentOfInertia(decimal meterstothefourth) : this(Convert.ToDouble(meterstothefourth), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public AreaMomentOfInertia(double meterstothefourth) public static QuantityType QuantityType => QuantityType.AreaMomentOfInertia; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of AreaMomentOfInertia, which is MeterToTheFourth. All conversions go via this value. /// public static AreaMomentOfInertiaUnit BaseUnit => AreaMomentOfInertiaUnit.MeterToTheFourth; @@ -523,12 +486,6 @@ public static AreaMomentOfInertiaUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is MeterToTheFourth - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static AreaMomentOfInertiaUnit ToStringDefaultUnit { get; set; } = AreaMomentOfInertiaUnit.MeterToTheFourth; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs index a1e62e838d..c80cb9103d 100644 --- a/Common/GeneratedCode/Quantities/BitRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BitRate.Common.g.cs @@ -81,21 +81,11 @@ static BitRate() { } - /// - /// Creates the quantity with the given value in the base unit BitPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public BitRate(double bitspersecond) - { - _value = Convert.ToDecimal(bitspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public BitRate(double bitspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit BitPerSecond. - /// - /// Value assuming base unit BitPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - BitRate(long bitspersecond) : this(Convert.ToDecimal(bitspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit BitPerSecond. - /// - /// Value assuming base unit BitPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - BitRate(decimal bitspersecond) : this(Convert.ToDecimal(bitspersecond), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public BitRate(double bitspersecond) public static QuantityType QuantityType => QuantityType.BitRate; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of BitRate, which is BitPerSecond. All conversions go via this value. /// public static BitRateUnit BaseUnit => BitRateUnit.BitPerSecond; @@ -942,12 +905,6 @@ public static BitRateUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is BitPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static BitRateUnit ToStringDefaultUnit { get; set; } = BitRateUnit.BitPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs index 0711a609f9..8451783471 100644 --- a/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs +++ b/Common/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.Common.g.cs @@ -82,21 +82,11 @@ static BrakeSpecificFuelConsumption() BaseDimensions = new BaseDimensions(-2, 0, 2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerJoule. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public BrakeSpecificFuelConsumption(double kilogramsperjoule) - { - _value = Convert.ToDouble(kilogramsperjoule); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public BrakeSpecificFuelConsumption(double kilogramsperjoule) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerJoule. - /// - /// Value assuming base unit KilogramPerJoule. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - BrakeSpecificFuelConsumption(long kilogramsperjoule) : this(Convert.ToDouble(kilogramsperjoule), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerJoule. - /// - /// Value assuming base unit KilogramPerJoule. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - BrakeSpecificFuelConsumption(decimal kilogramsperjoule) : this(Convert.ToDouble(kilogramsperjoule), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public BrakeSpecificFuelConsumption(double kilogramsperjoule) public static QuantityType QuantityType => QuantityType.BrakeSpecificFuelConsumption; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of BrakeSpecificFuelConsumption, which is KilogramPerJoule. All conversions go via this value. /// public static BrakeSpecificFuelConsumptionUnit BaseUnit => BrakeSpecificFuelConsumptionUnit.KilogramPerJoule; @@ -460,12 +423,6 @@ public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerJoule - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static BrakeSpecificFuelConsumptionUnit ToStringDefaultUnit { get; set; } = BrakeSpecificFuelConsumptionUnit.KilogramPerJoule; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs index 9241cd01c7..207d620ce3 100644 --- a/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Capacitance.Common.g.cs @@ -82,21 +82,11 @@ static Capacitance() BaseDimensions = new BaseDimensions(-2, -1, 4, 2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Farad. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Capacitance(double farads) - { - _value = Convert.ToDouble(farads); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Capacitance(double farads) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Farad. - /// - /// Value assuming base unit Farad. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Capacitance(long farads) : this(Convert.ToDouble(farads), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Farad. - /// - /// Value assuming base unit Farad. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Capacitance(decimal farads) : this(Convert.ToDouble(farads), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Capacitance(double farads) public static QuantityType QuantityType => QuantityType.Capacitance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Capacitance, which is Farad. All conversions go via this value. /// public static CapacitanceUnit BaseUnit => CapacitanceUnit.Farad; @@ -418,12 +381,6 @@ public static CapacitanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Farad - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static CapacitanceUnit ToStringDefaultUnit { get; set; } = CapacitanceUnit.Farad; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Density.Common.g.cs b/Common/GeneratedCode/Quantities/Density.Common.g.cs index b02b22384e..424502289b 100644 --- a/Common/GeneratedCode/Quantities/Density.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Density.Common.g.cs @@ -82,21 +82,11 @@ static Density() BaseDimensions = new BaseDimensions(-3, 1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerCubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Density(double kilogramspercubicmeter) - { - _value = Convert.ToDouble(kilogramspercubicmeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Density(double kilogramspercubicmeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerCubicMeter. - /// - /// Value assuming base unit KilogramPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Density(long kilogramspercubicmeter) : this(Convert.ToDouble(kilogramspercubicmeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerCubicMeter. - /// - /// Value assuming base unit KilogramPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Density(decimal kilogramspercubicmeter) : this(Convert.ToDouble(kilogramspercubicmeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Density(double kilogramspercubicmeter) public static QuantityType QuantityType => QuantityType.Density; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Density, which is KilogramPerCubicMeter. All conversions go via this value. /// public static DensityUnit BaseUnit => DensityUnit.KilogramPerCubicMeter; @@ -1195,12 +1158,6 @@ public static DensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerCubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static DensityUnit ToStringDefaultUnit { get; set; } = DensityUnit.KilogramPerCubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Duration.Common.g.cs b/Common/GeneratedCode/Quantities/Duration.Common.g.cs index f887bdaa9d..fb65aefdf7 100644 --- a/Common/GeneratedCode/Quantities/Duration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Duration.Common.g.cs @@ -82,21 +82,11 @@ static Duration() BaseDimensions = new BaseDimensions(0, 0, 1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Second. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Duration(double seconds) - { - _value = Convert.ToDouble(seconds); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Duration(double seconds) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Second. - /// - /// Value assuming base unit Second. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Duration(long seconds) : this(Convert.ToDouble(seconds), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Second. - /// - /// Value assuming base unit Second. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Duration(decimal seconds) : this(Convert.ToDouble(seconds), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Duration(double seconds) public static QuantityType QuantityType => QuantityType.Duration; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Duration, which is Second. All conversions go via this value. /// public static DurationUnit BaseUnit => DurationUnit.Second; @@ -607,12 +570,6 @@ public static DurationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Second - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static DurationUnit ToStringDefaultUnit { get; set; } = DurationUnit.Second; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs index a7ec561031..019b542850 100644 --- a/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs @@ -82,21 +82,11 @@ static DynamicViscosity() BaseDimensions = new BaseDimensions(-1, 1, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonSecondPerMeterSquared. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public DynamicViscosity(double newtonsecondspermetersquared) - { - _value = Convert.ToDouble(newtonsecondspermetersquared); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public DynamicViscosity(double newtonsecondspermetersquared) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonSecondPerMeterSquared. - /// - /// Value assuming base unit NewtonSecondPerMeterSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - DynamicViscosity(long newtonsecondspermetersquared) : this(Convert.ToDouble(newtonsecondspermetersquared), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonSecondPerMeterSquared. - /// - /// Value assuming base unit NewtonSecondPerMeterSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - DynamicViscosity(decimal newtonsecondspermetersquared) : this(Convert.ToDouble(newtonsecondspermetersquared), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public DynamicViscosity(double newtonsecondspermetersquared) public static QuantityType QuantityType => QuantityType.DynamicViscosity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of DynamicViscosity, which is NewtonSecondPerMeterSquared. All conversions go via this value. /// public static DynamicViscosityUnit BaseUnit => DynamicViscosityUnit.NewtonSecondPerMeterSquared; @@ -523,12 +486,6 @@ public static DynamicViscosityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonSecondPerMeterSquared - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static DynamicViscosityUnit ToStringDefaultUnit { get; set; } = DynamicViscosityUnit.NewtonSecondPerMeterSquared; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs index f6312cd305..d80d3e16b4 100644 --- a/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricAdmittance.Common.g.cs @@ -82,21 +82,11 @@ static ElectricAdmittance() BaseDimensions = new BaseDimensions(-2, -1, 3, 2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Siemens. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricAdmittance(double siemens) - { - _value = Convert.ToDouble(siemens); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricAdmittance(double siemens) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Siemens. - /// - /// Value assuming base unit Siemens. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricAdmittance(long siemens) : this(Convert.ToDouble(siemens), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Siemens. - /// - /// Value assuming base unit Siemens. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricAdmittance(decimal siemens) : this(Convert.ToDouble(siemens), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricAdmittance(double siemens) public static QuantityType QuantityType => QuantityType.ElectricAdmittance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricAdmittance, which is Siemens. All conversions go via this value. /// public static ElectricAdmittanceUnit BaseUnit => ElectricAdmittanceUnit.Siemens; @@ -481,12 +444,6 @@ public static ElectricAdmittanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Siemens - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricAdmittanceUnit ToStringDefaultUnit { get; set; } = ElectricAdmittanceUnit.Siemens; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs index 054f008ba4..1c871dbf10 100644 --- a/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs @@ -82,21 +82,11 @@ static ElectricCharge() BaseDimensions = new BaseDimensions(0, 0, 1, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Coulomb. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricCharge(double coulombs) - { - _value = Convert.ToDouble(coulombs); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricCharge(double coulombs) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Coulomb. - /// - /// Value assuming base unit Coulomb. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCharge(long coulombs) : this(Convert.ToDouble(coulombs), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Coulomb. - /// - /// Value assuming base unit Coulomb. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCharge(decimal coulombs) : this(Convert.ToDouble(coulombs), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricCharge(double coulombs) public static QuantityType QuantityType => QuantityType.ElectricCharge; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricCharge, which is Coulomb. All conversions go via this value. /// public static ElectricChargeUnit BaseUnit => ElectricChargeUnit.Coulomb; @@ -418,12 +381,6 @@ public static ElectricChargeUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Coulomb - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricChargeUnit ToStringDefaultUnit { get; set; } = ElectricChargeUnit.Coulomb; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs index 595cc898cf..0c96f85a45 100644 --- a/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricChargeDensity.Common.g.cs @@ -82,21 +82,11 @@ static ElectricChargeDensity() BaseDimensions = new BaseDimensions(-3, 0, 1, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit CoulombPerCubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricChargeDensity(double coulombspercubicmeter) - { - _value = Convert.ToDouble(coulombspercubicmeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricChargeDensity(double coulombspercubicmeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit CoulombPerCubicMeter. - /// - /// Value assuming base unit CoulombPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricChargeDensity(long coulombspercubicmeter) : this(Convert.ToDouble(coulombspercubicmeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit CoulombPerCubicMeter. - /// - /// Value assuming base unit CoulombPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricChargeDensity(decimal coulombspercubicmeter) : this(Convert.ToDouble(coulombspercubicmeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricChargeDensity(double coulombspercubicmeter) public static QuantityType QuantityType => QuantityType.ElectricChargeDensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricChargeDensity, which is CoulombPerCubicMeter. All conversions go via this value. /// public static ElectricChargeDensityUnit BaseUnit => ElectricChargeDensityUnit.CoulombPerCubicMeter; @@ -418,12 +381,6 @@ public static ElectricChargeDensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is CoulombPerCubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricChargeDensityUnit ToStringDefaultUnit { get; set; } = ElectricChargeDensityUnit.CoulombPerCubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs index cf45800e51..faf9943273 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductance.Common.g.cs @@ -82,21 +82,11 @@ static ElectricConductance() BaseDimensions = new BaseDimensions(-2, -1, 3, 2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Siemens. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricConductance(double siemens) - { - _value = Convert.ToDouble(siemens); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricConductance(double siemens) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Siemens. - /// - /// Value assuming base unit Siemens. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricConductance(long siemens) : this(Convert.ToDouble(siemens), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Siemens. - /// - /// Value assuming base unit Siemens. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricConductance(decimal siemens) : this(Convert.ToDouble(siemens), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricConductance(double siemens) public static QuantityType QuantityType => QuantityType.ElectricConductance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricConductance, which is Siemens. All conversions go via this value. /// public static ElectricConductanceUnit BaseUnit => ElectricConductanceUnit.Siemens; @@ -460,12 +423,6 @@ public static ElectricConductanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Siemens - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricConductanceUnit ToStringDefaultUnit { get; set; } = ElectricConductanceUnit.Siemens; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs index 20940ba28c..b7eecdd660 100644 --- a/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricConductivity.Common.g.cs @@ -82,21 +82,11 @@ static ElectricConductivity() BaseDimensions = new BaseDimensions(-3, -1, 3, 2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit SiemensPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricConductivity(double siemenspermeter) - { - _value = Convert.ToDouble(siemenspermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricConductivity(double siemenspermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit SiemensPerMeter. - /// - /// Value assuming base unit SiemensPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricConductivity(long siemenspermeter) : this(Convert.ToDouble(siemenspermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit SiemensPerMeter. - /// - /// Value assuming base unit SiemensPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricConductivity(decimal siemenspermeter) : this(Convert.ToDouble(siemenspermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricConductivity(double siemenspermeter) public static QuantityType QuantityType => QuantityType.ElectricConductivity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricConductivity, which is SiemensPerMeter. All conversions go via this value. /// public static ElectricConductivityUnit BaseUnit => ElectricConductivityUnit.SiemensPerMeter; @@ -418,12 +381,6 @@ public static ElectricConductivityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is SiemensPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricConductivityUnit ToStringDefaultUnit { get; set; } = ElectricConductivityUnit.SiemensPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs index 0a673f8658..c89040b50b 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs @@ -82,21 +82,11 @@ static ElectricCurrent() BaseDimensions = new BaseDimensions(0, 0, 0, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Ampere. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricCurrent(double amperes) - { - _value = Convert.ToDouble(amperes); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricCurrent(double amperes) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Ampere. - /// - /// Value assuming base unit Ampere. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrent(long amperes) : this(Convert.ToDouble(amperes), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Ampere. - /// - /// Value assuming base unit Ampere. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrent(decimal amperes) : this(Convert.ToDouble(amperes), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricCurrent(double amperes) public static QuantityType QuantityType => QuantityType.ElectricCurrent; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricCurrent, which is Ampere. All conversions go via this value. /// public static ElectricCurrentUnit BaseUnit => ElectricCurrentUnit.Ampere; @@ -565,12 +528,6 @@ public static ElectricCurrentUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Ampere - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricCurrentUnit ToStringDefaultUnit { get; set; } = ElectricCurrentUnit.Ampere; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs index 6123796558..07dc957242 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentDensity.Common.g.cs @@ -82,21 +82,11 @@ static ElectricCurrentDensity() BaseDimensions = new BaseDimensions(-2, 0, 0, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit AmperePerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricCurrentDensity(double amperespersquaremeter) - { - _value = Convert.ToDouble(amperespersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricCurrentDensity(double amperespersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit AmperePerSquareMeter. - /// - /// Value assuming base unit AmperePerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrentDensity(long amperespersquaremeter) : this(Convert.ToDouble(amperespersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit AmperePerSquareMeter. - /// - /// Value assuming base unit AmperePerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrentDensity(decimal amperespersquaremeter) : this(Convert.ToDouble(amperespersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricCurrentDensity(double amperespersquaremeter) public static QuantityType QuantityType => QuantityType.ElectricCurrentDensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricCurrentDensity, which is AmperePerSquareMeter. All conversions go via this value. /// public static ElectricCurrentDensityUnit BaseUnit => ElectricCurrentDensityUnit.AmperePerSquareMeter; @@ -418,12 +381,6 @@ public static ElectricCurrentDensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is AmperePerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricCurrentDensityUnit ToStringDefaultUnit { get; set; } = ElectricCurrentDensityUnit.AmperePerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs index 97716db3dd..98ba0877fa 100644 --- a/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricCurrentGradient.Common.g.cs @@ -82,21 +82,11 @@ static ElectricCurrentGradient() BaseDimensions = new BaseDimensions(0, 0, -1, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit AmperePerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricCurrentGradient(double amperespersecond) - { - _value = Convert.ToDouble(amperespersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricCurrentGradient(double amperespersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit AmperePerSecond. - /// - /// Value assuming base unit AmperePerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrentGradient(long amperespersecond) : this(Convert.ToDouble(amperespersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit AmperePerSecond. - /// - /// Value assuming base unit AmperePerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricCurrentGradient(decimal amperespersecond) : this(Convert.ToDouble(amperespersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricCurrentGradient(double amperespersecond) public static QuantityType QuantityType => QuantityType.ElectricCurrentGradient; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricCurrentGradient, which is AmperePerSecond. All conversions go via this value. /// public static ElectricCurrentGradientUnit BaseUnit => ElectricCurrentGradientUnit.AmperePerSecond; @@ -418,12 +381,6 @@ public static ElectricCurrentGradientUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is AmperePerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricCurrentGradientUnit ToStringDefaultUnit { get; set; } = ElectricCurrentGradientUnit.AmperePerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs index ba656adcfd..c7f4415c0d 100644 --- a/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricField.Common.g.cs @@ -82,21 +82,11 @@ static ElectricField() BaseDimensions = new BaseDimensions(1, 1, -3, -1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit VoltPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricField(double voltspermeter) - { - _value = Convert.ToDouble(voltspermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricField(double voltspermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltPerMeter. - /// - /// Value assuming base unit VoltPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricField(long voltspermeter) : this(Convert.ToDouble(voltspermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltPerMeter. - /// - /// Value assuming base unit VoltPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricField(decimal voltspermeter) : this(Convert.ToDouble(voltspermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricField(double voltspermeter) public static QuantityType QuantityType => QuantityType.ElectricField; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricField, which is VoltPerMeter. All conversions go via this value. /// public static ElectricFieldUnit BaseUnit => ElectricFieldUnit.VoltPerMeter; @@ -418,12 +381,6 @@ public static ElectricFieldUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricFieldUnit ToStringDefaultUnit { get; set; } = ElectricFieldUnit.VoltPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs index 0b93e27c20..5e99aca8fc 100644 --- a/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricInductance.Common.g.cs @@ -82,21 +82,11 @@ static ElectricInductance() BaseDimensions = new BaseDimensions(2, 1, -2, -2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Henry. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricInductance(double henries) - { - _value = Convert.ToDouble(henries); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricInductance(double henries) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Henry. - /// - /// Value assuming base unit Henry. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricInductance(long henries) : this(Convert.ToDouble(henries), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Henry. - /// - /// Value assuming base unit Henry. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricInductance(decimal henries) : this(Convert.ToDouble(henries), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricInductance(double henries) public static QuantityType QuantityType => QuantityType.ElectricInductance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricInductance, which is Henry. All conversions go via this value. /// public static ElectricInductanceUnit BaseUnit => ElectricInductanceUnit.Henry; @@ -418,12 +381,6 @@ public static ElectricInductanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Henry - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricInductanceUnit ToStringDefaultUnit { get; set; } = ElectricInductanceUnit.Henry; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs index d3a460a984..1335fe4f02 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotential.Common.g.cs @@ -82,21 +82,11 @@ static ElectricPotential() BaseDimensions = new BaseDimensions(2, 1, -3, -1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Volt. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricPotential(double volts) - { - _value = Convert.ToDouble(volts); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricPotential(double volts) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Volt. - /// - /// Value assuming base unit Volt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotential(long volts) : this(Convert.ToDouble(volts), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Volt. - /// - /// Value assuming base unit Volt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotential(decimal volts) : this(Convert.ToDouble(volts), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricPotential(double volts) public static QuantityType QuantityType => QuantityType.ElectricPotential; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricPotential, which is Volt. All conversions go via this value. /// public static ElectricPotentialUnit BaseUnit => ElectricPotentialUnit.Volt; @@ -502,12 +465,6 @@ public static ElectricPotentialUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Volt - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricPotentialUnit ToStringDefaultUnit { get; set; } = ElectricPotentialUnit.Volt; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs index 7b69083ed3..ede77df0b7 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialAc.Common.g.cs @@ -81,21 +81,11 @@ static ElectricPotentialAc() { } - /// - /// Creates the quantity with the given value in the base unit VoltAc. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricPotentialAc(double voltsac) - { - _value = Convert.ToDouble(voltsac); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public ElectricPotentialAc(double voltsac) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltAc. - /// - /// Value assuming base unit VoltAc. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotentialAc(long voltsac) : this(Convert.ToDouble(voltsac), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltAc. - /// - /// Value assuming base unit VoltAc. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotentialAc(decimal voltsac) : this(Convert.ToDouble(voltsac), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public ElectricPotentialAc(double voltsac) public static QuantityType QuantityType => QuantityType.ElectricPotentialAc; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricPotentialAc, which is VoltAc. All conversions go via this value. /// public static ElectricPotentialAcUnit BaseUnit => ElectricPotentialAcUnit.VoltAc; @@ -501,12 +464,6 @@ public static ElectricPotentialAcUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltAc - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricPotentialAcUnit ToStringDefaultUnit { get; set; } = ElectricPotentialAcUnit.VoltAc; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs index 0dca9b37e9..646534343f 100644 --- a/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricPotentialDc.Common.g.cs @@ -81,21 +81,11 @@ static ElectricPotentialDc() { } - /// - /// Creates the quantity with the given value in the base unit VoltDc. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricPotentialDc(double voltsdc) - { - _value = Convert.ToDouble(voltsdc); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public ElectricPotentialDc(double voltsdc) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltDc. - /// - /// Value assuming base unit VoltDc. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotentialDc(long voltsdc) : this(Convert.ToDouble(voltsdc), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltDc. - /// - /// Value assuming base unit VoltDc. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricPotentialDc(decimal voltsdc) : this(Convert.ToDouble(voltsdc), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public ElectricPotentialDc(double voltsdc) public static QuantityType QuantityType => QuantityType.ElectricPotentialDc; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricPotentialDc, which is VoltDc. All conversions go via this value. /// public static ElectricPotentialDcUnit BaseUnit => ElectricPotentialDcUnit.VoltDc; @@ -501,12 +464,6 @@ public static ElectricPotentialDcUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltDc - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricPotentialDcUnit ToStringDefaultUnit { get; set; } = ElectricPotentialDcUnit.VoltDc; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs index 50da50619a..edfbe3cf3c 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistance.Common.g.cs @@ -82,21 +82,11 @@ static ElectricResistance() BaseDimensions = new BaseDimensions(2, 1, -3, -2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Ohm. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricResistance(double ohms) - { - _value = Convert.ToDouble(ohms); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricResistance(double ohms) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Ohm. - /// - /// Value assuming base unit Ohm. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricResistance(long ohms) : this(Convert.ToDouble(ohms), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Ohm. - /// - /// Value assuming base unit Ohm. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricResistance(decimal ohms) : this(Convert.ToDouble(ohms), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricResistance(double ohms) public static QuantityType QuantityType => QuantityType.ElectricResistance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricResistance, which is Ohm. All conversions go via this value. /// public static ElectricResistanceUnit BaseUnit => ElectricResistanceUnit.Ohm; @@ -481,12 +444,6 @@ public static ElectricResistanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Ohm - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricResistanceUnit ToStringDefaultUnit { get; set; } = ElectricResistanceUnit.Ohm; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs index f6470b764a..1bf2b97e84 100644 --- a/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ElectricResistivity.Common.g.cs @@ -82,21 +82,11 @@ static ElectricResistivity() BaseDimensions = new BaseDimensions(3, 1, -3, -2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit OhmMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ElectricResistivity(double ohmmeters) - { - _value = Convert.ToDouble(ohmmeters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ElectricResistivity(double ohmmeters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit OhmMeter. - /// - /// Value assuming base unit OhmMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricResistivity(long ohmmeters) : this(Convert.ToDouble(ohmmeters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit OhmMeter. - /// - /// Value assuming base unit OhmMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ElectricResistivity(decimal ohmmeters) : this(Convert.ToDouble(ohmmeters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ElectricResistivity(double ohmmeters) public static QuantityType QuantityType => QuantityType.ElectricResistivity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ElectricResistivity, which is OhmMeter. All conversions go via this value. /// public static ElectricResistivityUnit BaseUnit => ElectricResistivityUnit.OhmMeter; @@ -481,12 +444,6 @@ public static ElectricResistivityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is OhmMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ElectricResistivityUnit ToStringDefaultUnit { get; set; } = ElectricResistivityUnit.OhmMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Energy.Common.g.cs b/Common/GeneratedCode/Quantities/Energy.Common.g.cs index 63c600f9ca..300d8ebd52 100644 --- a/Common/GeneratedCode/Quantities/Energy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Energy.Common.g.cs @@ -82,21 +82,11 @@ static Energy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Joule. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Energy(double joules) - { - _value = Convert.ToDouble(joules); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Energy(double joules) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Joule. - /// - /// Value assuming base unit Joule. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Energy(long joules) : this(Convert.ToDouble(joules), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Joule. - /// - /// Value assuming base unit Joule. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Energy(decimal joules) : this(Convert.ToDouble(joules), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Energy(double joules) public static QuantityType QuantityType => QuantityType.Energy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Energy, which is Joule. All conversions go via this value. /// public static EnergyUnit BaseUnit => EnergyUnit.Joule; @@ -859,12 +822,6 @@ public static EnergyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Joule - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static EnergyUnit ToStringDefaultUnit { get; set; } = EnergyUnit.Joule; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs index 3d589bae37..58134e394d 100644 --- a/Common/GeneratedCode/Quantities/Entropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Entropy.Common.g.cs @@ -82,21 +82,11 @@ static Entropy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, -1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerKelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Entropy(double joulesperkelvin) - { - _value = Convert.ToDouble(joulesperkelvin); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Entropy(double joulesperkelvin) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKelvin. - /// - /// Value assuming base unit JoulePerKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Entropy(long joulesperkelvin) : this(Convert.ToDouble(joulesperkelvin), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKelvin. - /// - /// Value assuming base unit JoulePerKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Entropy(decimal joulesperkelvin) : this(Convert.ToDouble(joulesperkelvin), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Entropy(double joulesperkelvin) public static QuantityType QuantityType => QuantityType.Entropy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Entropy, which is JoulePerKelvin. All conversions go via this value. /// public static EntropyUnit BaseUnit => EntropyUnit.JoulePerKelvin; @@ -544,12 +507,6 @@ public static EntropyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerKelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static EntropyUnit ToStringDefaultUnit { get; set; } = EntropyUnit.JoulePerKelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Force.Common.g.cs b/Common/GeneratedCode/Quantities/Force.Common.g.cs index 1f3c6a045c..423da91f80 100644 --- a/Common/GeneratedCode/Quantities/Force.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Force.Common.g.cs @@ -82,21 +82,11 @@ static Force() BaseDimensions = new BaseDimensions(1, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Newton. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Force(double newtons) - { - _value = Convert.ToDouble(newtons); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Force(double newtons) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Newton. - /// - /// Value assuming base unit Newton. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Force(long newtons) : this(Convert.ToDouble(newtons), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Newton. - /// - /// Value assuming base unit Newton. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Force(decimal newtons) : this(Convert.ToDouble(newtons), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Force(double newtons) public static QuantityType QuantityType => QuantityType.Force; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Force, which is Newton. All conversions go via this value. /// public static ForceUnit BaseUnit => ForceUnit.Newton; @@ -607,12 +570,6 @@ public static ForceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Newton - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ForceUnit ToStringDefaultUnit { get; set; } = ForceUnit.Newton; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs index 0438140ec6..8d40ac8eed 100644 --- a/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForceChangeRate.Common.g.cs @@ -82,21 +82,11 @@ static ForceChangeRate() BaseDimensions = new BaseDimensions(1, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ForceChangeRate(double newtonspersecond) - { - _value = Convert.ToDouble(newtonspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ForceChangeRate(double newtonspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerSecond. - /// - /// Value assuming base unit NewtonPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ForceChangeRate(long newtonspersecond) : this(Convert.ToDouble(newtonspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerSecond. - /// - /// Value assuming base unit NewtonPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ForceChangeRate(decimal newtonspersecond) : this(Convert.ToDouble(newtonspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ForceChangeRate(double newtonspersecond) public static QuantityType QuantityType => QuantityType.ForceChangeRate; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ForceChangeRate, which is NewtonPerSecond. All conversions go via this value. /// public static ForceChangeRateUnit BaseUnit => ForceChangeRateUnit.NewtonPerSecond; @@ -628,12 +591,6 @@ public static ForceChangeRateUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ForceChangeRateUnit ToStringDefaultUnit { get; set; } = ForceChangeRateUnit.NewtonPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs index ba7d43f39c..b125ddab77 100644 --- a/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ForcePerLength.Common.g.cs @@ -82,21 +82,11 @@ static ForcePerLength() BaseDimensions = new BaseDimensions(0, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ForcePerLength(double newtonspermeter) - { - _value = Convert.ToDouble(newtonspermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ForcePerLength(double newtonspermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerMeter. - /// - /// Value assuming base unit NewtonPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ForcePerLength(long newtonspermeter) : this(Convert.ToDouble(newtonspermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerMeter. - /// - /// Value assuming base unit NewtonPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ForcePerLength(decimal newtonspermeter) : this(Convert.ToDouble(newtonspermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ForcePerLength(double newtonspermeter) public static QuantityType QuantityType => QuantityType.ForcePerLength; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ForcePerLength, which is NewtonPerMeter. All conversions go via this value. /// public static ForcePerLengthUnit BaseUnit => ForcePerLengthUnit.NewtonPerMeter; @@ -586,12 +549,6 @@ public static ForcePerLengthUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ForcePerLengthUnit ToStringDefaultUnit { get; set; } = ForcePerLengthUnit.NewtonPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs index 8de729e386..ad20b1e708 100644 --- a/Common/GeneratedCode/Quantities/Frequency.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Frequency.Common.g.cs @@ -82,21 +82,11 @@ static Frequency() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Hertz. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Frequency(double hertz) - { - _value = Convert.ToDouble(hertz); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Frequency(double hertz) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Hertz. - /// - /// Value assuming base unit Hertz. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Frequency(long hertz) : this(Convert.ToDouble(hertz), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Hertz. - /// - /// Value assuming base unit Hertz. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Frequency(decimal hertz) : this(Convert.ToDouble(hertz), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Frequency(double hertz) public static QuantityType QuantityType => QuantityType.Frequency; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Frequency, which is Hertz. All conversions go via this value. /// public static FrequencyUnit BaseUnit => FrequencyUnit.Hertz; @@ -565,12 +528,6 @@ public static FrequencyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Hertz - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static FrequencyUnit ToStringDefaultUnit { get; set; } = FrequencyUnit.Hertz; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs index 91133819fd..3924581ad1 100644 --- a/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatFlux.Common.g.cs @@ -82,21 +82,11 @@ static HeatFlux() BaseDimensions = new BaseDimensions(0, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit WattPerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public HeatFlux(double wattspersquaremeter) - { - _value = Convert.ToDouble(wattspersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public HeatFlux(double wattspersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter. - /// - /// Value assuming base unit WattPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - HeatFlux(long wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter. - /// - /// Value assuming base unit WattPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - HeatFlux(decimal wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public HeatFlux(double wattspersquaremeter) public static QuantityType QuantityType => QuantityType.HeatFlux; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of HeatFlux, which is WattPerSquareMeter. All conversions go via this value. /// public static HeatFluxUnit BaseUnit => HeatFluxUnit.WattPerSquareMeter; @@ -733,12 +696,6 @@ public static HeatFluxUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is WattPerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static HeatFluxUnit ToStringDefaultUnit { get; set; } = HeatFluxUnit.WattPerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs index 297455ad5b..0af5b86e65 100644 --- a/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs +++ b/Common/GeneratedCode/Quantities/HeatTransferCoefficient.Common.g.cs @@ -82,21 +82,11 @@ static HeatTransferCoefficient() BaseDimensions = new BaseDimensions(0, 1, -3, 0, -1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit WattPerSquareMeterKelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public HeatTransferCoefficient(double wattspersquaremeterkelvin) - { - _value = Convert.ToDouble(wattspersquaremeterkelvin); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public HeatTransferCoefficient(double wattspersquaremeterkelvin) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeterKelvin. - /// - /// Value assuming base unit WattPerSquareMeterKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - HeatTransferCoefficient(long wattspersquaremeterkelvin) : this(Convert.ToDouble(wattspersquaremeterkelvin), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeterKelvin. - /// - /// Value assuming base unit WattPerSquareMeterKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - HeatTransferCoefficient(decimal wattspersquaremeterkelvin) : this(Convert.ToDouble(wattspersquaremeterkelvin), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public HeatTransferCoefficient(double wattspersquaremeterkelvin) public static QuantityType QuantityType => QuantityType.HeatTransferCoefficient; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of HeatTransferCoefficient, which is WattPerSquareMeterKelvin. All conversions go via this value. /// public static HeatTransferCoefficientUnit BaseUnit => HeatTransferCoefficientUnit.WattPerSquareMeterKelvin; @@ -439,12 +402,6 @@ public static HeatTransferCoefficientUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is WattPerSquareMeterKelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static HeatTransferCoefficientUnit ToStringDefaultUnit { get; set; } = HeatTransferCoefficientUnit.WattPerSquareMeterKelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs index 2fb9720e81..fa620ee0f1 100644 --- a/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Illuminance.Common.g.cs @@ -82,21 +82,11 @@ static Illuminance() BaseDimensions = new BaseDimensions(-2, 0, 0, 0, 0, 0, 1); } - /// - /// Creates the quantity with the given value in the base unit Lux. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Illuminance(double lux) - { - _value = Convert.ToDouble(lux); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Illuminance(double lux) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Lux. - /// - /// Value assuming base unit Lux. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Illuminance(long lux) : this(Convert.ToDouble(lux), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Lux. - /// - /// Value assuming base unit Lux. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Illuminance(decimal lux) : this(Convert.ToDouble(lux), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Illuminance(double lux) public static QuantityType QuantityType => QuantityType.Illuminance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Illuminance, which is Lux. All conversions go via this value. /// public static IlluminanceUnit BaseUnit => IlluminanceUnit.Lux; @@ -481,12 +444,6 @@ public static IlluminanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Lux - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static IlluminanceUnit ToStringDefaultUnit { get; set; } = IlluminanceUnit.Lux; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Information.Common.g.cs b/Common/GeneratedCode/Quantities/Information.Common.g.cs index 58bc851328..f970685a84 100644 --- a/Common/GeneratedCode/Quantities/Information.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Information.Common.g.cs @@ -81,21 +81,11 @@ static Information() { } - /// - /// Creates the quantity with the given value in the base unit Bit. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Information(double bits) - { - _value = Convert.ToDecimal(bits); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public Information(double bits) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Bit. - /// - /// Value assuming base unit Bit. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Information(long bits) : this(Convert.ToDecimal(bits), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Bit. - /// - /// Value assuming base unit Bit. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Information(decimal bits) : this(Convert.ToDecimal(bits), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public Information(double bits) public static QuantityType QuantityType => QuantityType.Information; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Information, which is Bit. All conversions go via this value. /// public static InformationUnit BaseUnit => InformationUnit.Bit; @@ -942,12 +905,6 @@ public static InformationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Bit - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static InformationUnit ToStringDefaultUnit { get; set; } = InformationUnit.Bit; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs index ef601d24e9..e88be7e7e5 100644 --- a/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiance.Common.g.cs @@ -82,21 +82,11 @@ static Irradiance() BaseDimensions = new BaseDimensions(0, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit WattPerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Irradiance(double wattspersquaremeter) - { - _value = Convert.ToDouble(wattspersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Irradiance(double wattspersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter. - /// - /// Value assuming base unit WattPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Irradiance(long wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter. - /// - /// Value assuming base unit WattPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Irradiance(decimal wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Irradiance(double wattspersquaremeter) public static QuantityType QuantityType => QuantityType.Irradiance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Irradiance, which is WattPerSquareMeter. All conversions go via this value. /// public static IrradianceUnit BaseUnit => IrradianceUnit.WattPerSquareMeter; @@ -439,12 +402,6 @@ public static IrradianceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is WattPerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static IrradianceUnit ToStringDefaultUnit { get; set; } = IrradianceUnit.WattPerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs index 954735b197..185c9dc106 100644 --- a/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Irradiation.Common.g.cs @@ -82,21 +82,11 @@ static Irradiation() BaseDimensions = new BaseDimensions(0, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Irradiation(double joulespersquaremeter) - { - _value = Convert.ToDouble(joulespersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Irradiation(double joulespersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerSquareMeter. - /// - /// Value assuming base unit JoulePerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Irradiation(long joulespersquaremeter) : this(Convert.ToDouble(joulespersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerSquareMeter. - /// - /// Value assuming base unit JoulePerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Irradiation(decimal joulespersquaremeter) : this(Convert.ToDouble(joulespersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Irradiation(double joulespersquaremeter) public static QuantityType QuantityType => QuantityType.Irradiation; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Irradiation, which is JoulePerSquareMeter. All conversions go via this value. /// public static IrradiationUnit BaseUnit => IrradiationUnit.JoulePerSquareMeter; @@ -460,12 +423,6 @@ public static IrradiationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static IrradiationUnit ToStringDefaultUnit { get; set; } = IrradiationUnit.JoulePerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs index f85da89005..31ab830023 100644 --- a/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/KinematicViscosity.Common.g.cs @@ -82,21 +82,11 @@ static KinematicViscosity() BaseDimensions = new BaseDimensions(2, 0, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit SquareMeterPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public KinematicViscosity(double squaremeterspersecond) - { - _value = Convert.ToDouble(squaremeterspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public KinematicViscosity(double squaremeterspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit SquareMeterPerSecond. - /// - /// Value assuming base unit SquareMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - KinematicViscosity(long squaremeterspersecond) : this(Convert.ToDouble(squaremeterspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit SquareMeterPerSecond. - /// - /// Value assuming base unit SquareMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - KinematicViscosity(decimal squaremeterspersecond) : this(Convert.ToDouble(squaremeterspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public KinematicViscosity(double squaremeterspersecond) public static QuantityType QuantityType => QuantityType.KinematicViscosity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of KinematicViscosity, which is SquareMeterPerSecond. All conversions go via this value. /// public static KinematicViscosityUnit BaseUnit => KinematicViscosityUnit.SquareMeterPerSecond; @@ -565,12 +528,6 @@ public static KinematicViscosityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is SquareMeterPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static KinematicViscosityUnit ToStringDefaultUnit { get; set; } = KinematicViscosityUnit.SquareMeterPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs index 314a93e445..f151d87f4b 100644 --- a/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LapseRate.Common.g.cs @@ -82,21 +82,11 @@ static LapseRate() BaseDimensions = new BaseDimensions(-1, 0, 0, 0, 1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit DegreeCelsiusPerKilometer. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public LapseRate(double degreescelciusperkilometer) - { - _value = Convert.ToDouble(degreescelciusperkilometer); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public LapseRate(double degreescelciusperkilometer) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit DegreeCelsiusPerKilometer. - /// - /// Value assuming base unit DegreeCelsiusPerKilometer. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LapseRate(long degreescelciusperkilometer) : this(Convert.ToDouble(degreescelciusperkilometer), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit DegreeCelsiusPerKilometer. - /// - /// Value assuming base unit DegreeCelsiusPerKilometer. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LapseRate(decimal degreescelciusperkilometer) : this(Convert.ToDouble(degreescelciusperkilometer), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public LapseRate(double degreescelciusperkilometer) public static QuantityType QuantityType => QuantityType.LapseRate; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of LapseRate, which is DegreeCelsiusPerKilometer. All conversions go via this value. /// public static LapseRateUnit BaseUnit => LapseRateUnit.DegreeCelsiusPerKilometer; @@ -418,12 +381,6 @@ public static LapseRateUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is DegreeCelsiusPerKilometer - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LapseRateUnit ToStringDefaultUnit { get; set; } = LapseRateUnit.DegreeCelsiusPerKilometer; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Length.Common.g.cs b/Common/GeneratedCode/Quantities/Length.Common.g.cs index d531a7dba5..df3c766803 100644 --- a/Common/GeneratedCode/Quantities/Length.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Length.Common.g.cs @@ -82,21 +82,11 @@ static Length() BaseDimensions = new BaseDimensions(1, 0, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Meter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Length(double meters) - { - _value = Convert.ToDouble(meters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Length(double meters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Meter. - /// - /// Value assuming base unit Meter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Length(long meters) : this(Convert.ToDouble(meters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Meter. - /// - /// Value assuming base unit Meter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Length(decimal meters) : this(Convert.ToDouble(meters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Length(double meters) public static QuantityType QuantityType => QuantityType.Length; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Length, which is Meter. All conversions go via this value. /// public static LengthUnit BaseUnit => LengthUnit.Meter; @@ -859,12 +822,6 @@ public static LengthUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Meter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LengthUnit ToStringDefaultUnit { get; set; } = LengthUnit.Meter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Level.Common.g.cs b/Common/GeneratedCode/Quantities/Level.Common.g.cs index eb5acf981e..135559cb2b 100644 --- a/Common/GeneratedCode/Quantities/Level.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Level.Common.g.cs @@ -81,21 +81,11 @@ static Level() { } - /// - /// Creates the quantity with the given value in the base unit Decibel. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Level(double decibels) - { - _value = Convert.ToDouble(decibels); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public Level(double decibels) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Decibel. - /// - /// Value assuming base unit Decibel. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Level(long decibels) : this(Convert.ToDouble(decibels), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Decibel. - /// - /// Value assuming base unit Decibel. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Level(decimal decibels) : this(Convert.ToDouble(decibels), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public Level(double decibels) public static QuantityType QuantityType => QuantityType.Level; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Level, which is Decibel. All conversions go via this value. /// public static LevelUnit BaseUnit => LevelUnit.Decibel; @@ -438,12 +401,6 @@ public static LevelUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Decibel - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LevelUnit ToStringDefaultUnit { get; set; } = LevelUnit.Decibel; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs index 03e4fe5bf0..ed61cef9dc 100644 --- a/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LinearDensity.Common.g.cs @@ -82,21 +82,11 @@ static LinearDensity() BaseDimensions = new BaseDimensions(-1, 1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public LinearDensity(double kilogramspermeter) - { - _value = Convert.ToDouble(kilogramspermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public LinearDensity(double kilogramspermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerMeter. - /// - /// Value assuming base unit KilogramPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LinearDensity(long kilogramspermeter) : this(Convert.ToDouble(kilogramspermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerMeter. - /// - /// Value assuming base unit KilogramPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LinearDensity(decimal kilogramspermeter) : this(Convert.ToDouble(kilogramspermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public LinearDensity(double kilogramspermeter) public static QuantityType QuantityType => QuantityType.LinearDensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of LinearDensity, which is KilogramPerMeter. All conversions go via this value. /// public static LinearDensityUnit BaseUnit => LinearDensityUnit.KilogramPerMeter; @@ -460,12 +423,6 @@ public static LinearDensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LinearDensityUnit ToStringDefaultUnit { get; set; } = LinearDensityUnit.KilogramPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs index cca9c30f7e..bbe14681e8 100644 --- a/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousFlux.Common.g.cs @@ -82,21 +82,11 @@ static LuminousFlux() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 0, 1); } - /// - /// Creates the quantity with the given value in the base unit Lumen. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public LuminousFlux(double lumens) - { - _value = Convert.ToDouble(lumens); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public LuminousFlux(double lumens) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Lumen. - /// - /// Value assuming base unit Lumen. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LuminousFlux(long lumens) : this(Convert.ToDouble(lumens), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Lumen. - /// - /// Value assuming base unit Lumen. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LuminousFlux(decimal lumens) : this(Convert.ToDouble(lumens), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public LuminousFlux(double lumens) public static QuantityType QuantityType => QuantityType.LuminousFlux; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of LuminousFlux, which is Lumen. All conversions go via this value. /// public static LuminousFluxUnit BaseUnit => LuminousFluxUnit.Lumen; @@ -418,12 +381,6 @@ public static LuminousFluxUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Lumen - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LuminousFluxUnit ToStringDefaultUnit { get; set; } = LuminousFluxUnit.Lumen; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs index 8a4ca9046e..105d0ab1b6 100644 --- a/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/LuminousIntensity.Common.g.cs @@ -82,21 +82,11 @@ static LuminousIntensity() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 0, 0, 1); } - /// - /// Creates the quantity with the given value in the base unit Candela. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public LuminousIntensity(double candela) - { - _value = Convert.ToDouble(candela); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public LuminousIntensity(double candela) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Candela. - /// - /// Value assuming base unit Candela. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LuminousIntensity(long candela) : this(Convert.ToDouble(candela), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Candela. - /// - /// Value assuming base unit Candela. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - LuminousIntensity(decimal candela) : this(Convert.ToDouble(candela), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public LuminousIntensity(double candela) public static QuantityType QuantityType => QuantityType.LuminousIntensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of LuminousIntensity, which is Candela. All conversions go via this value. /// public static LuminousIntensityUnit BaseUnit => LuminousIntensityUnit.Candela; @@ -418,12 +381,6 @@ public static LuminousIntensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Candela - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static LuminousIntensityUnit ToStringDefaultUnit { get; set; } = LuminousIntensityUnit.Candela; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs index 5fdc10ef5a..777010fce3 100644 --- a/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticField.Common.g.cs @@ -82,21 +82,11 @@ static MagneticField() BaseDimensions = new BaseDimensions(0, 1, -2, -1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Tesla. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MagneticField(double teslas) - { - _value = Convert.ToDouble(teslas); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MagneticField(double teslas) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Tesla. - /// - /// Value assuming base unit Tesla. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MagneticField(long teslas) : this(Convert.ToDouble(teslas), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Tesla. - /// - /// Value assuming base unit Tesla. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MagneticField(decimal teslas) : this(Convert.ToDouble(teslas), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MagneticField(double teslas) public static QuantityType QuantityType => QuantityType.MagneticField; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MagneticField, which is Tesla. All conversions go via this value. /// public static MagneticFieldUnit BaseUnit => MagneticFieldUnit.Tesla; @@ -418,12 +381,6 @@ public static MagneticFieldUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Tesla - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MagneticFieldUnit ToStringDefaultUnit { get; set; } = MagneticFieldUnit.Tesla; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs index ebc195b7cc..eab4ccba84 100644 --- a/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MagneticFlux.Common.g.cs @@ -82,21 +82,11 @@ static MagneticFlux() BaseDimensions = new BaseDimensions(2, 1, -2, -1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Weber. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MagneticFlux(double webers) - { - _value = Convert.ToDouble(webers); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MagneticFlux(double webers) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Weber. - /// - /// Value assuming base unit Weber. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MagneticFlux(long webers) : this(Convert.ToDouble(webers), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Weber. - /// - /// Value assuming base unit Weber. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MagneticFlux(decimal webers) : this(Convert.ToDouble(webers), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MagneticFlux(double webers) public static QuantityType QuantityType => QuantityType.MagneticFlux; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MagneticFlux, which is Weber. All conversions go via this value. /// public static MagneticFluxUnit BaseUnit => MagneticFluxUnit.Weber; @@ -418,12 +381,6 @@ public static MagneticFluxUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Weber - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MagneticFluxUnit ToStringDefaultUnit { get; set; } = MagneticFluxUnit.Weber; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs index 3c62db754d..3fe35ea7f5 100644 --- a/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Magnetization.Common.g.cs @@ -82,21 +82,11 @@ static Magnetization() BaseDimensions = new BaseDimensions(-1, 0, 0, 1, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit AmperePerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Magnetization(double amperespermeter) - { - _value = Convert.ToDouble(amperespermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Magnetization(double amperespermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit AmperePerMeter. - /// - /// Value assuming base unit AmperePerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Magnetization(long amperespermeter) : this(Convert.ToDouble(amperespermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit AmperePerMeter. - /// - /// Value assuming base unit AmperePerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Magnetization(decimal amperespermeter) : this(Convert.ToDouble(amperespermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Magnetization(double amperespermeter) public static QuantityType QuantityType => QuantityType.Magnetization; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Magnetization, which is AmperePerMeter. All conversions go via this value. /// public static MagnetizationUnit BaseUnit => MagnetizationUnit.AmperePerMeter; @@ -418,12 +381,6 @@ public static MagnetizationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is AmperePerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MagnetizationUnit ToStringDefaultUnit { get; set; } = MagnetizationUnit.AmperePerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Mass.Common.g.cs b/Common/GeneratedCode/Quantities/Mass.Common.g.cs index 06699b1b76..9aeaac81ef 100644 --- a/Common/GeneratedCode/Quantities/Mass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Mass.Common.g.cs @@ -82,21 +82,11 @@ static Mass() BaseDimensions = new BaseDimensions(0, 1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Kilogram. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Mass(double kilograms) - { - _value = Convert.ToDouble(kilograms); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Mass(double kilograms) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Kilogram. - /// - /// Value assuming base unit Kilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Mass(long kilograms) : this(Convert.ToDouble(kilograms), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Kilogram. - /// - /// Value assuming base unit Kilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Mass(decimal kilograms) : this(Convert.ToDouble(kilograms), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Mass(double kilograms) public static QuantityType QuantityType => QuantityType.Mass; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Mass, which is Kilogram. All conversions go via this value. /// public static MassUnit BaseUnit => MassUnit.Kilogram; @@ -838,12 +801,6 @@ public static MassUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Kilogram - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MassUnit ToStringDefaultUnit { get; set; } = MassUnit.Kilogram; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs index b6a3b0578a..4920b42077 100644 --- a/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlow.Common.g.cs @@ -82,21 +82,11 @@ static MassFlow() BaseDimensions = new BaseDimensions(0, 1, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit GramPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MassFlow(double gramspersecond) - { - _value = Convert.ToDouble(gramspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MassFlow(double gramspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit GramPerSecond. - /// - /// Value assuming base unit GramPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassFlow(long gramspersecond) : this(Convert.ToDouble(gramspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit GramPerSecond. - /// - /// Value assuming base unit GramPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassFlow(decimal gramspersecond) : this(Convert.ToDouble(gramspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MassFlow(double gramspersecond) public static QuantityType QuantityType => QuantityType.MassFlow; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MassFlow, which is GramPerSecond. All conversions go via this value. /// public static MassFlowUnit BaseUnit => MassFlowUnit.GramPerSecond; @@ -712,12 +675,6 @@ public static MassFlowUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is GramPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MassFlowUnit ToStringDefaultUnit { get; set; } = MassFlowUnit.GramPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs index 5f9eccc4b9..b7eaf6eeff 100644 --- a/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassFlux.Common.g.cs @@ -82,21 +82,11 @@ static MassFlux() BaseDimensions = new BaseDimensions(-2, 1, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerSecondPerSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MassFlux(double kilogramspersecondpersquaremeter) - { - _value = Convert.ToDouble(kilogramspersecondpersquaremeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MassFlux(double kilogramspersecondpersquaremeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerSecondPerSquareMeter. - /// - /// Value assuming base unit KilogramPerSecondPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassFlux(long kilogramspersecondpersquaremeter) : this(Convert.ToDouble(kilogramspersecondpersquaremeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerSecondPerSquareMeter. - /// - /// Value assuming base unit KilogramPerSecondPerSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassFlux(decimal kilogramspersecondpersquaremeter) : this(Convert.ToDouble(kilogramspersecondpersquaremeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MassFlux(double kilogramspersecondpersquaremeter) public static QuantityType QuantityType => QuantityType.MassFlux; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MassFlux, which is KilogramPerSecondPerSquareMeter. All conversions go via this value. /// public static MassFluxUnit BaseUnit => MassFluxUnit.KilogramPerSecondPerSquareMeter; @@ -439,12 +402,6 @@ public static MassFluxUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerSecondPerSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MassFluxUnit ToStringDefaultUnit { get; set; } = MassFluxUnit.KilogramPerSecondPerSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs index c5605de962..6dd62ed4b8 100644 --- a/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MassMomentOfInertia.Common.g.cs @@ -82,21 +82,11 @@ static MassMomentOfInertia() BaseDimensions = new BaseDimensions(2, 1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramSquareMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MassMomentOfInertia(double kilogramsquaremeters) - { - _value = Convert.ToDouble(kilogramsquaremeters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MassMomentOfInertia(double kilogramsquaremeters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramSquareMeter. - /// - /// Value assuming base unit KilogramSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassMomentOfInertia(long kilogramsquaremeters) : this(Convert.ToDouble(kilogramsquaremeters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramSquareMeter. - /// - /// Value assuming base unit KilogramSquareMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MassMomentOfInertia(decimal kilogramsquaremeters) : this(Convert.ToDouble(kilogramsquaremeters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MassMomentOfInertia(double kilogramsquaremeters) public static QuantityType QuantityType => QuantityType.MassMomentOfInertia; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MassMomentOfInertia, which is KilogramSquareMeter. All conversions go via this value. /// public static MassMomentOfInertiaUnit BaseUnit => MassMomentOfInertiaUnit.KilogramSquareMeter; @@ -943,12 +906,6 @@ public static MassMomentOfInertiaUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramSquareMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MassMomentOfInertiaUnit ToStringDefaultUnit { get; set; } = MassMomentOfInertiaUnit.KilogramSquareMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs index e489ed704f..7d9bdf58b3 100644 --- a/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEnergy.Common.g.cs @@ -82,21 +82,11 @@ static MolarEnergy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, -1, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerMole. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MolarEnergy(double joulespermole) - { - _value = Convert.ToDouble(joulespermole); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MolarEnergy(double joulespermole) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerMole. - /// - /// Value assuming base unit JoulePerMole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarEnergy(long joulespermole) : this(Convert.ToDouble(joulespermole), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerMole. - /// - /// Value assuming base unit JoulePerMole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarEnergy(decimal joulespermole) : this(Convert.ToDouble(joulespermole), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MolarEnergy(double joulespermole) public static QuantityType QuantityType => QuantityType.MolarEnergy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MolarEnergy, which is JoulePerMole. All conversions go via this value. /// public static MolarEnergyUnit BaseUnit => MolarEnergyUnit.JoulePerMole; @@ -460,12 +423,6 @@ public static MolarEnergyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerMole - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MolarEnergyUnit ToStringDefaultUnit { get; set; } = MolarEnergyUnit.JoulePerMole; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs index 4398823241..a198221bc0 100644 --- a/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarEntropy.Common.g.cs @@ -82,21 +82,11 @@ static MolarEntropy() BaseDimensions = new BaseDimensions(2, 1, -2, 0, -1, -1, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerMoleKelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MolarEntropy(double joulespermolekelvin) - { - _value = Convert.ToDouble(joulespermolekelvin); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MolarEntropy(double joulespermolekelvin) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerMoleKelvin. - /// - /// Value assuming base unit JoulePerMoleKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarEntropy(long joulespermolekelvin) : this(Convert.ToDouble(joulespermolekelvin), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerMoleKelvin. - /// - /// Value assuming base unit JoulePerMoleKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarEntropy(decimal joulespermolekelvin) : this(Convert.ToDouble(joulespermolekelvin), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MolarEntropy(double joulespermolekelvin) public static QuantityType QuantityType => QuantityType.MolarEntropy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MolarEntropy, which is JoulePerMoleKelvin. All conversions go via this value. /// public static MolarEntropyUnit BaseUnit => MolarEntropyUnit.JoulePerMoleKelvin; @@ -460,12 +423,6 @@ public static MolarEntropyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerMoleKelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MolarEntropyUnit ToStringDefaultUnit { get; set; } = MolarEntropyUnit.JoulePerMoleKelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs index 46a44da8de..caaf577f31 100644 --- a/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs +++ b/Common/GeneratedCode/Quantities/MolarMass.Common.g.cs @@ -82,21 +82,11 @@ static MolarMass() BaseDimensions = new BaseDimensions(0, 1, 0, 0, 0, -1, 0); } - /// - /// Creates the quantity with the given value in the base unit KilogramPerMole. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public MolarMass(double kilogramspermole) - { - _value = Convert.ToDouble(kilogramspermole); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public MolarMass(double kilogramspermole) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerMole. - /// - /// Value assuming base unit KilogramPerMole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarMass(long kilogramspermole) : this(Convert.ToDouble(kilogramspermole), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit KilogramPerMole. - /// - /// Value assuming base unit KilogramPerMole. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - MolarMass(decimal kilogramspermole) : this(Convert.ToDouble(kilogramspermole), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public MolarMass(double kilogramspermole) public static QuantityType QuantityType => QuantityType.MolarMass; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of MolarMass, which is KilogramPerMole. All conversions go via this value. /// public static MolarMassUnit BaseUnit => MolarMassUnit.KilogramPerMole; @@ -649,12 +612,6 @@ public static MolarMassUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is KilogramPerMole - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MolarMassUnit ToStringDefaultUnit { get; set; } = MolarMassUnit.KilogramPerMole; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs index eba201c6d1..5a11b934cf 100644 --- a/Common/GeneratedCode/Quantities/Molarity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Molarity.Common.g.cs @@ -82,21 +82,11 @@ static Molarity() BaseDimensions = new BaseDimensions(-3, 0, 0, 0, 0, 1, 0); } - /// - /// Creates the quantity with the given value in the base unit MolesPerCubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Molarity(double molespercubicmeter) - { - _value = Convert.ToDouble(molespercubicmeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Molarity(double molespercubicmeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit MolesPerCubicMeter. - /// - /// Value assuming base unit MolesPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Molarity(long molespercubicmeter) : this(Convert.ToDouble(molespercubicmeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit MolesPerCubicMeter. - /// - /// Value assuming base unit MolesPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Molarity(decimal molespercubicmeter) : this(Convert.ToDouble(molespercubicmeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Molarity(double molespercubicmeter) public static QuantityType QuantityType => QuantityType.Molarity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Molarity, which is MolesPerCubicMeter. All conversions go via this value. /// public static MolarityUnit BaseUnit => MolarityUnit.MolesPerCubicMeter; @@ -565,12 +528,6 @@ public static MolarityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is MolesPerCubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static MolarityUnit ToStringDefaultUnit { get; set; } = MolarityUnit.MolesPerCubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs index aa289fc355..605d01f70f 100644 --- a/Common/GeneratedCode/Quantities/Permeability.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permeability.Common.g.cs @@ -82,21 +82,11 @@ static Permeability() BaseDimensions = new BaseDimensions(1, 1, -2, -2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit HenryPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Permeability(double henriespermeter) - { - _value = Convert.ToDouble(henriespermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Permeability(double henriespermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit HenryPerMeter. - /// - /// Value assuming base unit HenryPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Permeability(long henriespermeter) : this(Convert.ToDouble(henriespermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit HenryPerMeter. - /// - /// Value assuming base unit HenryPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Permeability(decimal henriespermeter) : this(Convert.ToDouble(henriespermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Permeability(double henriespermeter) public static QuantityType QuantityType => QuantityType.Permeability; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Permeability, which is HenryPerMeter. All conversions go via this value. /// public static PermeabilityUnit BaseUnit => PermeabilityUnit.HenryPerMeter; @@ -418,12 +381,6 @@ public static PermeabilityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is HenryPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PermeabilityUnit ToStringDefaultUnit { get; set; } = PermeabilityUnit.HenryPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs index 6cf39ac74a..5e478eebca 100644 --- a/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Permittivity.Common.g.cs @@ -82,21 +82,11 @@ static Permittivity() BaseDimensions = new BaseDimensions(-3, -1, 4, 2, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit FaradPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Permittivity(double faradspermeter) - { - _value = Convert.ToDouble(faradspermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Permittivity(double faradspermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit FaradPerMeter. - /// - /// Value assuming base unit FaradPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Permittivity(long faradspermeter) : this(Convert.ToDouble(faradspermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit FaradPerMeter. - /// - /// Value assuming base unit FaradPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Permittivity(decimal faradspermeter) : this(Convert.ToDouble(faradspermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Permittivity(double faradspermeter) public static QuantityType QuantityType => QuantityType.Permittivity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Permittivity, which is FaradPerMeter. All conversions go via this value. /// public static PermittivityUnit BaseUnit => PermittivityUnit.FaradPerMeter; @@ -418,12 +381,6 @@ public static PermittivityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is FaradPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PermittivityUnit ToStringDefaultUnit { get; set; } = PermittivityUnit.FaradPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Power.Common.g.cs b/Common/GeneratedCode/Quantities/Power.Common.g.cs index 01ddb1832b..ba59d32489 100644 --- a/Common/GeneratedCode/Quantities/Power.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Power.Common.g.cs @@ -82,21 +82,11 @@ static Power() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Watt. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Power(double watts) - { - _value = Convert.ToDecimal(watts); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Power(double watts) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Watt. - /// - /// Value assuming base unit Watt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Power(long watts) : this(Convert.ToDecimal(watts), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Watt. - /// - /// Value assuming base unit Watt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Power(decimal watts) : this(Convert.ToDecimal(watts), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Power(double watts) public static QuantityType QuantityType => QuantityType.Power; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Power, which is Watt. All conversions go via this value. /// public static PowerUnit BaseUnit => PowerUnit.Watt; @@ -817,12 +780,6 @@ public static PowerUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Watt - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PowerUnit ToStringDefaultUnit { get; set; } = PowerUnit.Watt; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs index c6e521f6f0..8d8ab2583b 100644 --- a/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerDensity.Common.g.cs @@ -82,21 +82,11 @@ static PowerDensity() BaseDimensions = new BaseDimensions(-1, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit WattPerCubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public PowerDensity(double wattspercubicmeter) - { - _value = Convert.ToDouble(wattspercubicmeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public PowerDensity(double wattspercubicmeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit WattPerCubicMeter. - /// - /// Value assuming base unit WattPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PowerDensity(long wattspercubicmeter) : this(Convert.ToDouble(wattspercubicmeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit WattPerCubicMeter. - /// - /// Value assuming base unit WattPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PowerDensity(decimal wattspercubicmeter) : this(Convert.ToDouble(wattspercubicmeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public PowerDensity(double wattspercubicmeter) public static QuantityType QuantityType => QuantityType.PowerDensity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of PowerDensity, which is WattPerCubicMeter. All conversions go via this value. /// public static PowerDensityUnit BaseUnit => PowerDensityUnit.WattPerCubicMeter; @@ -1321,12 +1284,6 @@ public static PowerDensityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is WattPerCubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PowerDensityUnit ToStringDefaultUnit { get; set; } = PowerDensityUnit.WattPerCubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs index 4522c28c71..76a694a796 100644 --- a/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PowerRatio.Common.g.cs @@ -81,21 +81,11 @@ static PowerRatio() { } - /// - /// Creates the quantity with the given value in the base unit DecibelWatt. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public PowerRatio(double decibelwatts) - { - _value = Convert.ToDouble(decibelwatts); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public PowerRatio(double decibelwatts) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit DecibelWatt. - /// - /// Value assuming base unit DecibelWatt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PowerRatio(long decibelwatts) : this(Convert.ToDouble(decibelwatts), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit DecibelWatt. - /// - /// Value assuming base unit DecibelWatt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PowerRatio(decimal decibelwatts) : this(Convert.ToDouble(decibelwatts), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public PowerRatio(double decibelwatts) public static QuantityType QuantityType => QuantityType.PowerRatio; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of PowerRatio, which is DecibelWatt. All conversions go via this value. /// public static PowerRatioUnit BaseUnit => PowerRatioUnit.DecibelWatt; @@ -438,12 +401,6 @@ public static PowerRatioUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is DecibelWatt - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PowerRatioUnit ToStringDefaultUnit { get; set; } = PowerRatioUnit.DecibelWatt; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs index b8abaad74e..ec02f2f093 100644 --- a/Common/GeneratedCode/Quantities/Pressure.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Pressure.Common.g.cs @@ -82,21 +82,11 @@ static Pressure() BaseDimensions = new BaseDimensions(-1, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Pascal. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Pressure(double pascals) - { - _value = Convert.ToDouble(pascals); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Pressure(double pascals) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Pascal. - /// - /// Value assuming base unit Pascal. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Pressure(long pascals) : this(Convert.ToDouble(pascals), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Pascal. - /// - /// Value assuming base unit Pascal. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Pressure(decimal pascals) : this(Convert.ToDouble(pascals), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Pressure(double pascals) public static QuantityType QuantityType => QuantityType.Pressure; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Pressure, which is Pascal. All conversions go via this value. /// public static PressureUnit BaseUnit => PressureUnit.Pascal; @@ -1174,12 +1137,6 @@ public static PressureUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Pascal - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PressureUnit ToStringDefaultUnit { get; set; } = PressureUnit.Pascal; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs index 80b59387ae..5eb9d4e36f 100644 --- a/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/PressureChangeRate.Common.g.cs @@ -82,21 +82,11 @@ static PressureChangeRate() BaseDimensions = new BaseDimensions(-1, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit PascalPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public PressureChangeRate(double pascalspersecond) - { - _value = Convert.ToDouble(pascalspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public PressureChangeRate(double pascalspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit PascalPerSecond. - /// - /// Value assuming base unit PascalPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PressureChangeRate(long pascalspersecond) : this(Convert.ToDouble(pascalspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit PascalPerSecond. - /// - /// Value assuming base unit PascalPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - PressureChangeRate(decimal pascalspersecond) : this(Convert.ToDouble(pascalspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public PressureChangeRate(double pascalspersecond) public static QuantityType QuantityType => QuantityType.PressureChangeRate; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of PressureChangeRate, which is PascalPerSecond. All conversions go via this value. /// public static PressureChangeRateUnit BaseUnit => PressureChangeRateUnit.PascalPerSecond; @@ -481,12 +444,6 @@ public static PressureChangeRateUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is PascalPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static PressureChangeRateUnit ToStringDefaultUnit { get; set; } = PressureChangeRateUnit.PascalPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs index 009264ca78..9a9ed80adf 100644 --- a/Common/GeneratedCode/Quantities/Ratio.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Ratio.Common.g.cs @@ -81,21 +81,11 @@ static Ratio() { } - /// - /// Creates the quantity with the given value in the base unit DecimalFraction. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Ratio(double decimalfractions) - { - _value = Convert.ToDouble(decimalfractions); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public Ratio(double decimalfractions) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit DecimalFraction. - /// - /// Value assuming base unit DecimalFraction. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Ratio(long decimalfractions) : this(Convert.ToDouble(decimalfractions), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit DecimalFraction. - /// - /// Value assuming base unit DecimalFraction. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Ratio(decimal decimalfractions) : this(Convert.ToDouble(decimalfractions), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public Ratio(double decimalfractions) public static QuantityType QuantityType => QuantityType.Ratio; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Ratio, which is DecimalFraction. All conversions go via this value. /// public static RatioUnit BaseUnit => RatioUnit.DecimalFraction; @@ -522,12 +485,6 @@ public static RatioUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is DecimalFraction - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static RatioUnit ToStringDefaultUnit { get; set; } = RatioUnit.DecimalFraction; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs index 7bb5753464..f0c04d4347 100644 --- a/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactiveEnergy.Common.g.cs @@ -82,21 +82,11 @@ static ReactiveEnergy() BaseDimensions = new BaseDimensions(2, 1, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit VoltampereReactiveHour. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ReactiveEnergy(double voltamperereactivehours) - { - _value = Convert.ToDouble(voltamperereactivehours); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ReactiveEnergy(double voltamperereactivehours) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltampereReactiveHour. - /// - /// Value assuming base unit VoltampereReactiveHour. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ReactiveEnergy(long voltamperereactivehours) : this(Convert.ToDouble(voltamperereactivehours), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltampereReactiveHour. - /// - /// Value assuming base unit VoltampereReactiveHour. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ReactiveEnergy(decimal voltamperereactivehours) : this(Convert.ToDouble(voltamperereactivehours), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ReactiveEnergy(double voltamperereactivehours) public static QuantityType QuantityType => QuantityType.ReactiveEnergy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ReactiveEnergy, which is VoltampereReactiveHour. All conversions go via this value. /// public static ReactiveEnergyUnit BaseUnit => ReactiveEnergyUnit.VoltampereReactiveHour; @@ -460,12 +423,6 @@ public static ReactiveEnergyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltampereReactiveHour - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ReactiveEnergyUnit ToStringDefaultUnit { get; set; } = ReactiveEnergyUnit.VoltampereReactiveHour; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs index b2e709fc04..58efa1c60c 100644 --- a/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ReactivePower.Common.g.cs @@ -82,21 +82,11 @@ static ReactivePower() BaseDimensions = new BaseDimensions(2, 1, -3, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit VoltampereReactive. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ReactivePower(double voltamperesreactive) - { - _value = Convert.ToDouble(voltamperesreactive); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ReactivePower(double voltamperesreactive) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit VoltampereReactive. - /// - /// Value assuming base unit VoltampereReactive. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ReactivePower(long voltamperesreactive) : this(Convert.ToDouble(voltamperesreactive), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit VoltampereReactive. - /// - /// Value assuming base unit VoltampereReactive. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ReactivePower(decimal voltamperesreactive) : this(Convert.ToDouble(voltamperesreactive), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ReactivePower(double voltamperesreactive) public static QuantityType QuantityType => QuantityType.ReactivePower; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ReactivePower, which is VoltampereReactive. All conversions go via this value. /// public static ReactivePowerUnit BaseUnit => ReactivePowerUnit.VoltampereReactive; @@ -481,12 +444,6 @@ public static ReactivePowerUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is VoltampereReactive - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ReactivePowerUnit ToStringDefaultUnit { get; set; } = ReactivePowerUnit.VoltampereReactive; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs index 31c452b7be..62db2b62c3 100644 --- a/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalAcceleration.Common.g.cs @@ -82,21 +82,11 @@ static RotationalAcceleration() BaseDimensions = new BaseDimensions(0, 0, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit RadianPerSecondSquared. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public RotationalAcceleration(double radianspersecondsquared) - { - _value = Convert.ToDouble(radianspersecondsquared); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public RotationalAcceleration(double radianspersecondsquared) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit RadianPerSecondSquared. - /// - /// Value assuming base unit RadianPerSecondSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalAcceleration(long radianspersecondsquared) : this(Convert.ToDouble(radianspersecondsquared), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit RadianPerSecondSquared. - /// - /// Value assuming base unit RadianPerSecondSquared. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalAcceleration(decimal radianspersecondsquared) : this(Convert.ToDouble(radianspersecondsquared), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public RotationalAcceleration(double radianspersecondsquared) public static QuantityType QuantityType => QuantityType.RotationalAcceleration; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of RotationalAcceleration, which is RadianPerSecondSquared. All conversions go via this value. /// public static RotationalAccelerationUnit BaseUnit => RotationalAccelerationUnit.RadianPerSecondSquared; @@ -460,12 +423,6 @@ public static RotationalAccelerationUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is RadianPerSecondSquared - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static RotationalAccelerationUnit ToStringDefaultUnit { get; set; } = RotationalAccelerationUnit.RadianPerSecondSquared; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs index 74139b6f12..62a31f62bf 100644 --- a/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalSpeed.Common.g.cs @@ -82,21 +82,11 @@ static RotationalSpeed() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit RadianPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public RotationalSpeed(double radianspersecond) - { - _value = Convert.ToDouble(radianspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public RotationalSpeed(double radianspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit RadianPerSecond. - /// - /// Value assuming base unit RadianPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalSpeed(long radianspersecond) : this(Convert.ToDouble(radianspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit RadianPerSecond. - /// - /// Value assuming base unit RadianPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalSpeed(decimal radianspersecond) : this(Convert.ToDouble(radianspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public RotationalSpeed(double radianspersecond) public static QuantityType QuantityType => QuantityType.RotationalSpeed; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of RotationalSpeed, which is RadianPerSecond. All conversions go via this value. /// public static RotationalSpeedUnit BaseUnit => RotationalSpeedUnit.RadianPerSecond; @@ -670,12 +633,6 @@ public static RotationalSpeedUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is RadianPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static RotationalSpeedUnit ToStringDefaultUnit { get; set; } = RotationalSpeedUnit.RadianPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs index d79562ee83..6b9bff2b71 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffness.Common.g.cs @@ -82,21 +82,11 @@ static RotationalStiffness() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonMeterPerRadian. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public RotationalStiffness(double newtonmetersperradian) - { - _value = Convert.ToDouble(newtonmetersperradian); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public RotationalStiffness(double newtonmetersperradian) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeterPerRadian. - /// - /// Value assuming base unit NewtonMeterPerRadian. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalStiffness(long newtonmetersperradian) : this(Convert.ToDouble(newtonmetersperradian), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeterPerRadian. - /// - /// Value assuming base unit NewtonMeterPerRadian. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalStiffness(decimal newtonmetersperradian) : this(Convert.ToDouble(newtonmetersperradian), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public RotationalStiffness(double newtonmetersperradian) public static QuantityType QuantityType => QuantityType.RotationalStiffness; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of RotationalStiffness, which is NewtonMeterPerRadian. All conversions go via this value. /// public static RotationalStiffnessUnit BaseUnit => RotationalStiffnessUnit.NewtonMeterPerRadian; @@ -460,12 +423,6 @@ public static RotationalStiffnessUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonMeterPerRadian - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static RotationalStiffnessUnit ToStringDefaultUnit { get; set; } = RotationalStiffnessUnit.NewtonMeterPerRadian; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs index 8eace32d2a..67cbb7fb44 100644 --- a/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs +++ b/Common/GeneratedCode/Quantities/RotationalStiffnessPerLength.Common.g.cs @@ -82,21 +82,11 @@ static RotationalStiffnessPerLength() BaseDimensions = new BaseDimensions(1, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonMeterPerRadianPerMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public RotationalStiffnessPerLength(double newtonmetersperradianpermeter) - { - _value = Convert.ToDouble(newtonmetersperradianpermeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public RotationalStiffnessPerLength(double newtonmetersperradianpermeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeterPerRadianPerMeter. - /// - /// Value assuming base unit NewtonMeterPerRadianPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalStiffnessPerLength(long newtonmetersperradianpermeter) : this(Convert.ToDouble(newtonmetersperradianpermeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeterPerRadianPerMeter. - /// - /// Value assuming base unit NewtonMeterPerRadianPerMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - RotationalStiffnessPerLength(decimal newtonmetersperradianpermeter) : this(Convert.ToDouble(newtonmetersperradianpermeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public RotationalStiffnessPerLength(double newtonmetersperradianpermeter) public static QuantityType QuantityType => QuantityType.RotationalStiffnessPerLength; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of RotationalStiffnessPerLength, which is NewtonMeterPerRadianPerMeter. All conversions go via this value. /// public static RotationalStiffnessPerLengthUnit BaseUnit => RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter; @@ -460,12 +423,6 @@ public static RotationalStiffnessPerLengthUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonMeterPerRadianPerMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static RotationalStiffnessPerLengthUnit ToStringDefaultUnit { get; set; } = RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs index d6395d037d..ecdbbb4195 100644 --- a/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SolidAngle.Common.g.cs @@ -81,21 +81,11 @@ static SolidAngle() { } - /// - /// Creates the quantity with the given value in the base unit Steradian. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public SolidAngle(double steradians) - { - _value = Convert.ToDouble(steradians); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public SolidAngle(double steradians) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Steradian. - /// - /// Value assuming base unit Steradian. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SolidAngle(long steradians) : this(Convert.ToDouble(steradians), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Steradian. - /// - /// Value assuming base unit Steradian. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SolidAngle(decimal steradians) : this(Convert.ToDouble(steradians), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public SolidAngle(double steradians) public static QuantityType QuantityType => QuantityType.SolidAngle; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of SolidAngle, which is Steradian. All conversions go via this value. /// public static SolidAngleUnit BaseUnit => SolidAngleUnit.Steradian; @@ -417,12 +380,6 @@ public static SolidAngleUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Steradian - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SolidAngleUnit ToStringDefaultUnit { get; set; } = SolidAngleUnit.Steradian; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs index b7898c0eb2..6ec937c74f 100644 --- a/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEnergy.Common.g.cs @@ -82,21 +82,11 @@ static SpecificEnergy() BaseDimensions = new BaseDimensions(2, 0, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerKilogram. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public SpecificEnergy(double joulesperkilogram) - { - _value = Convert.ToDouble(joulesperkilogram); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public SpecificEnergy(double joulesperkilogram) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKilogram. - /// - /// Value assuming base unit JoulePerKilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificEnergy(long joulesperkilogram) : this(Convert.ToDouble(joulesperkilogram), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKilogram. - /// - /// Value assuming base unit JoulePerKilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificEnergy(decimal joulesperkilogram) : this(Convert.ToDouble(joulesperkilogram), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public SpecificEnergy(double joulesperkilogram) public static QuantityType QuantityType => QuantityType.SpecificEnergy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of SpecificEnergy, which is JoulePerKilogram. All conversions go via this value. /// public static SpecificEnergyUnit BaseUnit => SpecificEnergyUnit.JoulePerKilogram; @@ -565,12 +528,6 @@ public static SpecificEnergyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerKilogram - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SpecificEnergyUnit ToStringDefaultUnit { get; set; } = SpecificEnergyUnit.JoulePerKilogram; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs index 0794eb0c20..3842b05971 100644 --- a/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificEntropy.Common.g.cs @@ -82,21 +82,11 @@ static SpecificEntropy() BaseDimensions = new BaseDimensions(2, 0, -2, 0, -1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit JoulePerKilogramKelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public SpecificEntropy(double joulesperkilogramkelvin) - { - _value = Convert.ToDouble(joulesperkilogramkelvin); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public SpecificEntropy(double joulesperkilogramkelvin) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKilogramKelvin. - /// - /// Value assuming base unit JoulePerKilogramKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificEntropy(long joulesperkilogramkelvin) : this(Convert.ToDouble(joulesperkilogramkelvin), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit JoulePerKilogramKelvin. - /// - /// Value assuming base unit JoulePerKilogramKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificEntropy(decimal joulesperkilogramkelvin) : this(Convert.ToDouble(joulesperkilogramkelvin), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public SpecificEntropy(double joulesperkilogramkelvin) public static QuantityType QuantityType => QuantityType.SpecificEntropy; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of SpecificEntropy, which is JoulePerKilogramKelvin. All conversions go via this value. /// public static SpecificEntropyUnit BaseUnit => SpecificEntropyUnit.JoulePerKilogramKelvin; @@ -565,12 +528,6 @@ public static SpecificEntropyUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is JoulePerKilogramKelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SpecificEntropyUnit ToStringDefaultUnit { get; set; } = SpecificEntropyUnit.JoulePerKilogramKelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs index df6f9659e7..2f1280f0aa 100644 --- a/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificVolume.Common.g.cs @@ -82,21 +82,11 @@ static SpecificVolume() BaseDimensions = new BaseDimensions(3, -1, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit CubicMeterPerKilogram. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public SpecificVolume(double cubicmetersperkilogram) - { - _value = Convert.ToDouble(cubicmetersperkilogram); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public SpecificVolume(double cubicmetersperkilogram) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerKilogram. - /// - /// Value assuming base unit CubicMeterPerKilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificVolume(long cubicmetersperkilogram) : this(Convert.ToDouble(cubicmetersperkilogram), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerKilogram. - /// - /// Value assuming base unit CubicMeterPerKilogram. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificVolume(decimal cubicmetersperkilogram) : this(Convert.ToDouble(cubicmetersperkilogram), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public SpecificVolume(double cubicmetersperkilogram) public static QuantityType QuantityType => QuantityType.SpecificVolume; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of SpecificVolume, which is CubicMeterPerKilogram. All conversions go via this value. /// public static SpecificVolumeUnit BaseUnit => SpecificVolumeUnit.CubicMeterPerKilogram; @@ -439,12 +402,6 @@ public static SpecificVolumeUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is CubicMeterPerKilogram - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SpecificVolumeUnit ToStringDefaultUnit { get; set; } = SpecificVolumeUnit.CubicMeterPerKilogram; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs index d693509480..339c20529d 100644 --- a/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs +++ b/Common/GeneratedCode/Quantities/SpecificWeight.Common.g.cs @@ -82,21 +82,11 @@ static SpecificWeight() BaseDimensions = new BaseDimensions(-2, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonPerCubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public SpecificWeight(double newtonspercubicmeter) - { - _value = Convert.ToDouble(newtonspercubicmeter); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public SpecificWeight(double newtonspercubicmeter) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerCubicMeter. - /// - /// Value assuming base unit NewtonPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificWeight(long newtonspercubicmeter) : this(Convert.ToDouble(newtonspercubicmeter), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonPerCubicMeter. - /// - /// Value assuming base unit NewtonPerCubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - SpecificWeight(decimal newtonspercubicmeter) : this(Convert.ToDouble(newtonspercubicmeter), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public SpecificWeight(double newtonspercubicmeter) public static QuantityType QuantityType => QuantityType.SpecificWeight; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of SpecificWeight, which is NewtonPerCubicMeter. All conversions go via this value. /// public static SpecificWeightUnit BaseUnit => SpecificWeightUnit.NewtonPerCubicMeter; @@ -754,12 +717,6 @@ public static SpecificWeightUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonPerCubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SpecificWeightUnit ToStringDefaultUnit { get; set; } = SpecificWeightUnit.NewtonPerCubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Speed.Common.g.cs b/Common/GeneratedCode/Quantities/Speed.Common.g.cs index a2fea1e2f5..1910b3ae57 100644 --- a/Common/GeneratedCode/Quantities/Speed.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Speed.Common.g.cs @@ -82,21 +82,11 @@ static Speed() BaseDimensions = new BaseDimensions(1, 0, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit MeterPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Speed(double meterspersecond) - { - _value = Convert.ToDouble(meterspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Speed(double meterspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit MeterPerSecond. - /// - /// Value assuming base unit MeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Speed(long meterspersecond) : this(Convert.ToDouble(meterspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit MeterPerSecond. - /// - /// Value assuming base unit MeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Speed(decimal meterspersecond) : this(Convert.ToDouble(meterspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Speed(double meterspersecond) public static QuantityType QuantityType => QuantityType.Speed; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Speed, which is MeterPerSecond. All conversions go via this value. /// public static SpeedUnit BaseUnit => SpeedUnit.MeterPerSecond; @@ -1069,12 +1032,6 @@ public static SpeedUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is MeterPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static SpeedUnit ToStringDefaultUnit { get; set; } = SpeedUnit.MeterPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs index c37f61723d..2ee2dd11d2 100644 --- a/Common/GeneratedCode/Quantities/Temperature.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Temperature.Common.g.cs @@ -82,21 +82,11 @@ static Temperature() BaseDimensions = new BaseDimensions(0, 0, 0, 0, 1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit Kelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Temperature(double kelvins) - { - _value = Convert.ToDouble(kelvins); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Temperature(double kelvins) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Kelvin. - /// - /// Value assuming base unit Kelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Temperature(long kelvins) : this(Convert.ToDouble(kelvins), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Kelvin. - /// - /// Value assuming base unit Kelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Temperature(decimal kelvins) : this(Convert.ToDouble(kelvins), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Temperature(double kelvins) public static QuantityType QuantityType => QuantityType.Temperature; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Temperature, which is Kelvin. All conversions go via this value. /// public static TemperatureUnit BaseUnit => TemperatureUnit.Kelvin; @@ -565,12 +528,6 @@ public static TemperatureUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Kelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static TemperatureUnit ToStringDefaultUnit { get; set; } = TemperatureUnit.Kelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs index 0e31c995ab..3fafb7743b 100644 --- a/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureChangeRate.Common.g.cs @@ -82,21 +82,11 @@ static TemperatureChangeRate() BaseDimensions = new BaseDimensions(0, 0, -1, 0, 1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit DegreeCelsiusPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public TemperatureChangeRate(double degreescelsiuspersecond) - { - _value = Convert.ToDouble(degreescelsiuspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public TemperatureChangeRate(double degreescelsiuspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit DegreeCelsiusPerSecond. - /// - /// Value assuming base unit DegreeCelsiusPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - TemperatureChangeRate(long degreescelsiuspersecond) : this(Convert.ToDouble(degreescelsiuspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit DegreeCelsiusPerSecond. - /// - /// Value assuming base unit DegreeCelsiusPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - TemperatureChangeRate(decimal degreescelsiuspersecond) : this(Convert.ToDouble(degreescelsiuspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public TemperatureChangeRate(double degreescelsiuspersecond) public static QuantityType QuantityType => QuantityType.TemperatureChangeRate; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of TemperatureChangeRate, which is DegreeCelsiusPerSecond. All conversions go via this value. /// public static TemperatureChangeRateUnit BaseUnit => TemperatureChangeRateUnit.DegreeCelsiusPerSecond; @@ -607,12 +570,6 @@ public static TemperatureChangeRateUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is DegreeCelsiusPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static TemperatureChangeRateUnit ToStringDefaultUnit { get; set; } = TemperatureChangeRateUnit.DegreeCelsiusPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs index 56b1174cea..8728ee1613 100644 --- a/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs +++ b/Common/GeneratedCode/Quantities/TemperatureDelta.Common.g.cs @@ -81,21 +81,11 @@ static TemperatureDelta() { } - /// - /// Creates the quantity with the given value in the base unit Kelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public TemperatureDelta(double kelvins) - { - _value = Convert.ToDouble(kelvins); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public TemperatureDelta(double kelvins) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit Kelvin. - /// - /// Value assuming base unit Kelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - TemperatureDelta(long kelvins) : this(Convert.ToDouble(kelvins), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit Kelvin. - /// - /// Value assuming base unit Kelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - TemperatureDelta(decimal kelvins) : this(Convert.ToDouble(kelvins), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public TemperatureDelta(double kelvins) public static QuantityType QuantityType => QuantityType.TemperatureDelta; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of TemperatureDelta, which is Kelvin. All conversions go via this value. /// public static TemperatureDeltaUnit BaseUnit => TemperatureDeltaUnit.Kelvin; @@ -564,12 +527,6 @@ public static TemperatureDeltaUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is Kelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static TemperatureDeltaUnit ToStringDefaultUnit { get; set; } = TemperatureDeltaUnit.Kelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs index a4e61e57a4..e433887e49 100644 --- a/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalConductivity.Common.g.cs @@ -82,21 +82,11 @@ static ThermalConductivity() BaseDimensions = new BaseDimensions(1, 1, -3, 0, -1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit WattPerMeterKelvin. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ThermalConductivity(double wattspermeterkelvin) - { - _value = Convert.ToDouble(wattspermeterkelvin); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ThermalConductivity(double wattspermeterkelvin) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit WattPerMeterKelvin. - /// - /// Value assuming base unit WattPerMeterKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ThermalConductivity(long wattspermeterkelvin) : this(Convert.ToDouble(wattspermeterkelvin), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit WattPerMeterKelvin. - /// - /// Value assuming base unit WattPerMeterKelvin. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ThermalConductivity(decimal wattspermeterkelvin) : this(Convert.ToDouble(wattspermeterkelvin), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ThermalConductivity(double wattspermeterkelvin) public static QuantityType QuantityType => QuantityType.ThermalConductivity; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ThermalConductivity, which is WattPerMeterKelvin. All conversions go via this value. /// public static ThermalConductivityUnit BaseUnit => ThermalConductivityUnit.WattPerMeterKelvin; @@ -439,12 +402,6 @@ public static ThermalConductivityUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is WattPerMeterKelvin - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ThermalConductivityUnit ToStringDefaultUnit { get; set; } = ThermalConductivityUnit.WattPerMeterKelvin; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs index 85126307c8..9652cb4f1d 100644 --- a/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs +++ b/Common/GeneratedCode/Quantities/ThermalResistance.Common.g.cs @@ -82,21 +82,11 @@ static ThermalResistance() BaseDimensions = new BaseDimensions(0, -1, 3, 0, 1, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit SquareMeterKelvinPerKilowatt. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public ThermalResistance(double squaremeterkelvinsperkilowatt) - { - _value = Convert.ToDouble(squaremeterkelvinsperkilowatt); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public ThermalResistance(double squaremeterkelvinsperkilowatt) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit SquareMeterKelvinPerKilowatt. - /// - /// Value assuming base unit SquareMeterKelvinPerKilowatt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ThermalResistance(long squaremeterkelvinsperkilowatt) : this(Convert.ToDouble(squaremeterkelvinsperkilowatt), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit SquareMeterKelvinPerKilowatt. - /// - /// Value assuming base unit SquareMeterKelvinPerKilowatt. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - ThermalResistance(decimal squaremeterkelvinsperkilowatt) : this(Convert.ToDouble(squaremeterkelvinsperkilowatt), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public ThermalResistance(double squaremeterkelvinsperkilowatt) public static QuantityType QuantityType => QuantityType.ThermalResistance; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of ThermalResistance, which is SquareMeterKelvinPerKilowatt. All conversions go via this value. /// public static ThermalResistanceUnit BaseUnit => ThermalResistanceUnit.SquareMeterKelvinPerKilowatt; @@ -502,12 +465,6 @@ public static ThermalResistanceUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is SquareMeterKelvinPerKilowatt - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static ThermalResistanceUnit ToStringDefaultUnit { get; set; } = ThermalResistanceUnit.SquareMeterKelvinPerKilowatt; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Torque.Common.g.cs b/Common/GeneratedCode/Quantities/Torque.Common.g.cs index f0d000fc2a..d0187fa896 100644 --- a/Common/GeneratedCode/Quantities/Torque.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Torque.Common.g.cs @@ -82,21 +82,11 @@ static Torque() BaseDimensions = new BaseDimensions(2, 1, -2, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit NewtonMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Torque(double newtonmeters) - { - _value = Convert.ToDouble(newtonmeters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Torque(double newtonmeters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeter. - /// - /// Value assuming base unit NewtonMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Torque(long newtonmeters) : this(Convert.ToDouble(newtonmeters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit NewtonMeter. - /// - /// Value assuming base unit NewtonMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Torque(decimal newtonmeters) : this(Convert.ToDouble(newtonmeters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Torque(double newtonmeters) public static QuantityType QuantityType => QuantityType.Torque; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Torque, which is NewtonMeter. All conversions go via this value. /// public static TorqueUnit BaseUnit => TorqueUnit.NewtonMeter; @@ -838,12 +801,6 @@ public static TorqueUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is NewtonMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static TorqueUnit ToStringDefaultUnit { get; set; } = TorqueUnit.NewtonMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs index 1c1419845f..43a11b2394 100644 --- a/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VitaminA.Common.g.cs @@ -81,21 +81,11 @@ static VitaminA() { } - /// - /// Creates the quantity with the given value in the base unit InternationalUnit. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public VitaminA(double internationalunits) - { - _value = Convert.ToDouble(internationalunits); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -108,33 +98,6 @@ public VitaminA(double internationalunits) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit InternationalUnit. - /// - /// Value assuming base unit InternationalUnit. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - VitaminA(long internationalunits) : this(Convert.ToDouble(internationalunits), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit InternationalUnit. - /// - /// Value assuming base unit InternationalUnit. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - VitaminA(decimal internationalunits) : this(Convert.ToDouble(internationalunits), BaseUnit) { } - #region Properties /// @@ -143,7 +106,7 @@ public VitaminA(double internationalunits) public static QuantityType QuantityType => QuantityType.VitaminA; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of VitaminA, which is InternationalUnit. All conversions go via this value. /// public static VitaminAUnit BaseUnit => VitaminAUnit.InternationalUnit; @@ -417,12 +380,6 @@ public static VitaminAUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is InternationalUnit - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static VitaminAUnit ToStringDefaultUnit { get; set; } = VitaminAUnit.InternationalUnit; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/Volume.Common.g.cs b/Common/GeneratedCode/Quantities/Volume.Common.g.cs index 05794e5cee..f4b37e14a4 100644 --- a/Common/GeneratedCode/Quantities/Volume.Common.g.cs +++ b/Common/GeneratedCode/Quantities/Volume.Common.g.cs @@ -82,21 +82,11 @@ static Volume() BaseDimensions = new BaseDimensions(3, 0, 0, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit CubicMeter. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public Volume(double cubicmeters) - { - _value = Convert.ToDouble(cubicmeters); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public Volume(double cubicmeters) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit CubicMeter. - /// - /// Value assuming base unit CubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Volume(long cubicmeters) : this(Convert.ToDouble(cubicmeters), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit CubicMeter. - /// - /// Value assuming base unit CubicMeter. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - Volume(decimal cubicmeters) : this(Convert.ToDouble(cubicmeters), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public Volume(double cubicmeters) public static QuantityType QuantityType => QuantityType.Volume; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of Volume, which is CubicMeter. All conversions go via this value. /// public static VolumeUnit BaseUnit => VolumeUnit.CubicMeter; @@ -1279,12 +1242,6 @@ public static VolumeUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is CubicMeter - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static VolumeUnit ToStringDefaultUnit { get; set; } = VolumeUnit.CubicMeter; - /// /// Get default string representation of value and unit. /// diff --git a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs index feab95716d..80fa85e868 100644 --- a/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs +++ b/Common/GeneratedCode/Quantities/VolumeFlow.Common.g.cs @@ -82,21 +82,11 @@ static VolumeFlow() BaseDimensions = new BaseDimensions(3, 0, -1, 0, 0, 0, 0); } - /// - /// Creates the quantity with the given value in the base unit CubicMeterPerSecond. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public VolumeFlow(double cubicmeterspersecond) - { - _value = Convert.ToDouble(cubicmeterspersecond); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -109,33 +99,6 @@ public VolumeFlow(double cubicmeterspersecond) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerSecond. - /// - /// Value assuming base unit CubicMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - VolumeFlow(long cubicmeterspersecond) : this(Convert.ToDouble(cubicmeterspersecond), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit CubicMeterPerSecond. - /// - /// Value assuming base unit CubicMeterPerSecond. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - VolumeFlow(decimal cubicmeterspersecond) : this(Convert.ToDouble(cubicmeterspersecond), BaseUnit) { } - #region Properties /// @@ -144,7 +107,7 @@ public VolumeFlow(double cubicmeterspersecond) public static QuantityType QuantityType => QuantityType.VolumeFlow; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of VolumeFlow, which is CubicMeterPerSecond. All conversions go via this value. /// public static VolumeFlowUnit BaseUnit => VolumeFlowUnit.CubicMeterPerSecond; @@ -943,12 +906,6 @@ public static VolumeFlowUnit ParseUnit(string str) #endregion - /// - /// Set the default unit used by ToString(). Default is CubicMeterPerSecond - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static VolumeFlowUnit ToStringDefaultUnit { get; set; } = VolumeFlowUnit.CubicMeterPerSecond; - /// /// Get default string representation of value and unit. /// diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index 875ba7dff8..6b24ef9e04 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -130,22 +130,16 @@ public void LengthTimesSpecificWeightEqualsPressure() [Fact] public void ToStringReturnsCorrectNumberAndUnitWithDefaultUnitWhichIsMeter() { - LengthUnit oldUnit = Length.ToStringDefaultUnit; - Length.ToStringDefaultUnit = LengthUnit.Meter; - Length meter = Length.FromMeters(5); + var meter = Length.FromMeters(5); string meterString = meter.ToString(); - Length.ToStringDefaultUnit = oldUnit; Assert.Equal("5 m", meterString); } [Fact] public void ToStringReturnsCorrectNumberAndUnitWithCentimeterAsDefualtUnit() { - LengthUnit oldUnit = Length.ToStringDefaultUnit; - Length.ToStringDefaultUnit = LengthUnit.Centimeter; - Length value = Length.From(2, LengthUnit.Centimeter); + var value = Length.From(2, LengthUnit.Centimeter); string valueString = value.ToString(); - Length.ToStringDefaultUnit = oldUnit; Assert.Equal("2 cm", valueString); } @@ -159,8 +153,6 @@ public void MaxValueIsCorrectForUnitWithBaseTypeDouble() public void MinValueIsCorrectForUnitWithBaseTypeDouble() { Assert.Equal(double.MinValue, Length.MinValue.Meters); - } - - + } } } diff --git a/UnitsNet.Tests/CustomCode/ParseTests.cs b/UnitsNet.Tests/CustomCode/ParseTests.cs index 3fb03de1a0..f19995b13e 100644 --- a/UnitsNet.Tests/CustomCode/ParseTests.cs +++ b/UnitsNet.Tests/CustomCode/ParseTests.cs @@ -188,7 +188,7 @@ public void TryParseLengthUnitAbbreviationSpecialCharacters(string s) { string abbrev = $"m{s}s"; - UnitSystem unitSystem = UnitSystem.GetCached(); + var unitSystem = UnitSystem.Default; unitSystem.MapUnitToAbbreviation(LengthUnit.Meter, abbrev); // Act @@ -217,7 +217,7 @@ public void TryParseLengthSpecialCharacters(string s) { string abbrev = $"m{s}s"; - UnitSystem unitSystem = UnitSystem.GetCached(); + var unitSystem = UnitSystem.Default; unitSystem.MapUnitToAbbreviation(LengthUnit.Meter, abbrev); // Act @@ -235,4 +235,4 @@ private static string AssertExceptionAndGetFullTypeName(Action code) } } -} \ No newline at end of file +} diff --git a/UnitsNet.Tests/QuantityTests.Ctor.cs b/UnitsNet.Tests/QuantityTests.Ctor.cs index ff13b7293d..29892d21e4 100644 --- a/UnitsNet.Tests/QuantityTests.Ctor.cs +++ b/UnitsNet.Tests/QuantityTests.Ctor.cs @@ -66,28 +66,22 @@ public void CtorWithOnlyValueOfRepresentativeTypes_SetsValueToGivenValueAndUnitT { #pragma warning disable 618 // double types - Assert.Equal(5, new Mass(5L).Value); - Assert.Equal(5, new Mass(5d).Value); - Assert.Equal(5, new Mass(5m).Value); - Assert.Equal(MassUnit.Kilogram, new Mass(5L).Unit); - Assert.Equal(MassUnit.Kilogram, new Mass(5d).Unit); - Assert.Equal(MassUnit.Kilogram, new Mass(5m).Unit); + Assert.Equal(5, new Mass(5L, MassUnit.Kilogram).Value); + Assert.Equal(5, new Mass(5d, MassUnit.Kilogram).Value); + Assert.Equal(MassUnit.Kilogram, new Mass(5L, MassUnit.Kilogram).Unit); + Assert.Equal(MassUnit.Kilogram, new Mass(5d, MassUnit.Kilogram).Unit); // decimal types - Assert.Equal(5, new Information(5L).Value); - Assert.Equal(5, new Information(5d).Value); - Assert.Equal(5, new Information(5m).Value); - Assert.Equal(InformationUnit.Bit, new Information(5L).Unit); - Assert.Equal(InformationUnit.Bit, new Information(5d).Unit); - Assert.Equal(InformationUnit.Bit, new Information(5m).Unit); + Assert.Equal(5, new Information(5L, InformationUnit.Bit).Value); + Assert.Equal(5, new Information(5m, InformationUnit.Bit).Value); + Assert.Equal(InformationUnit.Bit, new Information(5L, InformationUnit.Bit).Unit); + Assert.Equal(InformationUnit.Bit, new Information(5m, InformationUnit.Bit).Unit); // logarithmic types - Assert.Equal(5, new Level(5L).Value); - Assert.Equal(5, new Level(5d).Value); - Assert.Equal(5, new Level(5m).Value); - Assert.Equal(LevelUnit.Decibel, new Level(5L).Unit); - Assert.Equal(LevelUnit.Decibel, new Level(5d).Unit); - Assert.Equal(LevelUnit.Decibel, new Level(5m).Unit); + Assert.Equal(5, new Level(5L, LevelUnit.Decibel).Value); + Assert.Equal(5, new Level(5d, LevelUnit.Decibel).Value); + Assert.Equal(LevelUnit.Decibel, new Level(5L, LevelUnit.Decibel).Unit); + Assert.Equal(LevelUnit.Decibel, new Level(5d, LevelUnit.Decibel).Unit); #pragma warning restore 618 } diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index bab0e87a31..d0cad78e31 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -48,19 +48,16 @@ public void CreatedByCtorWithValue_ReturnsValueInBaseUnit() { #pragma warning disable 618 // double types - Assert.Equal("5 kg", new Mass(5L).ToString()); - Assert.Equal("5 kg", new Mass(5d).ToString()); - Assert.Equal("5 kg", new Mass(5m).ToString()); + Assert.Equal("5 kg", new Mass(5L, MassUnit.Kilogram).ToString()); + Assert.Equal("5 kg", new Mass(5d, MassUnit.Kilogram).ToString()); // decimal types - Assert.Equal("5 b", new Information(5L).ToString()); - Assert.Equal("5 b", new Information(5d).ToString()); - Assert.Equal("5 b", new Information(5m).ToString()); + Assert.Equal("5 b", new Information(5L, InformationUnit.Bit).ToString()); + Assert.Equal("5 b", new Information(5m, InformationUnit.Bit).ToString()); // logarithmic types - Assert.Equal("5 dB", new Level(5L).ToString()); - Assert.Equal("5 dB", new Level(5d).ToString()); - Assert.Equal("5 dB", new Level(5m).ToString()); + Assert.Equal("5 dB", new Level(5L, LevelUnit.Decibel).ToString()); + Assert.Equal("5 dB", new Level(5d, LevelUnit.Decibel).ToString()); #pragma warning restore 618 } diff --git a/UnitsNet/CustomCode/Quantities/Density.extra.cs b/UnitsNet/CustomCode/Quantities/Density.extra.cs index d3ce59f41d..f49aa66054 100644 --- a/UnitsNet/CustomCode/Quantities/Density.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Density.extra.cs @@ -19,6 +19,8 @@ // 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 { @@ -38,7 +40,7 @@ public partial struct Density /// public static Density FromMolarity(Molarity molarity, Mass molecularWeight) { - return new Density(molarity.MolesPerCubicMeter * molecularWeight.Kilograms); + return new Density(molarity.MolesPerCubicMeter * molecularWeight.Kilograms, DensityUnit.KilogramPerCubicMeter); } public static Molarity ToMolarity(Density density, Mass molecularWeight) diff --git a/UnitsNet/CustomCode/Quantities/Force.extra.cs b/UnitsNet/CustomCode/Quantities/Force.extra.cs index 86b3ed0711..925f36002d 100644 --- a/UnitsNet/CustomCode/Quantities/Force.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Force.extra.cs @@ -19,6 +19,8 @@ // 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 { @@ -70,24 +72,24 @@ public static Force FromPressureByArea(Pressure p, Length2d area) { double metersSquared = area.Meters.X * area.Meters.Y; double newtons = p.Pascals * metersSquared; - return new Force(newtons); + return new Force(newtons, ForceUnit.Newton); } public static Force FromMassByAcceleration(Mass mass, double metersPerSecondSquared) { - return new Force(mass.Kilograms * metersPerSecondSquared); + return new Force(mass.Kilograms * metersPerSecondSquared, ForceUnit.Newton); } #endif public static Force FromPressureByArea(Pressure p, Area area) { double newtons = p.Pascals * area.SquareMeters; - return new Force(newtons); + return new Force(newtons, ForceUnit.Newton); } public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) { - return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared); + return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared, ForceUnit.Newton); } } } diff --git a/UnitsNet/CustomCode/Quantities/Mass.extra.cs b/UnitsNet/CustomCode/Quantities/Mass.extra.cs index c6e95535ba..d3bcb95044 100644 --- a/UnitsNet/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Mass.extra.cs @@ -43,7 +43,7 @@ public partial struct Mass { public static Mass FromGravitationalForce(Force f) { - return new Mass(f.KilogramsForce); + return new Mass(f.KilogramsForce, MassUnit.Kilogram); } /// diff --git a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs index ec0234a55c..fed00fd718 100644 --- a/UnitsNet/CustomCode/Quantities/Temperature.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Temperature.extra.cs @@ -42,7 +42,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator +(Temperature left, TemperatureDelta right) { - return new Temperature(left.Kelvins + right.Kelvins); + return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); } /// @@ -52,7 +52,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator +(TemperatureDelta left, Temperature right) { - return new Temperature(left.Kelvins + right.Kelvins); + return new Temperature(left.Kelvins + right.Kelvins, TemperatureUnit.Kelvin); } /// @@ -62,7 +62,7 @@ public partial struct Temperature /// The new temperature. public static Temperature operator -(Temperature left, TemperatureDelta right) { - return new Temperature(left.Kelvins - right.Kelvins); + return new Temperature(left.Kelvins - right.Kelvins, TemperatureUnit.Kelvin); } /// @@ -72,7 +72,7 @@ public partial struct Temperature /// The delta temperature (difference). public static TemperatureDelta operator -(Temperature left, Temperature right) { - return new TemperatureDelta(left.Kelvins - right.Kelvins); + return new TemperatureDelta(left.Kelvins - right.Kelvins, TemperatureDeltaUnit.Kelvin); } #endif diff --git a/UnitsNet/CustomCode/UnitSystem.cs b/UnitsNet/CustomCode/UnitSystem.cs index ce253110bc..96480fe653 100644 --- a/UnitsNet/CustomCode/UnitSystem.cs +++ b/UnitsNet/CustomCode/UnitSystem.cs @@ -170,19 +170,6 @@ public static void ClearCache() /// public static UnitSystem Default { get; } - /// - /// Get or create a unit system for parsing and presenting numbers, units and abbreviations. - /// Creating can be a little expensive, so it will use a static cache. - /// To always create, use the constructor. - /// - /// - [PublicAPI] - [Obsolete("Use Default property instead. This will be removed in the future.")] - public static UnitSystem GetCached() - { - return GetCached((CultureInfo) null); - } - /// /// Get or create a unit system for parsing and presenting numbers, units and abbreviations. /// Creating can be a little expensive, so it will use a static cache. diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 0e89ea1a12..abc8b531d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 86d4278cd0..54dae240ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AmountOfSubstanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index e0fa81cd5d..3890d65c81 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -206,22 +206,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AmplitudeRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 51753db5d2..8ee77fbb07 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AngleUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 41bfe2d46f..7126014656 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ApparentEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 992613a95a..e7f3876a00 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ApparentPowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index a4bfa9e295..4a78728771 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AreaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 6b09e42eac..68ea82e0ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AreaDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index d036010068..b6deeba9b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static AreaMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index cff763ba49..547a014d6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static BitRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 37117d872c..e8b48451a0 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index aadea1f0ba..5f78a6bec7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static CapacitanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index c6f7ba50ad..c660c1fc01 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static DensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index a79dbc61c0..208ff3b97b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static DurationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index d9ce2d1c0f..f3fa49c89b 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static DynamicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index e3b6f3a675..cb31364683 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricAdmittanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 3b730d7636..18efe4a0e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricChargeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 8acc8b5ae7..fcc03c55ad 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricChargeDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 070ece5b15..238030bc1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricConductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 6ce3b2e513..d47b82afee 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 8871210be8..6cf9b5f786 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricCurrentUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 3539d817cb..3956dc8a2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricCurrentDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index a6c8c1147b..90a87f9049 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricCurrentGradientUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index ebe7da9c35..9940a9a992 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index fd65f779ff..66dfef16a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricInductanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 5274b4408b..5b8a4309e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricPotentialUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 1cc663ba20..53d6878b7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricPotentialAcUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 27cca700b0..da8f5b3231 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricPotentialDcUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 3e8a9c21ab..4bff291ea6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index d99910acb6..6ae294b97f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ElectricResistivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index df820fd0f7..4468aad936 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static EnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index fed433b0eb..bc266dc27e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static EntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index fea2fa4acf..b5bbff6bcc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ForceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index c61e9c3e84..5e0d1e5d3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ForceChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 7ab074def9..0534685498 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ForcePerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 7bb6f55ee9..9a999adabd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static FrequencyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 84ecd3f8ba..e0c935debc 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static HeatFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 8108210b8e..516718c8e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static HeatTransferCoefficientUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index bd3a431902..3e1f7708ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static IlluminanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 7a9bd15f06..2265ac0dbf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static InformationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index dfdc82a528..5ac0ef7f64 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static IrradianceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 14e0412c7e..1a0600987e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static IrradiationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index df4c9fa5ea..ef81f91a07 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static KinematicViscosityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index bfb092ff67..2a9f9695bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LapseRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 555d9d433c..632c724111 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index cbefbe65ed..20bbc116f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -206,22 +206,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LevelUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index fcb1d06321..67e7de580b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LinearDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index d14b4ee9e4..dd2ffe5259 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LuminousFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index c26523eddc..f332edb8c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static LuminousIntensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 067cea1f87..21e4d7a9dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MagneticFieldUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 4422776439..be07962f89 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MagneticFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 3ca49af665..20a2249692 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MagnetizationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 86076f6624..cccaf87614 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MassUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index bf68b78921..d92936439f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MassFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index db65fd8e30..6855724183 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MassFluxUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index aefa2e81c8..4fc2841028 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MassMomentOfInertiaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 80d8afb19f..dd077c86a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MolarEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 41d856b93b..4987e0c2a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MolarEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 52f9603a76..4c3e986d9d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MolarMassUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 2d95d42b4a..b096e85cf6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static MolarityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 81e66bc7d2..ecfb4bf5e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PermeabilityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 07356c0d81..d930b75949 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PermittivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index c2829747c5..721c0ef565 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 215fba3ef2..34b054f58f 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PowerDensityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index 53e5e4ec00..ef8cf7fc52 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -206,22 +206,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PowerRatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 1591939f2f..40355b473d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PressureUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 4f19dd87ed..b7dc931e94 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static PressureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 8598f87910..07a1bb1ad7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static RatioUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index db75cedd3d..3314c26a6d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ReactiveEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index a65bfc0bdc..d5c83bcffb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ReactivePowerUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index e61be585d8..53e9edc9f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static RotationalAccelerationUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 8bb5adb58f..82d86893a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static RotationalSpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index cb5e6ae90a..5beaf16d7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static RotationalStiffnessUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index f25f52cf57..dd8a972bca 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static RotationalStiffnessPerLengthUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index f5b2911984..39f9dc61f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SolidAngleUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 1b8bfa30e4..67664903ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SpecificEnergyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 9bb56976fc..7e46ea987f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SpecificEntropyUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 515e44ad2e..d349ad6dd4 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SpecificVolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 8c5f837d8c..5861072703 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SpecificWeightUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 1e0b626c3b..e78bec0850 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static SpeedUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index c723d62da2..88b6e2fdd2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -159,22 +159,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static TemperatureUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index ffbe4cf16a..097b196638 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static TemperatureChangeRateUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index e5bdee0b8d..d0ba85a536 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static TemperatureDeltaUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 79852a7b14..d92ac63a00 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ThermalConductivityUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 5852961f37..cbd790f6d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static ThermalResistanceUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 997983261d..ac4440d46c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static TorqueUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 940e7bf0b6..f0d88a1f5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static VitaminAUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 81e0f4c884..d1b6fe24ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static VolumeUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 144be8f24b..72394a97d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -198,22 +198,6 @@ public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static VolumeFlowUnit ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. /// diff --git a/UnitsNet/Length2d.cs b/UnitsNet/Length2d.cs index e3e19d7c04..0eed30364d 100644 --- a/UnitsNet/Length2d.cs +++ b/UnitsNet/Length2d.cs @@ -197,7 +197,7 @@ public static Length2d FromMillimeters(double xMillimeters, double yMillimeters) public override string ToString() { return - $"({X.Meters:0.##}, {Y.Meters:0.##}) {UnitSystem.GetCached().GetDefaultAbbreviation(LengthUnit.Meter)}"; + $"({X.Meters:0.##}, {Y.Meters:0.##}) {UnitSystem.Default.GetDefaultAbbreviation(LengthUnit.Meter)}"; } public Length DistanceTo(Length2d other) @@ -257,4 +257,4 @@ public int GetHashCode(Length2d obj) #endregion } #endif -} \ No newline at end of file +} diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 index 7f15f8d5e7..020ede7da5 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeCommon.ps1 @@ -137,21 +137,11 @@ if ($obsoleteAttribute) @" } - /// - /// Creates the quantity with the given value in the base unit $baseUnitSingularName. - /// - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public $quantityName(double $baseUnitPluralNameLower) - { - _value = $convertToBaseType($baseUnitPluralNameLower); - _unit = BaseUnit; - } - /// /// Creates the quantity with the given numeric value and unit. /// /// Numeric value. - /// Unit representation. + /// The unit representation to contruct this quantity with. /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component. #if WINDOWS_UWP private @@ -164,33 +154,6 @@ if ($obsoleteAttribute) _unit = unit; } - // 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 - /// - /// Creates the quantity with the given value assuming the base unit $baseUnitSingularName. - /// - /// Value assuming base unit $baseUnitSingularName. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - $quantityName(long $baseUnitPluralNameLower) : this($convertToBaseType($baseUnitPluralNameLower), BaseUnit) { } - - // 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 - // Windows Runtime Component does not support decimal type - /// - /// Creates the quantity with the given value assuming the base unit $baseUnitSingularName. - /// - /// Value assuming base unit $baseUnitSingularName. -#if WINDOWS_UWP - private -#else - [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")] - public -#endif - $quantityName(decimal $baseUnitPluralNameLower) : this($convertToBaseType($baseUnitPluralNameLower), BaseUnit) { } - #region Properties /// @@ -199,7 +162,7 @@ if ($obsoleteAttribute) public static QuantityType QuantityType => QuantityType.$quantityName; /// - /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value. + /// The base unit of $quantityName, which is $baseUnitSingularName. All conversions go via this value. /// public static $unitEnumName BaseUnit => $unitEnumName.$baseUnitSingularName; @@ -498,12 +461,6 @@ if ($obsoleteAttribute) #endregion - /// - /// Set the default unit used by ToString(). Default is $baseUnitSingularName - /// - [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")] - public static $unitEnumName ToStringDefaultUnit { get; set; } = $unitEnumName.$baseUnitSingularName; - /// /// Get default string representation of value and unit. /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 index 128543bb3f..b5caab6a7f 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCodeNetFramework.ps1 @@ -246,22 +246,6 @@ namespace UnitsNet } } - /// - /// Parse a unit string. - /// - /// String to parse. Typically in the form: {number} {unit} - /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture. - /// - /// Length.ParseUnit("m", new CultureInfo("en-US")); - /// - /// The value of 'str' cannot be null. - /// Error parsing string. - [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from .NET Framework targets.")] - public static $unitEnumName ParseUnit(string str, [CanBeNull] string cultureName) - { - return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName)); - } - /// /// Parse a unit string. ///