Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetLocalizedNameByMuiNativeResource()

static string System.TimeZoneInfo.GetLocalizedNameByMuiNativeResource ( string resource)
inlinestaticprivate

Definition at line 2726 of file TimeZoneInfo.cs.

2727 {
2729 {
2730 return string.Empty;
2731 }
2732 string[] array = resource.Split(',');
2733 if (array.Length != 2)
2734 {
2735 return string.Empty;
2736 }
2737 if (!int.TryParse(array[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result))
2738 {
2739 return string.Empty;
2740 }
2741 result = -result;
2743 string systemDirectory = Environment.SystemDirectory;
2744 string path = $"{array[0].AsSpan().TrimStart('@')}.mui";
2745 try
2746 {
2747 while (cultureInfo.Name.Length != 0)
2748 {
2749 string text = Path.Join(systemDirectory, cultureInfo.Name, path);
2750 if (File.Exists(text))
2751 {
2752 return GetLocalizedNameByNativeResource(text, result);
2753 }
2754 cultureInfo = cultureInfo.Parent;
2755 }
2756 }
2757 catch (ArgumentException)
2758 {
2759 }
2760 return string.Empty;
2761 }
static CultureInfo CurrentUICulture
static CultureInfo InvariantCulture
static bool Exists([NotNullWhen(true)] string? path)
Definition File.cs:97
static string Join(ReadOnlySpan< char > path1, ReadOnlySpan< char > path2)
Definition Path.cs:387
static unsafe string GetLocalizedNameByNativeResource(string filePath, int resource)

References System.array, System.Globalization.CultureInfo.CurrentUICulture, System.IO.File.Exists(), System.TimeZoneInfo.GetLocalizedNameByNativeResource(), System.Globalization.GlobalizationMode.Invariant, System.Globalization.CultureInfo.InvariantCulture, System.IO.Path.Join(), System.Globalization.GlobalizationMode.PredefinedCulturesOnly, System.Environment.SystemDirectory, and System.text.

Referenced by System.TimeZoneInfo.GetLocalizedNamesByRegistryKey(), and System.TimeZoneInfo.GetUtcStandardDisplayName().