| 123456789101112131415161718192021222324252627282930313233343536 |
- // Licensed to the .NET Foundation under one or more agreements.
- // The .NET Foundation licenses this file to you under the MIT license.
- // See the LICENSE file in the project root for more information.
- using System.Diagnostics;
- namespace System.Globalization
- {
- public partial class CultureInfo : IFormatProvider
- {
- internal static CultureInfo GetUserDefaultCulture()
- {
- if (GlobalizationMode.Invariant)
- return CultureInfo.InvariantCulture;
- CultureInfo cultureInfo;
- string? localeName;
- if (CultureData.GetDefaultLocaleName(out localeName))
- {
- Debug.Assert(localeName != null);
- cultureInfo = GetCultureByName(localeName);
- }
- else
- {
- cultureInfo = CultureInfo.InvariantCulture;
- }
- return cultureInfo;
- }
- private static CultureInfo GetUserDefaultUICulture()
- {
- return InitializeUserDefaultCulture();
- }
- }
- }
|