@@ -73,7 +73,7 @@ private void LoadGeneratedAbbreviations()
73
73
[ PublicAPI ]
74
74
public void MapUnitToAbbreviation < TUnitType > ( TUnitType unit , params string [ ] abbreviations ) where TUnitType : Enum
75
75
{
76
- MapUnitToAbbreviation ( typeof ( TUnitType ) , Convert . ToInt32 ( unit ) , GlobalConfiguration . DefaultCulture , abbreviations ) ;
76
+ MapUnitToAbbreviation ( typeof ( TUnitType ) , Convert . ToInt32 ( unit ) , CultureInfo . CurrentUICulture , abbreviations ) ;
77
77
}
78
78
79
79
/// <summary>
@@ -86,7 +86,7 @@ public void MapUnitToAbbreviation<TUnitType>(TUnitType unit, params string[] abb
86
86
/// <typeparam name="TUnitType">The type of unit enum.</typeparam>
87
87
public void MapUnitToDefaultAbbreviation < TUnitType > ( TUnitType unit , string abbreviation ) where TUnitType : Enum
88
88
{
89
- MapUnitToDefaultAbbreviation ( typeof ( TUnitType ) , Convert . ToInt32 ( unit ) , GlobalConfiguration . DefaultCulture , abbreviation ) ;
89
+ MapUnitToDefaultAbbreviation ( typeof ( TUnitType ) , Convert . ToInt32 ( unit ) , CultureInfo . CurrentUICulture , abbreviation ) ;
90
90
}
91
91
92
92
/// <summary>
@@ -95,7 +95,7 @@ public void MapUnitToDefaultAbbreviation<TUnitType>(TUnitType unit, string abbre
95
95
/// in order to <see cref="UnitParser.Parse{TUnitType}"/> or <see cref="GetDefaultAbbreviation{TUnitType}"/> on them later.
96
96
/// </summary>
97
97
/// <param name="unit">The unit enum value.</param>
98
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
98
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
99
99
/// <param name="abbreviations">Unit abbreviations to add.</param>
100
100
/// <typeparam name="TUnitType">The type of unit enum.</typeparam>
101
101
[ PublicAPI ]
@@ -116,7 +116,7 @@ public void MapUnitToAbbreviation<TUnitType>(TUnitType unit, IFormatProvider for
116
116
/// in order to <see cref="UnitParser.Parse{TUnitType}"/> or <see cref="GetDefaultAbbreviation{TUnitType}"/> on them later.
117
117
/// </summary>
118
118
/// <param name="unit">The unit enum value.</param>
119
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
119
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
120
120
/// <param name="abbreviation">Unit abbreviation to add as default.</param>
121
121
/// <typeparam name="TUnitType">The type of unit enum.</typeparam>
122
122
[ PublicAPI ]
@@ -138,7 +138,7 @@ public void MapUnitToDefaultAbbreviation<TUnitType>(TUnitType unit, IFormatProvi
138
138
/// </summary>
139
139
/// <param name="unitType">The unit enum type.</param>
140
140
/// <param name="unitValue">The unit enum value.</param>
141
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
141
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
142
142
/// <param name="abbreviations">Unit abbreviations to add.</param>
143
143
[ PublicAPI ]
144
144
public void MapUnitToAbbreviation ( Type unitType , int unitValue , IFormatProvider formatProvider , [ NotNull ] params string [ ] abbreviations )
@@ -153,7 +153,7 @@ public void MapUnitToAbbreviation(Type unitType, int unitValue, IFormatProvider
153
153
/// </summary>
154
154
/// <param name="unitType">The unit enum type.</param>
155
155
/// <param name="unitValue">The unit enum value.</param>
156
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
156
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
157
157
/// <param name="abbreviation">Unit abbreviation to add as default.</param>
158
158
[ PublicAPI ]
159
159
public void MapUnitToDefaultAbbreviation ( Type unitType , int unitValue , IFormatProvider formatProvider , [ NotNull ] string abbreviation )
@@ -169,7 +169,7 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro
169
169
if ( abbreviations == null )
170
170
throw new ArgumentNullException ( nameof ( abbreviations ) ) ;
171
171
172
- formatProvider = formatProvider ?? GlobalConfiguration . DefaultCulture ;
172
+ formatProvider = formatProvider ?? CultureInfo . CurrentUICulture ;
173
173
174
174
if ( ! _lookupsForCulture . TryGetValue ( formatProvider , out var quantitiesForProvider ) )
175
175
quantitiesForProvider = _lookupsForCulture [ formatProvider ] = new UnitTypeToLookup ( ) ;
@@ -188,7 +188,7 @@ private void PerformAbbreviationMapping(Type unitType, int unitValue, IFormatPro
188
188
/// Example: GetDefaultAbbreviation<LengthUnit>(LengthUnit.Kilometer) => "km"
189
189
/// </summary>
190
190
/// <param name="unit">The unit enum value.</param>
191
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
191
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
192
192
/// <typeparam name="TUnitType">The type of unit enum.</typeparam>
193
193
/// <returns>The default unit abbreviation string.</returns>
194
194
[ PublicAPI ]
@@ -223,7 +223,7 @@ public string GetDefaultAbbreviation<TUnitType>(TUnitType unit, IFormatProvider
223
223
/// </summary>
224
224
/// <param name="unitType">The unit enum type.</param>
225
225
/// <param name="unitValue">The unit enum value.</param>
226
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
226
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
227
227
/// <returns>The default unit abbreviation string.</returns>
228
228
[ PublicAPI ]
229
229
public string GetDefaultAbbreviation ( Type unitType , int unitValue , IFormatProvider formatProvider = null )
@@ -253,7 +253,7 @@ public string GetDefaultAbbreviation(Type unitType, int unitValue, IFormatProvid
253
253
/// </summary>
254
254
/// <typeparam name="TUnitType">Enum type for units.</typeparam>
255
255
/// <param name="unit">Enum value for unit.</param>
256
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
256
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
257
257
/// <returns>Unit abbreviations associated with unit.</returns>
258
258
[ PublicAPI ]
259
259
public string [ ] GetUnitAbbreviations < TUnitType > ( TUnitType unit , IFormatProvider formatProvider = null ) where TUnitType : Enum
@@ -266,12 +266,12 @@ public string[] GetUnitAbbreviations<TUnitType>(TUnitType unit, IFormatProvider
266
266
/// </summary>
267
267
/// <param name="unitType">Enum type for unit.</param>
268
268
/// <param name="unitValue">Enum value for unit.</param>
269
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
269
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
270
270
/// <returns>Unit abbreviations associated with unit.</returns>
271
271
[ PublicAPI ]
272
272
public string [ ] GetUnitAbbreviations ( Type unitType , int unitValue , IFormatProvider formatProvider = null )
273
273
{
274
- formatProvider = formatProvider ?? GlobalConfiguration . DefaultCulture ;
274
+ formatProvider = formatProvider ?? CultureInfo . CurrentUICulture ;
275
275
276
276
if ( ! TryGetUnitValueAbbreviationLookup ( unitType , formatProvider , out var lookup ) )
277
277
return formatProvider != FallbackCulture ? GetUnitAbbreviations ( unitType , unitValue , FallbackCulture ) : new string [ ] { } ;
@@ -287,12 +287,12 @@ public string[] GetUnitAbbreviations(Type unitType, int unitValue, IFormatProvid
287
287
/// Get all abbreviations for all units of a quantity.
288
288
/// </summary>
289
289
/// <param name="unitEnumType">Enum type for unit.</param>
290
- /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="GlobalConfiguration.DefaultCulture " /> if null.</param>
290
+ /// <param name="formatProvider">The format provider to use for lookup. Defaults to <see cref="CultureInfo.CurrentUICulture " /> if null.</param>
291
291
/// <returns>Unit abbreviations associated with unit.</returns>
292
292
[ PublicAPI ]
293
293
public string [ ] GetAllUnitAbbreviationsForQuantity ( Type unitEnumType , IFormatProvider formatProvider = null )
294
294
{
295
- formatProvider = formatProvider ?? GlobalConfiguration . DefaultCulture ;
295
+ formatProvider = formatProvider ?? CultureInfo . CurrentUICulture ;
296
296
297
297
if ( ! TryGetUnitValueAbbreviationLookup ( unitEnumType , formatProvider , out var lookup ) )
298
298
return formatProvider != FallbackCulture ? GetAllUnitAbbreviationsForQuantity ( unitEnumType , FallbackCulture ) : new string [ ] { } ;
@@ -304,7 +304,7 @@ internal bool TryGetUnitValueAbbreviationLookup(Type unitType, IFormatProvider f
304
304
{
305
305
unitToAbbreviations = null ;
306
306
307
- formatProvider = formatProvider ?? GlobalConfiguration . DefaultCulture ;
307
+ formatProvider = formatProvider ?? CultureInfo . CurrentUICulture ;
308
308
309
309
if ( ! _lookupsForCulture . TryGetValue ( formatProvider , out var quantitiesForProvider ) )
310
310
return formatProvider != FallbackCulture ? TryGetUnitValueAbbreviationLookup ( unitType , FallbackCulture , out unitToAbbreviations ) : false ;
0 commit comments