Skip to content

Commit 039c7ce

Browse files
committed
Un-obsolete static Default getters
Per discussion in v6, we no longer want to remove these. #1475 (comment)
1 parent b3f04ec commit 039c7ce

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

UnitsNet/CustomCode/QuantityParser.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ public class QuantityParser
3535
private readonly UnitParser _unitParser;
3636

3737
/// <summary>
38-
/// The default instance of <see cref="QuantityParser"/>, which uses <see cref="UnitsNetSetup"/>.<see cref="UnitsNetSetup.Default"/>.<see cref="UnitsNetSetup.UnitAbbreviations"/>.
38+
/// The default singleton instance for parsing quantities.
3939
/// </summary>
40-
[Obsolete("Use UnitsNetSetup.Default.QuantityParser instead.")]
40+
/// <remarks>
41+
/// Convenience shortcut for <see cref="UnitsNetSetup"/>.<see cref="UnitsNetSetup.Default"/>.<see cref="UnitsNetSetup.QuantityParser"/>.
42+
/// </remarks>
4143
public static QuantityParser Default => UnitsNetSetup.Default.QuantityParser;
4244

4345
/// <summary>

UnitsNet/CustomCode/UnitAbbreviationsCache.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ public sealed class UnitAbbreviationsCache
3232
internal static readonly CultureInfo FallbackCulture = CultureInfo.InvariantCulture;
3333

3434
/// <summary>
35-
/// The static instance used internally for ToString() and Parse() of quantities and units.
35+
/// The default singleton instance with the default configured unit abbreviations, used for ToString() and parsing of quantities and units.
3636
/// </summary>
37-
[Obsolete("Use UnitsNetSetup.Default.UnitAbbreviations instead.")]
37+
/// <remarks>
38+
/// Convenience shortcut for <see cref="UnitsNetSetup"/>.<see cref="UnitsNetSetup.Default"/>.<see cref="UnitsNetSetup.UnitAbbreviations"/>.<br />
39+
/// You can add custom unit abbreviations at runtime, and this will affect all usages globally in the application.
40+
/// </remarks>
3841
public static UnitAbbreviationsCache Default => UnitsNetSetup.Default.UnitAbbreviations;
3942

4043
private QuantityInfoLookup QuantityInfoLookup { get; }

UnitsNet/CustomCode/UnitParser.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ public sealed class UnitParser
2020
private readonly UnitAbbreviationsCache _unitAbbreviationsCache;
2121

2222
/// <summary>
23-
/// The default static instance used internally to parse quantities and units using the
24-
/// default abbreviations cache for all units and abbreviations defined in the library.
23+
/// The default singleton instance for parsing units from the default configured unit abbreviations.
2524
/// </summary>
26-
[Obsolete("Use UnitsNetSetup.Default.UnitParser instead.")]
25+
/// <remarks>
26+
/// Convenience shortcut for <see cref="UnitsNetSetup"/>.<see cref="UnitsNetSetup.Default"/>.<see cref="UnitsNetSetup.UnitParser"/>.
27+
/// </remarks>
2728
public static UnitParser Default => UnitsNetSetup.Default.UnitParser;
2829

2930
/// <summary>

UnitsNet/UnitConverter.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ public delegate TQuantity ConversionFunction<TQuantity>(TQuantity inputValue)
3636
public sealed class UnitConverter
3737
{
3838
/// <summary>
39-
/// The static instance used by Units.NET to convert between units. Modify this to add/remove conversion functions at runtime, such
40-
/// as adding your own third-party units and quantities to convert between.
39+
/// The default singleton instance for converting values from one unit to another.<br />
40+
/// Modify this to add/remove conversion functions at runtime, such as adding your own third-party units and quantities to convert between.
4141
/// </summary>
42-
[Obsolete("Use UnitsNetSetup.Default.UnitConverter instead.")]
42+
/// <remarks>
43+
/// Convenience shortcut for <see cref="UnitsNetSetup"/>.<see cref="UnitsNetSetup.Default"/>.<see cref="UnitsNetSetup.UnitConverter"/>.
44+
/// </remarks>
4345
public static UnitConverter Default => UnitsNetSetup.Default.UnitConverter;
4446

4547
/// <summary>

0 commit comments

Comments
 (0)