From dba20cb9ff1e0e97f42308ea979d5014af6707b4 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 22:50:15 +0100 Subject: [PATCH 1/7] Obsolete GlobalConfiguration --- UnitsNet/CustomCode/GlobalConfiguration.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UnitsNet/CustomCode/GlobalConfiguration.cs b/UnitsNet/CustomCode/GlobalConfiguration.cs index b4f0f2c1df..b90aa418d9 100644 --- a/UnitsNet/CustomCode/GlobalConfiguration.cs +++ b/UnitsNet/CustomCode/GlobalConfiguration.cs @@ -7,12 +7,18 @@ // ReSharper disable once CheckNamespace namespace UnitsNet { + /// + /// Global configuration for culture, used as default culture in methods like and + /// . + /// + [Obsolete("The only property DefaultCulture is now deprecated. Manipulate CultureInfo.CurrentUICulture instead.")] public sealed class GlobalConfiguration { /// /// Defaults to when creating an instance with no culture provided. /// Can be overridden, but note that this is static and will affect all subsequent usages. /// + [Obsolete("Manipulate CultureInfo.CurrentUICulture instead, this property will be removed.")] public static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; } } From 7711455d4f02c30d39ca86f050721085ecba18d1 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 22:51:08 +0100 Subject: [PATCH 2/7] Update ps1 files --- .../Include-GenerateQuantitySourceCode.ps1 | 18 +++++++++--------- ...nclude-GenerateStaticQuantitySourceCode.ps1 | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 418b798b30..ad06e63fc9 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -132,7 +132,7 @@ if ($obsoleteAttribute) /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -143,7 +143,7 @@ if ($obsoleteAttribute) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -157,13 +157,13 @@ if ($obsoleteAttribute) /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); @@ -423,7 +423,7 @@ function GenerateStaticMethods([GeneratorArgs]$genArgs) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation($unitEnumName unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -538,7 +538,7 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static $quantityName Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse<$quantityName, $unitEnumName>( @@ -569,7 +569,7 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out $quantityName result) { return QuantityParser.Default.TryParse<$quantityName, $unitEnumName>( @@ -602,7 +602,7 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static $unitEnumName ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse<$unitEnumName>(str, provider); @@ -622,7 +622,7 @@ function GenerateStaticParseMethods([GeneratorArgs]$genArgs) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out $unitEnumName unit) { return UnitParser.Default.TryParse<$unitEnumName>(str, provider, out unit); diff --git a/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 index 903cca391e..4d4428c723 100644 --- a/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 @@ -82,7 +82,7 @@ namespace UnitsNet /// /// Dynamically parse a quantity string representation. /// - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Type of quantity, such as . /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. @@ -104,7 +104,7 @@ namespace UnitsNet /// /// Try to dynamically parse a quantity string representation. /// - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Type of quantity, such as . /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. From 63c9d2f57181efa641d7609922dc2e68baacab92 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 22:54:46 +0100 Subject: [PATCH 3/7] Regen code --- .../Quantities/Acceleration.NetFramework.g.cs | 18 +++++++++--------- .../AmountOfSubstance.NetFramework.g.cs | 18 +++++++++--------- .../AmplitudeRatio.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Angle.NetFramework.g.cs | 18 +++++++++--------- .../ApparentEnergy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/ApparentPower.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Area.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/AreaDensity.NetFramework.g.cs | 18 +++++++++--------- .../AreaMomentOfInertia.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/BitRate.NetFramework.g.cs | 18 +++++++++--------- ...keSpecificFuelConsumption.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Capacitance.NetFramework.g.cs | 18 +++++++++--------- ...ficientOfThermalExpansion.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Density.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Duration.NetFramework.g.cs | 18 +++++++++--------- .../DynamicViscosity.NetFramework.g.cs | 18 +++++++++--------- .../ElectricAdmittance.NetFramework.g.cs | 18 +++++++++--------- .../ElectricCharge.NetFramework.g.cs | 18 +++++++++--------- .../ElectricChargeDensity.NetFramework.g.cs | 18 +++++++++--------- .../ElectricConductance.NetFramework.g.cs | 18 +++++++++--------- .../ElectricConductivity.NetFramework.g.cs | 18 +++++++++--------- .../ElectricCurrent.NetFramework.g.cs | 18 +++++++++--------- .../ElectricCurrentDensity.NetFramework.g.cs | 18 +++++++++--------- .../ElectricCurrentGradient.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/ElectricField.NetFramework.g.cs | 18 +++++++++--------- .../ElectricInductance.NetFramework.g.cs | 18 +++++++++--------- .../ElectricPotential.NetFramework.g.cs | 18 +++++++++--------- .../ElectricPotentialAc.NetFramework.g.cs | 18 +++++++++--------- .../ElectricPotentialDc.NetFramework.g.cs | 18 +++++++++--------- .../ElectricResistance.NetFramework.g.cs | 18 +++++++++--------- .../ElectricResistivity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Energy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Entropy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Force.NetFramework.g.cs | 18 +++++++++--------- .../ForceChangeRate.NetFramework.g.cs | 18 +++++++++--------- .../ForcePerLength.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Frequency.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/HeatFlux.NetFramework.g.cs | 18 +++++++++--------- .../HeatTransferCoefficient.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Illuminance.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Information.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Irradiance.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Irradiation.NetFramework.g.cs | 18 +++++++++--------- .../KinematicViscosity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/LapseRate.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Length.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Level.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/LinearDensity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/LuminousFlux.NetFramework.g.cs | 18 +++++++++--------- .../LuminousIntensity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MagneticField.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MagneticFlux.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Magnetization.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Mass.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MassFlow.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MassFlux.NetFramework.g.cs | 18 +++++++++--------- .../MassMomentOfInertia.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MolarEnergy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MolarEntropy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/MolarMass.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Molarity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Permeability.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Permittivity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Power.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/PowerDensity.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/PowerRatio.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Pressure.NetFramework.g.cs | 18 +++++++++--------- .../PressureChangeRate.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Ratio.NetFramework.g.cs | 18 +++++++++--------- .../ReactiveEnergy.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/ReactivePower.NetFramework.g.cs | 18 +++++++++--------- .../RotationalAcceleration.NetFramework.g.cs | 18 +++++++++--------- .../RotationalSpeed.NetFramework.g.cs | 18 +++++++++--------- .../RotationalStiffness.NetFramework.g.cs | 18 +++++++++--------- ...ationalStiffnessPerLength.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/SolidAngle.NetFramework.g.cs | 18 +++++++++--------- .../SpecificEnergy.NetFramework.g.cs | 18 +++++++++--------- .../SpecificEntropy.NetFramework.g.cs | 18 +++++++++--------- .../SpecificVolume.NetFramework.g.cs | 18 +++++++++--------- .../SpecificWeight.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Speed.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Temperature.NetFramework.g.cs | 18 +++++++++--------- .../TemperatureChangeRate.NetFramework.g.cs | 18 +++++++++--------- .../TemperatureDelta.NetFramework.g.cs | 18 +++++++++--------- .../ThermalConductivity.NetFramework.g.cs | 18 +++++++++--------- .../ThermalResistance.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Torque.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/VitaminA.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/Volume.NetFramework.g.cs | 18 +++++++++--------- .../Quantities/VolumeFlow.NetFramework.g.cs | 18 +++++++++--------- UnitsNet/GeneratedCode/Quantity.g.cs | 4 ++-- 91 files changed, 812 insertions(+), 812 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 358f5700a0..52123da452 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -224,7 +224,7 @@ public static string GetAbbreviation(AccelerationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AccelerationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -416,7 +416,7 @@ public static Acceleration Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Acceleration Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -447,7 +447,7 @@ public static bool TryParse([CanBeNull] string str, out Acceleration result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Acceleration result) { return QuantityParser.Default.TryParse( @@ -480,7 +480,7 @@ public static AccelerationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AccelerationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -500,7 +500,7 @@ public static bool TryParseUnit(string str, out AccelerationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AccelerationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -771,7 +771,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -782,7 +782,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -796,13 +796,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 45770bb724..d381231eff 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -234,7 +234,7 @@ public static string GetAbbreviation(AmountOfSubstanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AmountOfSubstanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -444,7 +444,7 @@ public static AmountOfSubstance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AmountOfSubstance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -475,7 +475,7 @@ public static bool TryParse([CanBeNull] string str, out AmountOfSubstance result /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out AmountOfSubstance result) { return QuantityParser.Default.TryParse( @@ -508,7 +508,7 @@ public static AmountOfSubstanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AmountOfSubstanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -528,7 +528,7 @@ public static bool TryParseUnit(string str, out AmountOfSubstanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AmountOfSubstanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -803,7 +803,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -814,7 +814,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -828,13 +828,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 3ef4d59330..b0b7242443 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -179,7 +179,7 @@ public static string GetAbbreviation(AmplitudeRatioUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AmplitudeRatioUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -290,7 +290,7 @@ public static AmplitudeRatio Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AmplitudeRatio Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -321,7 +321,7 @@ public static bool TryParse([CanBeNull] string str, out AmplitudeRatio result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out AmplitudeRatio result) { return QuantityParser.Default.TryParse( @@ -354,7 +354,7 @@ public static AmplitudeRatioUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AmplitudeRatioUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -374,7 +374,7 @@ public static bool TryParseUnit(string str, out AmplitudeRatioUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AmplitudeRatioUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -635,7 +635,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -646,7 +646,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -660,13 +660,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index e1d8582617..b50ab74c31 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -229,7 +229,7 @@ public static string GetAbbreviation(AngleUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AngleUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -430,7 +430,7 @@ public static Angle Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Angle Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -461,7 +461,7 @@ public static bool TryParse([CanBeNull] string str, out Angle result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Angle result) { return QuantityParser.Default.TryParse( @@ -494,7 +494,7 @@ public static AngleUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AngleUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -514,7 +514,7 @@ public static bool TryParseUnit(string str, out AngleUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AngleUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -787,7 +787,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -798,7 +798,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -812,13 +812,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 501c3981e6..80df3afd7d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(ApparentEnergyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ApparentEnergyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static ApparentEnergy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ApparentEnergy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out ApparentEnergy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ApparentEnergy result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static ApparentEnergyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ApparentEnergyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out ApparentEnergyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ApparentEnergyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 5ab63ac5f8..84bbb609d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -179,7 +179,7 @@ public static string GetAbbreviation(ApparentPowerUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ApparentPowerUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -290,7 +290,7 @@ public static ApparentPower Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ApparentPower Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -321,7 +321,7 @@ public static bool TryParse([CanBeNull] string str, out ApparentPower result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ApparentPower result) { return QuantityParser.Default.TryParse( @@ -354,7 +354,7 @@ public static ApparentPowerUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ApparentPowerUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -374,7 +374,7 @@ public static bool TryParseUnit(string str, out ApparentPowerUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ApparentPowerUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -627,7 +627,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -638,7 +638,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -652,13 +652,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index f7ce9926bc..892a4d5707 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -224,7 +224,7 @@ public static string GetAbbreviation(AreaUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AreaUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -416,7 +416,7 @@ public static Area Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Area Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -447,7 +447,7 @@ public static bool TryParse([CanBeNull] string str, out Area result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Area result) { return QuantityParser.Default.TryParse( @@ -480,7 +480,7 @@ public static AreaUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AreaUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -500,7 +500,7 @@ public static bool TryParseUnit(string str, out AreaUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AreaUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -771,7 +771,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -782,7 +782,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -796,13 +796,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 328b5bfca4..c5450df2c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -164,7 +164,7 @@ public static string GetAbbreviation(AreaDensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AreaDensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -248,7 +248,7 @@ public static AreaDensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AreaDensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -279,7 +279,7 @@ public static bool TryParse([CanBeNull] string str, out AreaDensity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out AreaDensity result) { return QuantityParser.Default.TryParse( @@ -312,7 +312,7 @@ public static AreaDensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AreaDensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -332,7 +332,7 @@ public static bool TryParseUnit(string str, out AreaDensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AreaDensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -579,7 +579,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -590,7 +590,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -604,13 +604,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 00decca729..6970124a65 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -189,7 +189,7 @@ public static string GetAbbreviation(AreaMomentOfInertiaUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(AreaMomentOfInertiaUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -318,7 +318,7 @@ public static AreaMomentOfInertia Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AreaMomentOfInertia Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -349,7 +349,7 @@ public static bool TryParse([CanBeNull] string str, out AreaMomentOfInertia resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out AreaMomentOfInertia result) { return QuantityParser.Default.TryParse( @@ -382,7 +382,7 @@ public static AreaMomentOfInertiaUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static AreaMomentOfInertiaUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -402,7 +402,7 @@ public static bool TryParseUnit(string str, out AreaMomentOfInertiaUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out AreaMomentOfInertiaUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -659,7 +659,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -670,7 +670,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -684,13 +684,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 98bae3e897..dc3a5e873b 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -294,7 +294,7 @@ public static string GetAbbreviation(BitRateUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(BitRateUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -603,7 +603,7 @@ public static BitRate Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static BitRate Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -634,7 +634,7 @@ public static bool TryParse([CanBeNull] string str, out BitRate result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out BitRate result) { return QuantityParser.Default.TryParse( @@ -667,7 +667,7 @@ public static BitRateUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static BitRateUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -687,7 +687,7 @@ public static bool TryParseUnit(string str, out BitRateUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out BitRateUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -984,7 +984,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -995,7 +995,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1009,13 +1009,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index fd44b8d4b6..8935b831c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(BrakeSpecificFuelConsumptionUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static BrakeSpecificFuelConsumption Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static BrakeSpecificFuelConsumption Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out BrakeSpecificFuelConsump /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out BrakeSpecificFuelConsumption result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static BrakeSpecificFuelConsumptionUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out BrakeSpecificFuelConsumptionUnit /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out BrakeSpecificFuelConsumptionUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 68ee6ed1fd..68096b027d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -197,7 +197,7 @@ public static string GetAbbreviation(CapacitanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(CapacitanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -335,7 +335,7 @@ public static Capacitance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Capacitance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -366,7 +366,7 @@ public static bool TryParse([CanBeNull] string str, out Capacitance result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Capacitance result) { return QuantityParser.Default.TryParse( @@ -399,7 +399,7 @@ public static CapacitanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static CapacitanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -419,7 +419,7 @@ public static bool TryParseUnit(string str, out CapacitanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out CapacitanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -678,7 +678,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -689,7 +689,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -703,13 +703,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 7c809586e0..94a97aa3b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(CoefficientOfThermalExpansionUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static CoefficientOfThermalExpansion Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static CoefficientOfThermalExpansion Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out CoefficientOfThermalExpa /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out CoefficientOfThermalExpansion result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static CoefficientOfThermalExpansionUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static CoefficientOfThermalExpansionUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out CoefficientOfThermalExpansionUni /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out CoefficientOfThermalExpansionUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index fc21960355..3914913800 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -357,7 +357,7 @@ public static string GetAbbreviation(DensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(DensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -783,7 +783,7 @@ public static Density Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Density Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -814,7 +814,7 @@ public static bool TryParse([CanBeNull] string str, out Density result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Density result) { return QuantityParser.Default.TryParse( @@ -847,7 +847,7 @@ public static DensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static DensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -867,7 +867,7 @@ public static bool TryParseUnit(string str, out DensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out DensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1190,7 +1190,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1201,7 +1201,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1215,13 +1215,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index eb3da47f88..c62b9b6940 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -209,7 +209,7 @@ public static string GetAbbreviation(DurationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(DurationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -374,7 +374,7 @@ public static Duration Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Duration Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -405,7 +405,7 @@ public static bool TryParse([CanBeNull] string str, out Duration result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Duration result) { return QuantityParser.Default.TryParse( @@ -438,7 +438,7 @@ public static DurationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static DurationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -458,7 +458,7 @@ public static bool TryParseUnit(string str, out DurationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out DurationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -723,7 +723,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -734,7 +734,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -748,13 +748,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index c2bcc3d136..8eb45113c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -192,7 +192,7 @@ public static string GetAbbreviation(DynamicViscosityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(DynamicViscosityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -321,7 +321,7 @@ public static DynamicViscosity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static DynamicViscosity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -352,7 +352,7 @@ public static bool TryParse([CanBeNull] string str, out DynamicViscosity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out DynamicViscosity result) { return QuantityParser.Default.TryParse( @@ -385,7 +385,7 @@ public static DynamicViscosityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static DynamicViscosityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -405,7 +405,7 @@ public static bool TryParseUnit(string str, out DynamicViscosityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out DynamicViscosityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -662,7 +662,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -673,7 +673,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -687,13 +687,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index e1713af937..2559654c3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -179,7 +179,7 @@ public static string GetAbbreviation(ElectricAdmittanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricAdmittanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -290,7 +290,7 @@ public static ElectricAdmittance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricAdmittance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -321,7 +321,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricAdmittance resul /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricAdmittance result) { return QuantityParser.Default.TryParse( @@ -354,7 +354,7 @@ public static ElectricAdmittanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricAdmittanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -374,7 +374,7 @@ public static bool TryParseUnit(string str, out ElectricAdmittanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricAdmittanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -627,7 +627,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -638,7 +638,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -652,13 +652,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 778a74ad80..7b5a5e9485 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(ElectricChargeUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricChargeUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static ElectricCharge Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCharge Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricCharge result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricCharge result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static ElectricChargeUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricChargeUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out ElectricChargeUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricChargeUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 8333253303..6e398eaad0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(ElectricChargeDensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricChargeDensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static ElectricChargeDensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricChargeDensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricChargeDensity re /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricChargeDensity result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static ElectricChargeDensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricChargeDensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out ElectricChargeDensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricChargeDensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 85e771c45f..aae6f9b6ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -177,7 +177,7 @@ public static string GetAbbreviation(ElectricConductanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricConductanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -279,7 +279,7 @@ public static ElectricConductance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricConductance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -310,7 +310,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricConductance resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricConductance result) { return QuantityParser.Default.TryParse( @@ -343,7 +343,7 @@ public static ElectricConductanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricConductanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -363,7 +363,7 @@ public static bool TryParseUnit(string str, out ElectricConductanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricConductanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -614,7 +614,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -625,7 +625,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -639,13 +639,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index a38424501d..36e6b7d33d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(ElectricConductivityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricConductivityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static ElectricConductivity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricConductivity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricConductivity res /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricConductivity result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static ElectricConductivityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricConductivityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out ElectricConductivityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricConductivityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 74b5fca89e..9e3f91a85e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -199,7 +199,7 @@ public static string GetAbbreviation(ElectricCurrentUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricCurrentUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -346,7 +346,7 @@ public static ElectricCurrent Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrent Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -377,7 +377,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricCurrent result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricCurrent result) { return QuantityParser.Default.TryParse( @@ -410,7 +410,7 @@ public static ElectricCurrentUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrentUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -430,7 +430,7 @@ public static bool TryParseUnit(string str, out ElectricCurrentUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricCurrentUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -691,7 +691,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -702,7 +702,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -716,13 +716,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index fd1546d955..4020d97947 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(ElectricCurrentDensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricCurrentDensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static ElectricCurrentDensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrentDensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricCurrentDensity r /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricCurrentDensity result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static ElectricCurrentDensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrentDensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out ElectricCurrentDensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricCurrentDensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 3e55087374..e57afbdbd4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -164,7 +164,7 @@ public static string GetAbbreviation(ElectricCurrentGradientUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricCurrentGradientUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -248,7 +248,7 @@ public static ElectricCurrentGradient Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrentGradient Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -279,7 +279,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricCurrentGradient /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricCurrentGradient result) { return QuantityParser.Default.TryParse( @@ -312,7 +312,7 @@ public static ElectricCurrentGradientUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricCurrentGradientUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -332,7 +332,7 @@ public static bool TryParseUnit(string str, out ElectricCurrentGradientUnit unit /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricCurrentGradientUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -579,7 +579,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -590,7 +590,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -604,13 +604,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 8a8b59f436..3a14c90206 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(ElectricFieldUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricFieldUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static ElectricField Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricField Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricField result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricField result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static ElectricFieldUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricFieldUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out ElectricFieldUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricFieldUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 8d1eaa6b39..e07beeaffe 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -182,7 +182,7 @@ public static string GetAbbreviation(ElectricInductanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricInductanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -293,7 +293,7 @@ public static ElectricInductance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricInductance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -324,7 +324,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricInductance resul /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricInductance result) { return QuantityParser.Default.TryParse( @@ -357,7 +357,7 @@ public static ElectricInductanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricInductanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -377,7 +377,7 @@ public static bool TryParseUnit(string str, out ElectricInductanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricInductanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -630,7 +630,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -641,7 +641,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -655,13 +655,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index f797aac25b..29e510bf01 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -184,7 +184,7 @@ public static string GetAbbreviation(ElectricPotentialUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricPotentialUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -304,7 +304,7 @@ public static ElectricPotential Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotential Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -335,7 +335,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricPotential result /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricPotential result) { return QuantityParser.Default.TryParse( @@ -368,7 +368,7 @@ public static ElectricPotentialUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotentialUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -388,7 +388,7 @@ public static bool TryParseUnit(string str, out ElectricPotentialUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricPotentialUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -643,7 +643,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -654,7 +654,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -668,13 +668,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 2e79686f89..7aaf128112 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -184,7 +184,7 @@ public static string GetAbbreviation(ElectricPotentialAcUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricPotentialAcUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -304,7 +304,7 @@ public static ElectricPotentialAc Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotentialAc Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -335,7 +335,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricPotentialAc resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricPotentialAc result) { return QuantityParser.Default.TryParse( @@ -368,7 +368,7 @@ public static ElectricPotentialAcUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotentialAcUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -388,7 +388,7 @@ public static bool TryParseUnit(string str, out ElectricPotentialAcUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricPotentialAcUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -643,7 +643,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -654,7 +654,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -668,13 +668,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 5765f4e2d2..51a61e1bd3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -184,7 +184,7 @@ public static string GetAbbreviation(ElectricPotentialDcUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricPotentialDcUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -304,7 +304,7 @@ public static ElectricPotentialDc Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotentialDc Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -335,7 +335,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricPotentialDc resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricPotentialDc result) { return QuantityParser.Default.TryParse( @@ -368,7 +368,7 @@ public static ElectricPotentialDcUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricPotentialDcUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -388,7 +388,7 @@ public static bool TryParseUnit(string str, out ElectricPotentialDcUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricPotentialDcUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -643,7 +643,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -654,7 +654,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -668,13 +668,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index d87ef748ed..68958ca8a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -184,7 +184,7 @@ public static string GetAbbreviation(ElectricResistanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricResistanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -304,7 +304,7 @@ public static ElectricResistance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricResistance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -335,7 +335,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricResistance resul /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricResistance result) { return QuantityParser.Default.TryParse( @@ -368,7 +368,7 @@ public static ElectricResistanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricResistanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -388,7 +388,7 @@ public static bool TryParseUnit(string str, out ElectricResistanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricResistanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -643,7 +643,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -654,7 +654,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -668,13 +668,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 820cdaa8fa..5da120cc13 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -232,7 +232,7 @@ public static string GetAbbreviation(ElectricResistivityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ElectricResistivityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -433,7 +433,7 @@ public static ElectricResistivity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricResistivity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -464,7 +464,7 @@ public static bool TryParse([CanBeNull] string str, out ElectricResistivity resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ElectricResistivity result) { return QuantityParser.Default.TryParse( @@ -497,7 +497,7 @@ public static ElectricResistivityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ElectricResistivityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -517,7 +517,7 @@ public static bool TryParseUnit(string str, out ElectricResistivityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ElectricResistivityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -790,7 +790,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -801,7 +801,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -815,13 +815,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index cebe402b97..bd6317a1ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -274,7 +274,7 @@ public static string GetAbbreviation(EnergyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(EnergyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -556,7 +556,7 @@ public static Energy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Energy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -587,7 +587,7 @@ public static bool TryParse([CanBeNull] string str, out Energy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Energy result) { return QuantityParser.Default.TryParse( @@ -620,7 +620,7 @@ public static EnergyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static EnergyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -640,7 +640,7 @@ public static bool TryParseUnit(string str, out EnergyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out EnergyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -931,7 +931,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -942,7 +942,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -956,13 +956,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 19f14316dd..49c3f3f2c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -194,7 +194,7 @@ public static string GetAbbreviation(EntropyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(EntropyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -332,7 +332,7 @@ public static Entropy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Entropy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -363,7 +363,7 @@ public static bool TryParse([CanBeNull] string str, out Entropy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Entropy result) { return QuantityParser.Default.TryParse( @@ -396,7 +396,7 @@ public static EntropyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static EntropyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -416,7 +416,7 @@ public static bool TryParseUnit(string str, out EntropyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out EntropyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -675,7 +675,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -686,7 +686,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -700,13 +700,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index adfe006436..be20d60df0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -224,7 +224,7 @@ public static string GetAbbreviation(ForceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ForceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -416,7 +416,7 @@ public static Force Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Force Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -447,7 +447,7 @@ public static bool TryParse([CanBeNull] string str, out Force result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Force result) { return QuantityParser.Default.TryParse( @@ -480,7 +480,7 @@ public static ForceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ForceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -500,7 +500,7 @@ public static bool TryParseUnit(string str, out ForceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ForceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -771,7 +771,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -782,7 +782,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -796,13 +796,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 0649a86a9a..642e7b9e89 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -214,7 +214,7 @@ public static string GetAbbreviation(ForceChangeRateUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ForceChangeRateUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -388,7 +388,7 @@ public static ForceChangeRate Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ForceChangeRate Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -419,7 +419,7 @@ public static bool TryParse([CanBeNull] string str, out ForceChangeRate result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ForceChangeRate result) { return QuantityParser.Default.TryParse( @@ -452,7 +452,7 @@ public static ForceChangeRateUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ForceChangeRateUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -472,7 +472,7 @@ public static bool TryParseUnit(string str, out ForceChangeRateUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ForceChangeRateUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -739,7 +739,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -750,7 +750,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -764,13 +764,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 2378516a7d..b52521e7de 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -204,7 +204,7 @@ public static string GetAbbreviation(ForcePerLengthUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ForcePerLengthUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -360,7 +360,7 @@ public static ForcePerLength Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ForcePerLength Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -391,7 +391,7 @@ public static bool TryParse([CanBeNull] string str, out ForcePerLength result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ForcePerLength result) { return QuantityParser.Default.TryParse( @@ -424,7 +424,7 @@ public static ForcePerLengthUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ForcePerLengthUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -444,7 +444,7 @@ public static bool TryParseUnit(string str, out ForcePerLengthUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ForcePerLengthUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -707,7 +707,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -718,7 +718,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -732,13 +732,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 59f93c0ce3..ce4c0f476c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -204,7 +204,7 @@ public static string GetAbbreviation(FrequencyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(FrequencyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -360,7 +360,7 @@ public static Frequency Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Frequency Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -391,7 +391,7 @@ public static bool TryParse([CanBeNull] string str, out Frequency result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Frequency result) { return QuantityParser.Default.TryParse( @@ -424,7 +424,7 @@ public static FrequencyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static FrequencyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -444,7 +444,7 @@ public static bool TryParseUnit(string str, out FrequencyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out FrequencyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -707,7 +707,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -718,7 +718,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -732,13 +732,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 25a9d70073..6953823251 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -249,7 +249,7 @@ public static string GetAbbreviation(HeatFluxUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(HeatFluxUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -486,7 +486,7 @@ public static HeatFlux Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static HeatFlux Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -517,7 +517,7 @@ public static bool TryParse([CanBeNull] string str, out HeatFlux result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out HeatFlux result) { return QuantityParser.Default.TryParse( @@ -550,7 +550,7 @@ public static HeatFluxUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static HeatFluxUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -570,7 +570,7 @@ public static bool TryParseUnit(string str, out HeatFluxUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out HeatFluxUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -851,7 +851,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -862,7 +862,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -876,13 +876,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 7b727f6211..fba4eb361a 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -169,7 +169,7 @@ public static string GetAbbreviation(HeatTransferCoefficientUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(HeatTransferCoefficientUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -262,7 +262,7 @@ public static HeatTransferCoefficient Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static HeatTransferCoefficient Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -293,7 +293,7 @@ public static bool TryParse([CanBeNull] string str, out HeatTransferCoefficient /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out HeatTransferCoefficient result) { return QuantityParser.Default.TryParse( @@ -326,7 +326,7 @@ public static HeatTransferCoefficientUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static HeatTransferCoefficientUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -346,7 +346,7 @@ public static bool TryParseUnit(string str, out HeatTransferCoefficientUnit unit /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out HeatTransferCoefficientUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -595,7 +595,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -606,7 +606,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -620,13 +620,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 15b4064264..9c224fe708 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -182,7 +182,7 @@ public static string GetAbbreviation(IlluminanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(IlluminanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -293,7 +293,7 @@ public static Illuminance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Illuminance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -324,7 +324,7 @@ public static bool TryParse([CanBeNull] string str, out Illuminance result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Illuminance result) { return QuantityParser.Default.TryParse( @@ -357,7 +357,7 @@ public static IlluminanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static IlluminanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -377,7 +377,7 @@ public static bool TryParseUnit(string str, out IlluminanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out IlluminanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -630,7 +630,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -641,7 +641,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -655,13 +655,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 72b58736f0..a15a47773a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -291,7 +291,7 @@ public static string GetAbbreviation(InformationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(InformationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -600,7 +600,7 @@ public static Information Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Information Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -631,7 +631,7 @@ public static bool TryParse([CanBeNull] string str, out Information result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Information result) { return QuantityParser.Default.TryParse( @@ -664,7 +664,7 @@ public static InformationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static InformationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -684,7 +684,7 @@ public static bool TryParseUnit(string str, out InformationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out InformationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -981,7 +981,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -992,7 +992,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1006,13 +1006,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 82e3b46e7d..f45134a871 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -229,7 +229,7 @@ public static string GetAbbreviation(IrradianceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(IrradianceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -430,7 +430,7 @@ public static Irradiance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Irradiance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -461,7 +461,7 @@ public static bool TryParse([CanBeNull] string str, out Irradiance result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Irradiance result) { return QuantityParser.Default.TryParse( @@ -494,7 +494,7 @@ public static IrradianceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static IrradianceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -514,7 +514,7 @@ public static bool TryParseUnit(string str, out IrradianceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out IrradianceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -787,7 +787,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -798,7 +798,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -812,13 +812,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index c00d58455a..e1bb7810fd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -192,7 +192,7 @@ public static string GetAbbreviation(IrradiationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(IrradiationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -321,7 +321,7 @@ public static Irradiation Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Irradiation Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -352,7 +352,7 @@ public static bool TryParse([CanBeNull] string str, out Irradiation result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Irradiation result) { return QuantityParser.Default.TryParse( @@ -385,7 +385,7 @@ public static IrradiationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static IrradiationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -405,7 +405,7 @@ public static bool TryParseUnit(string str, out IrradiationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out IrradiationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -662,7 +662,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -673,7 +673,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -687,13 +687,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index e91ece06ff..18a823b02f 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -202,7 +202,7 @@ public static string GetAbbreviation(KinematicViscosityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(KinematicViscosityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -349,7 +349,7 @@ public static KinematicViscosity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static KinematicViscosity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -380,7 +380,7 @@ public static bool TryParse([CanBeNull] string str, out KinematicViscosity resul /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out KinematicViscosity result) { return QuantityParser.Default.TryParse( @@ -413,7 +413,7 @@ public static KinematicViscosityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static KinematicViscosityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -433,7 +433,7 @@ public static bool TryParseUnit(string str, out KinematicViscosityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out KinematicViscosityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -694,7 +694,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -705,7 +705,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -719,13 +719,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 12626a9f99..2a4889edf3 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -164,7 +164,7 @@ public static string GetAbbreviation(LapseRateUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LapseRateUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -248,7 +248,7 @@ public static LapseRate Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LapseRate Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -279,7 +279,7 @@ public static bool TryParse([CanBeNull] string str, out LapseRate result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out LapseRate result) { return QuantityParser.Default.TryParse( @@ -312,7 +312,7 @@ public static LapseRateUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LapseRateUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -332,7 +332,7 @@ public static bool TryParseUnit(string str, out LapseRateUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LapseRateUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -579,7 +579,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -590,7 +590,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -604,13 +604,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 2d42d80c1e..c0ea3b4492 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -269,7 +269,7 @@ public static string GetAbbreviation(LengthUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LengthUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -542,7 +542,7 @@ public static Length Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Length Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -573,7 +573,7 @@ public static bool TryParse([CanBeNull] string str, out Length result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Length result) { return QuantityParser.Default.TryParse( @@ -606,7 +606,7 @@ public static LengthUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LengthUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -626,7 +626,7 @@ public static bool TryParseUnit(string str, out LengthUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LengthUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -915,7 +915,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -926,7 +926,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -940,13 +940,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index b3e927594e..5d5addc98b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -169,7 +169,7 @@ public static string GetAbbreviation(LevelUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LevelUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -262,7 +262,7 @@ public static Level Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Level Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -293,7 +293,7 @@ public static bool TryParse([CanBeNull] string str, out Level result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Level result) { return QuantityParser.Default.TryParse( @@ -326,7 +326,7 @@ public static LevelUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LevelUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -346,7 +346,7 @@ public static bool TryParseUnit(string str, out LevelUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LevelUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -603,7 +603,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -614,7 +614,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -628,13 +628,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 3644425b78..69168e6472 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -177,7 +177,7 @@ public static string GetAbbreviation(LinearDensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LinearDensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -279,7 +279,7 @@ public static LinearDensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LinearDensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -310,7 +310,7 @@ public static bool TryParse([CanBeNull] string str, out LinearDensity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out LinearDensity result) { return QuantityParser.Default.TryParse( @@ -343,7 +343,7 @@ public static LinearDensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LinearDensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -363,7 +363,7 @@ public static bool TryParseUnit(string str, out LinearDensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LinearDensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -614,7 +614,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -625,7 +625,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -639,13 +639,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index b3b9a7b040..80a0ab7d1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(LuminousFluxUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LuminousFluxUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static LuminousFlux Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LuminousFlux Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out LuminousFlux result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out LuminousFlux result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static LuminousFluxUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LuminousFluxUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out LuminousFluxUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LuminousFluxUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index ab74973f2d..3560f3bcf0 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(LuminousIntensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(LuminousIntensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static LuminousIntensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LuminousIntensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out LuminousIntensity result /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out LuminousIntensity result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static LuminousIntensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static LuminousIntensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out LuminousIntensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out LuminousIntensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index a8ce686691..b6d1f9b767 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -182,7 +182,7 @@ public static string GetAbbreviation(MagneticFieldUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MagneticFieldUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -293,7 +293,7 @@ public static MagneticField Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MagneticField Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -324,7 +324,7 @@ public static bool TryParse([CanBeNull] string str, out MagneticField result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MagneticField result) { return QuantityParser.Default.TryParse( @@ -357,7 +357,7 @@ public static MagneticFieldUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MagneticFieldUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -377,7 +377,7 @@ public static bool TryParseUnit(string str, out MagneticFieldUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MagneticFieldUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -630,7 +630,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -641,7 +641,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -655,13 +655,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 54350167fe..3955e2be3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(MagneticFluxUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MagneticFluxUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static MagneticFlux Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MagneticFlux Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out MagneticFlux result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MagneticFlux result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static MagneticFluxUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MagneticFluxUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out MagneticFluxUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MagneticFluxUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index a08ff2da28..c1b4542ef1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(MagnetizationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MagnetizationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static Magnetization Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Magnetization Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out Magnetization result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Magnetization result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static MagnetizationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MagnetizationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out MagnetizationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MagnetizationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index cfc1902123..a18ad69706 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -274,7 +274,7 @@ public static string GetAbbreviation(MassUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MassUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -556,7 +556,7 @@ public static Mass Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Mass Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -587,7 +587,7 @@ public static bool TryParse([CanBeNull] string str, out Mass result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Mass result) { return QuantityParser.Default.TryParse( @@ -620,7 +620,7 @@ public static MassUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -640,7 +640,7 @@ public static bool TryParseUnit(string str, out MassUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MassUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -931,7 +931,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -942,7 +942,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -956,13 +956,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 9342a38750..34f3dceb19 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -314,7 +314,7 @@ public static string GetAbbreviation(MassFlowUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MassFlowUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -668,7 +668,7 @@ public static MassFlow Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassFlow Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -699,7 +699,7 @@ public static bool TryParse([CanBeNull] string str, out MassFlow result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MassFlow result) { return QuantityParser.Default.TryParse( @@ -732,7 +732,7 @@ public static MassFlowUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassFlowUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -752,7 +752,7 @@ public static bool TryParseUnit(string str, out MassFlowUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MassFlowUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1059,7 +1059,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1070,7 +1070,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1084,13 +1084,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index f3ee06ad0f..d8b471ec06 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -169,7 +169,7 @@ public static string GetAbbreviation(MassFluxUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MassFluxUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -262,7 +262,7 @@ public static MassFlux Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassFlux Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -293,7 +293,7 @@ public static bool TryParse([CanBeNull] string str, out MassFlux result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MassFlux result) { return QuantityParser.Default.TryParse( @@ -326,7 +326,7 @@ public static MassFluxUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassFluxUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -346,7 +346,7 @@ public static bool TryParseUnit(string str, out MassFluxUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MassFluxUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -595,7 +595,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -606,7 +606,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -620,13 +620,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index bc552b7b0f..fca8fa6fe3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -299,7 +299,7 @@ public static string GetAbbreviation(MassMomentOfInertiaUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MassMomentOfInertiaUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -626,7 +626,7 @@ public static MassMomentOfInertia Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassMomentOfInertia Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -657,7 +657,7 @@ public static bool TryParse([CanBeNull] string str, out MassMomentOfInertia resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MassMomentOfInertia result) { return QuantityParser.Default.TryParse( @@ -690,7 +690,7 @@ public static MassMomentOfInertiaUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MassMomentOfInertiaUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -710,7 +710,7 @@ public static bool TryParseUnit(string str, out MassMomentOfInertiaUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MassMomentOfInertiaUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1011,7 +1011,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1022,7 +1022,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1036,13 +1036,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 671fa6aea2..f8a48961b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(MolarEnergyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MolarEnergyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static MolarEnergy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarEnergy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out MolarEnergy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MolarEnergy result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static MolarEnergyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarEnergyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out MolarEnergyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MolarEnergyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index fe7c9e4845..fb8d93ccb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(MolarEntropyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MolarEntropyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static MolarEntropy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarEntropy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out MolarEntropy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MolarEntropy result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static MolarEntropyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarEntropyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out MolarEntropyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MolarEntropyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 4d2e3d2db6..0c1f58d800 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -219,7 +219,7 @@ public static string GetAbbreviation(MolarMassUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MolarMassUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -402,7 +402,7 @@ public static MolarMass Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarMass Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -433,7 +433,7 @@ public static bool TryParse([CanBeNull] string str, out MolarMass result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out MolarMass result) { return QuantityParser.Default.TryParse( @@ -466,7 +466,7 @@ public static MolarMassUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarMassUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -486,7 +486,7 @@ public static bool TryParseUnit(string str, out MolarMassUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MolarMassUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -755,7 +755,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -766,7 +766,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -780,13 +780,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 904a14aef2..4f04f12058 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -202,7 +202,7 @@ public static string GetAbbreviation(MolarityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(MolarityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -349,7 +349,7 @@ public static Molarity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Molarity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -380,7 +380,7 @@ public static bool TryParse([CanBeNull] string str, out Molarity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Molarity result) { return QuantityParser.Default.TryParse( @@ -413,7 +413,7 @@ public static MolarityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static MolarityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -433,7 +433,7 @@ public static bool TryParseUnit(string str, out MolarityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out MolarityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -694,7 +694,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -705,7 +705,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -719,13 +719,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 50cb753104..0f193fd20c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(PermeabilityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PermeabilityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static Permeability Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Permeability Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out Permeability result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Permeability result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static PermeabilityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PermeabilityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out PermeabilityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PermeabilityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 53581de96f..a7ece00b94 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(PermittivityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PermittivityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static Permittivity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Permittivity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out Permittivity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Permittivity result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static PermittivityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PermittivityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out PermittivityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PermittivityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 216d430199..10901f816d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -261,7 +261,7 @@ public static string GetAbbreviation(PowerUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PowerUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -516,7 +516,7 @@ public static Power Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Power Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -547,7 +547,7 @@ public static bool TryParse([CanBeNull] string str, out Power result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Power result) { return QuantityParser.Default.TryParse( @@ -580,7 +580,7 @@ public static PowerUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PowerUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -600,7 +600,7 @@ public static bool TryParseUnit(string str, out PowerUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PowerUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -885,7 +885,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -896,7 +896,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -910,13 +910,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index f8d35c8da1..ee290d78ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -379,7 +379,7 @@ public static string GetAbbreviation(PowerDensityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PowerDensityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -850,7 +850,7 @@ public static PowerDensity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PowerDensity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -881,7 +881,7 @@ public static bool TryParse([CanBeNull] string str, out PowerDensity result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out PowerDensity result) { return QuantityParser.Default.TryParse( @@ -914,7 +914,7 @@ public static PowerDensityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PowerDensityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -934,7 +934,7 @@ public static bool TryParseUnit(string str, out PowerDensityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PowerDensityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1267,7 +1267,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1278,7 +1278,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1292,13 +1292,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index ebbaf9fdcc..b07e04b8f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -169,7 +169,7 @@ public static string GetAbbreviation(PowerRatioUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PowerRatioUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -262,7 +262,7 @@ public static PowerRatio Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PowerRatio Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -293,7 +293,7 @@ public static bool TryParse([CanBeNull] string str, out PowerRatio result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out PowerRatio result) { return QuantityParser.Default.TryParse( @@ -326,7 +326,7 @@ public static PowerRatioUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PowerRatioUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -346,7 +346,7 @@ public static bool TryParseUnit(string str, out PowerRatioUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PowerRatioUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -603,7 +603,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -614,7 +614,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -628,13 +628,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index c59f2e54c4..998ddbbde9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -369,7 +369,7 @@ public static string GetAbbreviation(PressureUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PressureUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -822,7 +822,7 @@ public static Pressure Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Pressure Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -853,7 +853,7 @@ public static bool TryParse([CanBeNull] string str, out Pressure result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Pressure result) { return QuantityParser.Default.TryParse( @@ -886,7 +886,7 @@ public static PressureUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PressureUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -906,7 +906,7 @@ public static bool TryParseUnit(string str, out PressureUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PressureUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1235,7 +1235,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1246,7 +1246,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1260,13 +1260,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 2b30666617..1613ff7b40 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -194,7 +194,7 @@ public static string GetAbbreviation(PressureChangeRateUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(PressureChangeRateUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -332,7 +332,7 @@ public static PressureChangeRate Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PressureChangeRate Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -363,7 +363,7 @@ public static bool TryParse([CanBeNull] string str, out PressureChangeRate resul /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out PressureChangeRate result) { return QuantityParser.Default.TryParse( @@ -396,7 +396,7 @@ public static PressureChangeRateUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static PressureChangeRateUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -416,7 +416,7 @@ public static bool TryParseUnit(string str, out PressureChangeRateUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out PressureChangeRateUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -675,7 +675,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -686,7 +686,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -700,13 +700,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 5f3f8b0c5e..2a85d02b7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -189,7 +189,7 @@ public static string GetAbbreviation(RatioUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(RatioUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -318,7 +318,7 @@ public static Ratio Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Ratio Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -349,7 +349,7 @@ public static bool TryParse([CanBeNull] string str, out Ratio result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Ratio result) { return QuantityParser.Default.TryParse( @@ -382,7 +382,7 @@ public static RatioUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RatioUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -402,7 +402,7 @@ public static bool TryParseUnit(string str, out RatioUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out RatioUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -659,7 +659,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -670,7 +670,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -684,13 +684,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index bd5c0b4dfd..13b7d7d8c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(ReactiveEnergyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ReactiveEnergyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static ReactiveEnergy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ReactiveEnergy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out ReactiveEnergy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ReactiveEnergy result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static ReactiveEnergyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ReactiveEnergyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out ReactiveEnergyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ReactiveEnergyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 444011ef14..2403900c32 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -179,7 +179,7 @@ public static string GetAbbreviation(ReactivePowerUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ReactivePowerUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -290,7 +290,7 @@ public static ReactivePower Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ReactivePower Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -321,7 +321,7 @@ public static bool TryParse([CanBeNull] string str, out ReactivePower result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ReactivePower result) { return QuantityParser.Default.TryParse( @@ -354,7 +354,7 @@ public static ReactivePowerUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ReactivePowerUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -374,7 +374,7 @@ public static bool TryParseUnit(string str, out ReactivePowerUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ReactivePowerUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -627,7 +627,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -638,7 +638,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -652,13 +652,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 663eef0e5f..4878af2f3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(RotationalAccelerationUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(RotationalAccelerationUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static RotationalAcceleration Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalAcceleration Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out RotationalAcceleration r /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out RotationalAcceleration result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static RotationalAccelerationUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalAccelerationUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out RotationalAccelerationUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out RotationalAccelerationUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index bf4034008e..61a51a0e04 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -224,7 +224,7 @@ public static string GetAbbreviation(RotationalSpeedUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(RotationalSpeedUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -416,7 +416,7 @@ public static RotationalSpeed Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalSpeed Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -447,7 +447,7 @@ public static bool TryParse([CanBeNull] string str, out RotationalSpeed result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out RotationalSpeed result) { return QuantityParser.Default.TryParse( @@ -480,7 +480,7 @@ public static RotationalSpeedUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalSpeedUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -500,7 +500,7 @@ public static bool TryParseUnit(string str, out RotationalSpeedUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out RotationalSpeedUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -771,7 +771,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -782,7 +782,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -796,13 +796,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 5d4ff0f7fe..880d04659e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(RotationalStiffnessUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(RotationalStiffnessUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static RotationalStiffness Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalStiffness Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out RotationalStiffness resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out RotationalStiffness result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static RotationalStiffnessUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalStiffnessUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out RotationalStiffnessUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out RotationalStiffnessUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index c7da5af1a4..af4c8d6a4f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(RotationalStiffnessPerLengthUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static RotationalStiffnessPerLength Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalStiffnessPerLength Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out RotationalStiffnessPerLe /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out RotationalStiffnessPerLength result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static RotationalStiffnessPerLengthUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static RotationalStiffnessPerLengthUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out RotationalStiffnessPerLengthUnit /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out RotationalStiffnessPerLengthUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 62bc924660..e89b73b896 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -167,7 +167,7 @@ public static string GetAbbreviation(SolidAngleUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SolidAngleUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -251,7 +251,7 @@ public static SolidAngle Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SolidAngle Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -282,7 +282,7 @@ public static bool TryParse([CanBeNull] string str, out SolidAngle result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out SolidAngle result) { return QuantityParser.Default.TryParse( @@ -315,7 +315,7 @@ public static SolidAngleUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SolidAngleUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -335,7 +335,7 @@ public static bool TryParseUnit(string str, out SolidAngleUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SolidAngleUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -582,7 +582,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -593,7 +593,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -607,13 +607,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index ce6a0de249..4ebd4deb80 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -207,7 +207,7 @@ public static string GetAbbreviation(SpecificEnergyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SpecificEnergyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -363,7 +363,7 @@ public static SpecificEnergy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificEnergy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -394,7 +394,7 @@ public static bool TryParse([CanBeNull] string str, out SpecificEnergy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out SpecificEnergy result) { return QuantityParser.Default.TryParse( @@ -427,7 +427,7 @@ public static SpecificEnergyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificEnergyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -447,7 +447,7 @@ public static bool TryParseUnit(string str, out SpecificEnergyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SpecificEnergyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -710,7 +710,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -721,7 +721,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -735,13 +735,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 9aa0400f27..fc8c97fea7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -199,7 +199,7 @@ public static string GetAbbreviation(SpecificEntropyUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SpecificEntropyUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -346,7 +346,7 @@ public static SpecificEntropy Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificEntropy Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -377,7 +377,7 @@ public static bool TryParse([CanBeNull] string str, out SpecificEntropy result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out SpecificEntropy result) { return QuantityParser.Default.TryParse( @@ -410,7 +410,7 @@ public static SpecificEntropyUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificEntropyUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -430,7 +430,7 @@ public static bool TryParseUnit(string str, out SpecificEntropyUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SpecificEntropyUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -691,7 +691,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -702,7 +702,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -716,13 +716,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 745f823097..35f794739e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -174,7 +174,7 @@ public static string GetAbbreviation(SpecificVolumeUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SpecificVolumeUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -276,7 +276,7 @@ public static SpecificVolume Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificVolume Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -307,7 +307,7 @@ public static bool TryParse([CanBeNull] string str, out SpecificVolume result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out SpecificVolume result) { return QuantityParser.Default.TryParse( @@ -340,7 +340,7 @@ public static SpecificVolumeUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificVolumeUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -360,7 +360,7 @@ public static bool TryParseUnit(string str, out SpecificVolumeUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SpecificVolumeUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -611,7 +611,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -622,7 +622,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -636,13 +636,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index b5ec85a991..a2bf70d38e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -247,7 +247,7 @@ public static string GetAbbreviation(SpecificWeightUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SpecificWeightUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -475,7 +475,7 @@ public static SpecificWeight Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificWeight Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -506,7 +506,7 @@ public static bool TryParse([CanBeNull] string str, out SpecificWeight result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out SpecificWeight result) { return QuantityParser.Default.TryParse( @@ -539,7 +539,7 @@ public static SpecificWeightUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpecificWeightUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -559,7 +559,7 @@ public static bool TryParseUnit(string str, out SpecificWeightUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SpecificWeightUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -838,7 +838,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -849,7 +849,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -863,13 +863,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 4e9896dcc3..86a62cd45f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -319,7 +319,7 @@ public static string GetAbbreviation(SpeedUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(SpeedUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -682,7 +682,7 @@ public static Speed Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Speed Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -713,7 +713,7 @@ public static bool TryParse([CanBeNull] string str, out Speed result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Speed result) { return QuantityParser.Default.TryParse( @@ -746,7 +746,7 @@ public static SpeedUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static SpeedUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -766,7 +766,7 @@ public static bool TryParseUnit(string str, out SpeedUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out SpeedUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1075,7 +1075,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1086,7 +1086,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1100,13 +1100,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index fcaadb559e..9a124f3de6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -199,7 +199,7 @@ public static string GetAbbreviation(TemperatureUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(TemperatureUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -346,7 +346,7 @@ public static Temperature Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Temperature Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -377,7 +377,7 @@ public static bool TryParse([CanBeNull] string str, out Temperature result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Temperature result) { return QuantityParser.Default.TryParse( @@ -410,7 +410,7 @@ public static TemperatureUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TemperatureUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -430,7 +430,7 @@ public static bool TryParseUnit(string str, out TemperatureUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out TemperatureUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -652,7 +652,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -663,7 +663,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -677,13 +677,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 0184fdcfcd..0bcb730494 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -209,7 +209,7 @@ public static string GetAbbreviation(TemperatureChangeRateUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(TemperatureChangeRateUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -374,7 +374,7 @@ public static TemperatureChangeRate Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TemperatureChangeRate Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -405,7 +405,7 @@ public static bool TryParse([CanBeNull] string str, out TemperatureChangeRate re /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out TemperatureChangeRate result) { return QuantityParser.Default.TryParse( @@ -438,7 +438,7 @@ public static TemperatureChangeRateUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TemperatureChangeRateUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -458,7 +458,7 @@ public static bool TryParseUnit(string str, out TemperatureChangeRateUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out TemperatureChangeRateUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -723,7 +723,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -734,7 +734,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -748,13 +748,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 6148f658fc..e62ceb9fa0 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -199,7 +199,7 @@ public static string GetAbbreviation(TemperatureDeltaUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(TemperatureDeltaUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -346,7 +346,7 @@ public static TemperatureDelta Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TemperatureDelta Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -377,7 +377,7 @@ public static bool TryParse([CanBeNull] string str, out TemperatureDelta result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out TemperatureDelta result) { return QuantityParser.Default.TryParse( @@ -410,7 +410,7 @@ public static TemperatureDeltaUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TemperatureDeltaUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -430,7 +430,7 @@ public static bool TryParseUnit(string str, out TemperatureDeltaUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out TemperatureDeltaUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -691,7 +691,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -702,7 +702,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -716,13 +716,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index af6f63a047..0ec47ce071 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -172,7 +172,7 @@ public static string GetAbbreviation(ThermalConductivityUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ThermalConductivityUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -265,7 +265,7 @@ public static ThermalConductivity Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ThermalConductivity Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -296,7 +296,7 @@ public static bool TryParse([CanBeNull] string str, out ThermalConductivity resu /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ThermalConductivity result) { return QuantityParser.Default.TryParse( @@ -329,7 +329,7 @@ public static ThermalConductivityUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ThermalConductivityUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -349,7 +349,7 @@ public static bool TryParseUnit(string str, out ThermalConductivityUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ThermalConductivityUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -598,7 +598,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -609,7 +609,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -623,13 +623,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index c9492cc99a..a6921fe83e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -184,7 +184,7 @@ public static string GetAbbreviation(ThermalResistanceUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(ThermalResistanceUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -304,7 +304,7 @@ public static ThermalResistance Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ThermalResistance Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -335,7 +335,7 @@ public static bool TryParse([CanBeNull] string str, out ThermalResistance result /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out ThermalResistance result) { return QuantityParser.Default.TryParse( @@ -368,7 +368,7 @@ public static ThermalResistanceUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static ThermalResistanceUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -388,7 +388,7 @@ public static bool TryParseUnit(string str, out ThermalResistanceUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out ThermalResistanceUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -643,7 +643,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -654,7 +654,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -668,13 +668,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index de3631555d..26ed1683f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -264,7 +264,7 @@ public static string GetAbbreviation(TorqueUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(TorqueUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -528,7 +528,7 @@ public static Torque Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Torque Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -559,7 +559,7 @@ public static bool TryParse([CanBeNull] string str, out Torque result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Torque result) { return QuantityParser.Default.TryParse( @@ -592,7 +592,7 @@ public static TorqueUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static TorqueUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -612,7 +612,7 @@ public static bool TryParseUnit(string str, out TorqueUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out TorqueUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -899,7 +899,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -910,7 +910,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -924,13 +924,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 89d0859c1e..29fb618db6 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -164,7 +164,7 @@ public static string GetAbbreviation(VitaminAUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(VitaminAUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -248,7 +248,7 @@ public static VitaminA Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static VitaminA Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -279,7 +279,7 @@ public static bool TryParse([CanBeNull] string str, out VitaminA result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out VitaminA result) { return QuantityParser.Default.TryParse( @@ -312,7 +312,7 @@ public static VitaminAUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static VitaminAUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -332,7 +332,7 @@ public static bool TryParseUnit(string str, out VitaminAUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out VitaminAUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -579,7 +579,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -590,7 +590,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -604,13 +604,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 60ca210a47..38b5d4ecfb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -384,7 +384,7 @@ public static string GetAbbreviation(VolumeUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(VolumeUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -864,7 +864,7 @@ public static Volume Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static Volume Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -895,7 +895,7 @@ public static bool TryParse([CanBeNull] string str, out Volume result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out Volume result) { return QuantityParser.Default.TryParse( @@ -928,7 +928,7 @@ public static VolumeUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static VolumeUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -948,7 +948,7 @@ public static bool TryParseUnit(string str, out VolumeUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out VolumeUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1283,7 +1283,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1294,7 +1294,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1308,13 +1308,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index d57732b506..4500f53ffb 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -399,7 +399,7 @@ public static string GetAbbreviation(VolumeFlowUnit unit) /// /// Unit to get abbreviation for. /// Unit abbreviation string. - /// Format to use for localization. Defaults to if null. + /// Format to use for localization. Defaults to if null. public static string GetAbbreviation(VolumeFlowUnit unit, [CanBeNull] IFormatProvider provider) { return UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider); @@ -906,7 +906,7 @@ public static VolumeFlow Parse(string str) /// We wrap exceptions in to allow you to distinguish /// Units.NET exceptions from other exceptions. /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static VolumeFlow Parse(string str, [CanBeNull] IFormatProvider provider) { return QuantityParser.Default.Parse( @@ -937,7 +937,7 @@ public static bool TryParse([CanBeNull] string str, out VolumeFlow result) /// /// Length.Parse("5.5 m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParse([CanBeNull] string str, [CanBeNull] IFormatProvider provider, out VolumeFlow result) { return QuantityParser.Default.TryParse( @@ -970,7 +970,7 @@ public static VolumeFlowUnit ParseUnit(string str) /// /// The value of 'str' cannot be null. /// Error parsing string. - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static VolumeFlowUnit ParseUnit(string str, IFormatProvider provider = null) { return UnitParser.Default.Parse(str, provider); @@ -990,7 +990,7 @@ public static bool TryParseUnit(string str, out VolumeFlowUnit unit) /// /// Length.TryParseUnit("m", new CultureInfo("en-US")); /// - /// Format to use when parsing number and unit. Defaults to if null. + /// Format to use when parsing number and unit. Defaults to if null. public static bool TryParseUnit(string str, IFormatProvider provider, out VolumeFlowUnit unit) { return UnitParser.Default.TryParse(str, provider, out unit); @@ -1331,7 +1331,7 @@ public override string ToString() /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { return ToString(provider, 2); @@ -1342,7 +1342,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1356,13 +1356,13 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); if (args == null) throw new ArgumentNullException(nameof(args)); - provider = provider ?? GlobalConfiguration.DefaultCulture; + provider = provider ?? CultureInfo.CurrentUICulture; var value = Convert.ToDouble(Value); var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); diff --git a/UnitsNet/GeneratedCode/Quantity.g.cs b/UnitsNet/GeneratedCode/Quantity.g.cs index 0fa69f69e5..b2f5aadf76 100644 --- a/UnitsNet/GeneratedCode/Quantity.g.cs +++ b/UnitsNet/GeneratedCode/Quantity.g.cs @@ -339,7 +339,7 @@ public static bool TryFrom(QuantityValue value, Enum unit, out IQuantity quantit /// /// Dynamically parse a quantity string representation. /// - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Type of quantity, such as . /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The parsed quantity. @@ -361,7 +361,7 @@ public static bool TryParse(Type quantityType, string quantityString, out IQuant /// /// Try to dynamically parse a quantity string representation. /// - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Type of quantity, such as . /// Quantity string representation, such as "1.5 kg". Must be compatible with given quantity type. /// The resulting quantity if successful, otherwise default. From c1e905452e2aaeeaa731331401a9e0cced1ce3e4 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 22:58:33 +0100 Subject: [PATCH 4/7] Update non-gen code --- UnitsNet.Tests/CustomCode/StonePoundsTests.cs | 2 +- UnitsNet.Tests/QuantityIConvertibleTests.cs | 8 ++--- UnitsNet.Tests/QuantityTests.ToString.cs | 24 +++++++-------- .../CustomCode/Quantities/Length.extra.cs | 2 +- UnitsNet/CustomCode/Quantities/Mass.extra.cs | 2 +- UnitsNet/CustomCode/UnitAbbreviationsCache.cs | 30 +++++++++---------- UnitsNet/CustomCode/UnitParser.cs | 8 ++--- UnitsNet/IQuantity.cs | 6 ++-- UnitsNet/UnitConverter.cs | 4 +-- 9 files changed, 43 insertions(+), 43 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/StonePoundsTests.cs b/UnitsNet.Tests/CustomCode/StonePoundsTests.cs index b215a98d20..b8cafbb920 100644 --- a/UnitsNet.Tests/CustomCode/StonePoundsTests.cs +++ b/UnitsNet.Tests/CustomCode/StonePoundsTests.cs @@ -35,7 +35,7 @@ public void StonePoundsToString_FormatsNumberInDefaultCulture() { Mass m = Mass.FromStonePounds(3500, 1); StonePounds stonePounds = m.StonePounds; - string numberInCurrentCulture = 3500.ToString("n0", GlobalConfiguration.DefaultCulture); // Varies between machines, can't hard code it + string numberInCurrentCulture = 3500.ToString("n0", CultureInfo.CurrentUICulture); // Varies between machines, can't hard code it Assert.Equal($"{numberInCurrentCulture} st 1 lb", stonePounds.ToString()); } diff --git a/UnitsNet.Tests/QuantityIConvertibleTests.cs b/UnitsNet.Tests/QuantityIConvertibleTests.cs index e9ec133655..f2a27d58cf 100644 --- a/UnitsNet.Tests/QuantityIConvertibleTests.cs +++ b/UnitsNet.Tests/QuantityIConvertibleTests.cs @@ -115,10 +115,10 @@ public void ToSingleTest() [Fact] public void ToStringTest() { - string expected = length.ToString(GlobalConfiguration.DefaultCulture); - Assert.Equal(expected, lengthAsIConvertible.ToString(GlobalConfiguration.DefaultCulture)); - Assert.Equal(expected, Convert.ToString(length, GlobalConfiguration.DefaultCulture)); - Assert.Equal(expected, Convert.ChangeType(length, typeof(string), GlobalConfiguration.DefaultCulture)); + string expected = length.ToString(CultureInfo.CurrentUICulture); + Assert.Equal(expected, lengthAsIConvertible.ToString(CultureInfo.CurrentUICulture)); + Assert.Equal(expected, Convert.ToString(length, CultureInfo.CurrentUICulture)); + Assert.Equal(expected, Convert.ChangeType(length, typeof(string), CultureInfo.CurrentUICulture)); } [Fact] diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index 8dfe6b2978..1e40420098 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -61,10 +61,10 @@ public void CreatedByCtorWithValueAndUnit_ReturnsValueAndUnit() [Fact] public void ReturnsTheOriginalValueAndUnit() { - var oldCulture = GlobalConfiguration.DefaultCulture; + var oldCulture = CultureInfo.CurrentUICulture; try { - GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; Assert.Equal("5 kg", Mass.FromKilograms(5).ToString()); Assert.Equal("5,000 g", Mass.FromGrams(5000).ToString()); Assert.Equal("1e-04 long tn", Mass.FromLongTons(1e-4).ToString()); @@ -77,17 +77,17 @@ public void ReturnsTheOriginalValueAndUnit() } finally { - GlobalConfiguration.DefaultCulture = oldCulture; + CultureInfo.CurrentUICulture = oldCulture; } } [Fact] public void ConvertsToTheGivenUnit() { - var oldCulture = GlobalConfiguration.DefaultCulture; + var oldCulture = CultureInfo.CurrentUICulture; try { - GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; Assert.Equal("5,000 g", Mass.FromKilograms(5).ToUnit(MassUnit.Gram).ToString()); Assert.Equal("5 kg", Mass.FromGrams(5000).ToUnit(MassUnit.Kilogram).ToString()); Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString()); @@ -95,41 +95,41 @@ public void ConvertsToTheGivenUnit() } finally { - GlobalConfiguration.DefaultCulture = oldCulture; + CultureInfo.CurrentUICulture = oldCulture; } } [Fact] public void FormatsNumberUsingGivenCulture() { - var oldCulture = GlobalConfiguration.DefaultCulture; + var oldCulture = CultureInfo.CurrentUICulture; try { - GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null)); Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(CultureInfo.InvariantCulture)); Assert.Equal("0,05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(new CultureInfo("nb-NO"))); } finally { - GlobalConfiguration.DefaultCulture = oldCulture; + CultureInfo.CurrentUICulture = oldCulture; } } [Fact] public void FormatsNumberUsingGivenDigitsAfterRadix() { - var oldCulture = GlobalConfiguration.DefaultCulture; + var oldCulture = CultureInfo.CurrentUICulture; try { - GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null, 4)); Assert.Equal("1.97 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString(null, 2)); Assert.Equal("1.9685 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString(null, 4)); } finally { - GlobalConfiguration.DefaultCulture = oldCulture; + CultureInfo.CurrentUICulture = oldCulture; } } } diff --git a/UnitsNet/CustomCode/Quantities/Length.extra.cs b/UnitsNet/CustomCode/Quantities/Length.extra.cs index 68e697df6b..639d37a2a3 100644 --- a/UnitsNet/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Length.extra.cs @@ -173,7 +173,7 @@ public override string ToString() public string ToString([CanBeNull] IFormatProvider cultureInfo) { - cultureInfo = cultureInfo ?? GlobalConfiguration.DefaultCulture; + cultureInfo = cultureInfo ?? CultureInfo.CurrentUICulture; var footUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(LengthUnit.Foot, cultureInfo); var inchUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(LengthUnit.Inch, cultureInfo); diff --git a/UnitsNet/CustomCode/Quantities/Mass.extra.cs b/UnitsNet/CustomCode/Quantities/Mass.extra.cs index 610a646a80..8da221f9ea 100644 --- a/UnitsNet/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Mass.extra.cs @@ -93,7 +93,7 @@ public override string ToString() public string ToString([CanBeNull] IFormatProvider cultureInfo) { - cultureInfo = cultureInfo ?? GlobalConfiguration.DefaultCulture; + cultureInfo = cultureInfo ?? CultureInfo.CurrentUICulture; var stoneUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Stone, cultureInfo); var poundUnit = UnitAbbreviationsCache.Default.GetDefaultAbbreviation(MassUnit.Pound, cultureInfo); diff --git a/UnitsNet/CustomCode/UnitAbbreviationsCache.cs b/UnitsNet/CustomCode/UnitAbbreviationsCache.cs index 81d07b118c..efa5363de1 100644 --- a/UnitsNet/CustomCode/UnitAbbreviationsCache.cs +++ b/UnitsNet/CustomCode/UnitAbbreviationsCache.cs @@ -63,7 +63,7 @@ private void LoadGeneratedAbbreviations() [PublicAPI] public void MapUnitToAbbreviation(TUnitType unit, params string[] abbreviations) where TUnitType : Enum { - MapUnitToAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviations); + MapUnitToAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), CultureInfo.CurrentUICulture, abbreviations); } /// @@ -76,7 +76,7 @@ public void MapUnitToAbbreviation(TUnitType unit, params string[] abb /// The type of unit enum. public void MapUnitToDefaultAbbreviation(TUnitType unit, string abbreviation) where TUnitType : Enum { - MapUnitToDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), GlobalConfiguration.DefaultCulture, abbreviation); + MapUnitToDefaultAbbreviation(typeof(TUnitType), Convert.ToInt32(unit), CultureInfo.CurrentUICulture, abbreviation); } /// @@ -85,7 +85,7 @@ public void MapUnitToDefaultAbbreviation(TUnitType unit, string abbre /// in order to or on them later. /// /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations to add. /// The type of unit enum. [PublicAPI] @@ -106,7 +106,7 @@ public void MapUnitToAbbreviation(TUnitType unit, IFormatProvider for /// in order to or on them later. /// /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviation to add as default. /// The type of unit enum. [PublicAPI] @@ -128,7 +128,7 @@ public void MapUnitToDefaultAbbreviation(TUnitType unit, IFormatProvi /// /// The unit enum type. /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations to add. [PublicAPI] public void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] params string[] abbreviations) @@ -143,7 +143,7 @@ public void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider /// /// The unit enum type. /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviation to add as default. [PublicAPI] public void MapUnitToDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider, [NotNull] string abbreviation) @@ -159,7 +159,7 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro if (abbreviations == null) throw new ArgumentNullException(nameof(abbreviations)); - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + formatProvider = formatProvider ?? CultureInfo.CurrentUICulture; if (!_lookupsForCulture.TryGetValue(formatProvider, out var quantitiesForProvider)) quantitiesForProvider = _lookupsForCulture[formatProvider] = new UnitTypeToLookup(); @@ -178,7 +178,7 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro /// Example: GetDefaultAbbreviation<LengthUnit>(LengthUnit.Kilometer) => "km" /// /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// The type of unit enum. /// The default unit abbreviation string. [PublicAPI] @@ -213,7 +213,7 @@ public string GetDefaultAbbreviation(TUnitType unit, IFormatProvider /// /// The unit enum type. /// The unit enum value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// The default unit abbreviation string. [PublicAPI] public string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvider formatProvider = null) @@ -243,7 +243,7 @@ public string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvid /// /// Enum type for units. /// Enum value for unit. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] public string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider formatProvider = null) where TUnitType : Enum @@ -256,12 +256,12 @@ public string[] GetUnitAbbreviations(TUnitType unit, IFormatProvider /// /// Enum type for unit. /// Enum value for unit. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] public string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvider formatProvider = null) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + formatProvider = formatProvider ?? CultureInfo.CurrentUICulture; if(!TryGetUnitValueAbbreviationLookup(unitType, formatProvider, out var lookup)) return formatProvider != FallbackCulture ? GetUnitAbbreviations(unitType, unitValue, FallbackCulture) : new string[] { }; @@ -277,12 +277,12 @@ public string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvid /// Get all abbreviations for all units of a quantity. /// /// Enum type for unit. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit abbreviations associated with unit. [PublicAPI] public string[] GetAllUnitAbbreviationsForQuantity(Type unitEnumType, IFormatProvider formatProvider = null) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + formatProvider = formatProvider ?? CultureInfo.CurrentUICulture; if(!TryGetUnitValueAbbreviationLookup(unitEnumType, formatProvider, out var lookup)) return formatProvider != FallbackCulture ? GetAllUnitAbbreviationsForQuantity(unitEnumType, FallbackCulture) : new string[] { }; @@ -294,7 +294,7 @@ internal bool TryGetUnitValueAbbreviationLookup(Type unitType, IFormatProvider f { unitToAbbreviations = null; - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + formatProvider = formatProvider ?? CultureInfo.CurrentUICulture; if(!_lookupsForCulture.TryGetValue(formatProvider, out var quantitiesForProvider)) return formatProvider != FallbackCulture ? TryGetUnitValueAbbreviationLookup(unitType, FallbackCulture, out unitToAbbreviations) : false; diff --git a/UnitsNet/CustomCode/UnitParser.cs b/UnitsNet/CustomCode/UnitParser.cs index 0ae9dc0cbe..7927345e90 100644 --- a/UnitsNet/CustomCode/UnitParser.cs +++ b/UnitsNet/CustomCode/UnitParser.cs @@ -30,7 +30,7 @@ static UnitParser() /// Example: Parse<LengthUnit>("km") => LengthUnit.Kilometer /// /// - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// /// [PublicAPI] @@ -48,7 +48,7 @@ public TUnitType Parse(string unitAbbreviation, [CanBeNull] IFormatPr /// respectively. /// /// Unit enum type, such as and . - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// Unit enum value, such as . /// No units match the abbreviation. /// More than one unit matches the abbreviation. @@ -97,7 +97,7 @@ public bool TryParse(string unitAbbreviation, out TUnitType unit) whe /// Try to parse a unit abbreviation. /// /// The string value. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// The unit enum value as out result. /// Type of unit enum. /// True if successful. @@ -131,7 +131,7 @@ public bool TryParse(string unitAbbreviation, Type unitType, out Enum unit) /// /// The string value. /// Type of unit enum. - /// The format provider to use for lookup. Defaults to if null. + /// The format provider to use for lookup. Defaults to if null. /// The unit enum value as out result. /// True if successful. [PublicAPI] diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 7db8eae490..2763f35f33 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -56,7 +56,7 @@ public interface IQuantity /// Get string representation of value and unit. Using two significant digits after radix. /// /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. string ToString([CanBeNull] IFormatProvider provider); /// @@ -64,7 +64,7 @@ public interface IQuantity /// /// The number of significant digits after the radix point. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix); /// @@ -73,7 +73,7 @@ public interface IQuantity /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively." /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. - /// Format to use for localization and number formatting. Defaults to if null. + /// Format to use for localization and number formatting. Defaults to if null. string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args); } diff --git a/UnitsNet/UnitConverter.cs b/UnitsNet/UnitConverter.cs index e6d21c34b2..126d1fd150 100644 --- a/UnitsNet/UnitConverter.cs +++ b/UnitsNet/UnitConverter.cs @@ -235,7 +235,7 @@ public static double ConvertByAbbreviation(QuantityValue fromValue, string quant if (!TryGetUnitType(quantityName, out var unitType)) throw new UnitNotFoundException($"The unit type for the given quantity was not found: {quantityName}"); - var cultureInfo = string.IsNullOrWhiteSpace(culture) ? GlobalConfiguration.DefaultCulture : new CultureInfo(culture); + var cultureInfo = string.IsNullOrWhiteSpace(culture) ? CultureInfo.CurrentUICulture : new CultureInfo(culture); var fromUnitValue = UnitParser.Default.Parse(fromUnitAbbrev, unitType, cultureInfo); // ex: ("m", LengthUnit) => LengthUnit.Meter var toUnitValue = UnitParser.Default.Parse(toUnitAbbrev, unitType, cultureInfo); // ex:("cm", LengthUnit) => LengthUnit.Centimeter @@ -320,7 +320,7 @@ public static bool TryConvertByAbbreviation(QuantityValue fromValue, string quan if (!TryGetUnitType(quantityName, out var unitType)) return false; - var cultureInfo = string.IsNullOrWhiteSpace(culture) ? GlobalConfiguration.DefaultCulture : new CultureInfo(culture); + var cultureInfo = string.IsNullOrWhiteSpace(culture) ? CultureInfo.CurrentUICulture : new CultureInfo(culture); if (!UnitParser.Default.TryParse(fromUnitAbbrev, unitType, cultureInfo, out var fromUnitValue)) // ex: ("m", LengthUnit) => LengthUnit.Meter return false; From 1faf31cfe7fc353c1d8fc4b1b7bacac95d4f8b7b Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 23:00:27 +0100 Subject: [PATCH 5/7] GlobalConfiguration: Use CurrentUICulture as backing value --- UnitsNet/CustomCode/GlobalConfiguration.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UnitsNet/CustomCode/GlobalConfiguration.cs b/UnitsNet/CustomCode/GlobalConfiguration.cs index b90aa418d9..0791d5d6af 100644 --- a/UnitsNet/CustomCode/GlobalConfiguration.cs +++ b/UnitsNet/CustomCode/GlobalConfiguration.cs @@ -19,6 +19,10 @@ public sealed class GlobalConfiguration /// Can be overridden, but note that this is static and will affect all subsequent usages. /// [Obsolete("Manipulate CultureInfo.CurrentUICulture instead, this property will be removed.")] - public static IFormatProvider DefaultCulture { get; set; } = CultureInfo.CurrentUICulture; + public static IFormatProvider DefaultCulture + { + get => CultureInfo.CurrentUICulture; + set => CultureInfo.CurrentUICulture = (CultureInfo) value; + } } } From a1b709d5b9e29fe4ff7678a4838d2b20c5eef193 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Mon, 25 Feb 2019 23:07:29 +0100 Subject: [PATCH 6/7] Use Thread.CurrentThread.CurrentUICulture instead CultureInfo properties not writable in all .NET targets. --- UnitsNet.Tests/QuantityIConvertibleTests.cs | 1 + UnitsNet/CustomCode/GlobalConfiguration.cs | 12 ++++++------ UnitsNet/CustomCode/Quantities/Length.extra.cs | 1 + UnitsNet/CustomCode/Quantities/Mass.extra.cs | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/UnitsNet.Tests/QuantityIConvertibleTests.cs b/UnitsNet.Tests/QuantityIConvertibleTests.cs index f2a27d58cf..698d4ce9b9 100644 --- a/UnitsNet.Tests/QuantityIConvertibleTests.cs +++ b/UnitsNet.Tests/QuantityIConvertibleTests.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using UnitsNet.Units; using Xunit; diff --git a/UnitsNet/CustomCode/GlobalConfiguration.cs b/UnitsNet/CustomCode/GlobalConfiguration.cs index 0791d5d6af..3e8c8a96d9 100644 --- a/UnitsNet/CustomCode/GlobalConfiguration.cs +++ b/UnitsNet/CustomCode/GlobalConfiguration.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; +using System.Threading; // ReSharper disable once CheckNamespace namespace UnitsNet @@ -11,18 +12,17 @@ namespace UnitsNet /// Global configuration for culture, used as default culture in methods like and /// . /// - [Obsolete("The only property DefaultCulture is now deprecated. Manipulate CultureInfo.CurrentUICulture instead.")] + [Obsolete("The only property DefaultCulture is now deprecated. Manipulate Thread.CurrentThread.CurrentUICulture instead.")] public sealed class GlobalConfiguration { /// - /// Defaults to when creating an instance with no culture provided. - /// Can be overridden, but note that this is static and will affect all subsequent usages. + /// Wrapper for . /// - [Obsolete("Manipulate CultureInfo.CurrentUICulture instead, this property will be removed.")] + [Obsolete("Manipulate Thread.CurrentThread.CurrentUICulture instead, this property will be removed.")] public static IFormatProvider DefaultCulture { - get => CultureInfo.CurrentUICulture; - set => CultureInfo.CurrentUICulture = (CultureInfo) value; + get => Thread.CurrentThread.CurrentUICulture; + set => Thread.CurrentThread.CurrentUICulture = (CultureInfo) value; } } } diff --git a/UnitsNet/CustomCode/Quantities/Length.extra.cs b/UnitsNet/CustomCode/Quantities/Length.extra.cs index 639d37a2a3..6f58a1a771 100644 --- a/UnitsNet/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Length.extra.cs @@ -2,6 +2,7 @@ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using System.Text.RegularExpressions; using JetBrains.Annotations; using UnitsNet.Units; diff --git a/UnitsNet/CustomCode/Quantities/Mass.extra.cs b/UnitsNet/CustomCode/Quantities/Mass.extra.cs index 8da221f9ea..d4ddb8c944 100644 --- a/UnitsNet/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Mass.extra.cs @@ -2,6 +2,7 @@ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using JetBrains.Annotations; using UnitsNet.Units; From 1633b0d37ace1421541724d76309f1b860b829e8 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Thu, 28 Feb 2019 21:47:34 +0100 Subject: [PATCH 7/7] Add usings to fix build errors on xmldoc refs --- UnitsNet/CustomCode/UnitParser.cs | 1 + UnitsNet/GeneratedCode/Quantity.g.cs | 1 + UnitsNet/IQuantity.cs | 1 + UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 | 1 + 4 files changed, 4 insertions(+) diff --git a/UnitsNet/CustomCode/UnitParser.cs b/UnitsNet/CustomCode/UnitParser.cs index d3882d81df..d1065554a3 100644 --- a/UnitsNet/CustomCode/UnitParser.cs +++ b/UnitsNet/CustomCode/UnitParser.cs @@ -2,6 +2,7 @@ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; diff --git a/UnitsNet/GeneratedCode/Quantity.g.cs b/UnitsNet/GeneratedCode/Quantity.g.cs index b2f5aadf76..ce8e9d18c3 100644 --- a/UnitsNet/GeneratedCode/Quantity.g.cs +++ b/UnitsNet/GeneratedCode/Quantity.g.cs @@ -18,6 +18,7 @@ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.InternalHelpers; diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 967a9832c6..19fc7f7565 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -2,6 +2,7 @@ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using JetBrains.Annotations; using UnitsNet.Units; diff --git a/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 index 4d4428c723..ec35003916 100644 --- a/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateStaticQuantitySourceCode.ps1 @@ -23,6 +23,7 @@ function GenerateStaticQuantitySourceCode([Quantity[]]$quantities, [string]$targ // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; +using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.InternalHelpers;