Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SR.cs
Go to the documentation of this file.
3
4namespace System;
5
6internal static class SR
7{
8 private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;
9
11
13
14 internal static string ConvertInvalidPrimitive => GetResourceString("ConvertInvalidPrimitive");
15
16 internal static string InvalidColor => GetResourceString("InvalidColor");
17
18 internal static string InvalidEx2BoundArgument => GetResourceString("InvalidEx2BoundArgument");
19
20 private static bool UsingResourceKeys()
21 {
23 }
24
25 internal static string GetResourceString(string resourceKey)
26 {
28 {
29 return resourceKey;
30 }
31 string result = null;
32 try
33 {
34 result = ResourceManager.GetString(resourceKey);
35 }
37 {
38 }
39 return result;
40 }
41
42 internal static string Format(string resourceFormat, object p1)
43 {
45 {
46 return string.Join(", ", resourceFormat, p1);
47 }
48 return string.Format(resourceFormat, p1);
49 }
50
51 internal static string Format(string resourceFormat, object p1, object p2)
52 {
54 {
55 return string.Join(", ", resourceFormat, p1, p2);
56 }
57 return string.Format(resourceFormat, p1, p2);
58 }
59
60 internal static string Format(string resourceFormat, params object[] args)
61 {
62 if (args != null)
63 {
65 {
66 return resourceFormat + ", " + string.Join(", ", args);
67 }
68 return string.Format(resourceFormat, args);
69 }
70 return resourceFormat;
71 }
72}
static bool TryGetSwitch(string switchName, out bool isEnabled)
Definition AppContext.cs:74
virtual ? string GetString(string name)
static ResourceManager s_resourceManager
Definition SR.cs:10
static string Format(string resourceFormat, object p1)
Definition SR.cs:42
static string Format(string resourceFormat, object p1, object p2)
Definition SR.cs:51
static ResourceManager ResourceManager
Definition SR.cs:12
static string ConvertInvalidPrimitive
Definition SR.cs:20
static string GetResourceString(string resourceKey)
Definition SR.cs:101
static bool UsingResourceKeys()
Definition SR.cs:20
static readonly bool s_usingResourceKeys
Definition SR.cs:8
static string InvalidColor
Definition SR.cs:56
static string InvalidEx2BoundArgument
Definition SR.cs:18
static string Format(string resourceFormat, params object[] args)
Definition SR.cs:60