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 Arg_KeyNotFoundWithKey => GetResourceString("Arg_KeyNotFoundWithKey");
15
16 internal static string ArrayInitializedStateNotEqual => GetResourceString("ArrayInitializedStateNotEqual");
17
18 internal static string ArrayLengthsNotEqual => GetResourceString("ArrayLengthsNotEqual");
19
20 internal static string CannotFindOldValue => GetResourceString("CannotFindOldValue");
21
22 internal static string CapacityMustBeGreaterThanOrEqualToCount => GetResourceString("CapacityMustBeGreaterThanOrEqualToCount");
23
24 internal static string CapacityMustEqualCountOnMove => GetResourceString("CapacityMustEqualCountOnMove");
25
26 internal static string CollectionModifiedDuringEnumeration => GetResourceString("CollectionModifiedDuringEnumeration");
27
28 internal static string DuplicateKey => GetResourceString("DuplicateKey");
29
30 internal static string InvalidEmptyOperation => GetResourceString("InvalidEmptyOperation");
31
32 internal static string InvalidOperationOnDefaultArray => GetResourceString("InvalidOperationOnDefaultArray");
33
34 private static bool UsingResourceKeys()
35 {
37 }
38
39 internal static string GetResourceString(string resourceKey)
40 {
42 {
43 return resourceKey;
44 }
45 string result = null;
46 try
47 {
48 result = ResourceManager.GetString(resourceKey);
49 }
51 {
52 }
53 return result;
54 }
55
56 internal static string GetResourceString(string resourceKey, string defaultString)
57 {
58 string resourceString = GetResourceString(resourceKey);
59 if (!(resourceKey == resourceString) && resourceString != null)
60 {
61 return resourceString;
62 }
63 return defaultString;
64 }
65
66 internal static string Format(string resourceFormat, object? p1)
67 {
69 {
70 return string.Join(", ", resourceFormat, p1);
71 }
72 return string.Format(resourceFormat, p1);
73 }
74
75 internal static string Format(string resourceFormat, object? p1, object? p2)
76 {
78 {
79 return string.Join(", ", resourceFormat, p1, p2);
80 }
81 return string.Format(resourceFormat, p1, p2);
82 }
83
84 internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
85 {
87 {
88 return string.Join(", ", resourceFormat, p1, p2, p3);
89 }
90 return string.Format(resourceFormat, p1, p2, p3);
91 }
92
93 internal static string Format(string resourceFormat, params object?[]? args)
94 {
95 if (args != null)
96 {
98 {
99 return resourceFormat + ", " + string.Join(", ", args);
100 }
101 return string.Format(resourceFormat, args);
102 }
103 return resourceFormat;
104 }
105
106 internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
107 {
108 if (UsingResourceKeys())
109 {
110 return string.Join(", ", resourceFormat, p1);
111 }
112 return string.Format(provider, resourceFormat, p1);
113 }
114
115 internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
116 {
117 if (UsingResourceKeys())
118 {
119 return string.Join(", ", resourceFormat, p1, p2);
120 }
121 return string.Format(provider, resourceFormat, p1, p2);
122 }
123
124 internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
125 {
126 if (UsingResourceKeys())
127 {
128 return string.Join(", ", resourceFormat, p1, p2, p3);
129 }
130 return string.Format(provider, resourceFormat, p1, p2, p3);
131 }
132
133 internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
134 {
135 if (args != null)
136 {
137 if (UsingResourceKeys())
138 {
139 return resourceFormat + ", " + string.Join(", ", args);
140 }
141 return string.Format(provider, resourceFormat, args);
142 }
143 return resourceFormat;
144 }
145}
static bool TryGetSwitch(string switchName, out bool isEnabled)
Definition AppContext.cs:74
virtual ? string GetString(string name)
static string GetResourceString(string resourceKey, string defaultString)
Definition SR.cs:56
static string Format(string resourceFormat, object? p1)
Definition SR.cs:66
static ResourceManager s_resourceManager
Definition SR.cs:10
static string Format(string resourceFormat, object? p1, object? p2, object? p3)
Definition SR.cs:84
static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
Definition SR.cs:115
static string CollectionModifiedDuringEnumeration
Definition SR.cs:26
static ResourceManager ResourceManager
Definition SR.cs:12
static string Format(string resourceFormat, params object?[]? args)
Definition SR.cs:93
static string InvalidOperationOnDefaultArray
Definition SR.cs:32
static string CapacityMustEqualCountOnMove
Definition SR.cs:24
static string Format(string resourceFormat, object? p1, object? p2)
Definition SR.cs:75
static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
Definition SR.cs:124
static string ArrayLengthsNotEqual
Definition SR.cs:18
static string CapacityMustBeGreaterThanOrEqualToCount
Definition SR.cs:22
static string GetResourceString(string resourceKey)
Definition SR.cs:101
static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
Definition SR.cs:106
static bool UsingResourceKeys()
Definition SR.cs:34
static string ArrayInitializedStateNotEqual
Definition SR.cs:16
static string InvalidEmptyOperation
Definition SR.cs:30
static string DuplicateKey
Definition SR.cs:28
static readonly bool s_usingResourceKeys
Definition SR.cs:8
static string CannotFindOldValue
Definition SR.cs:20
static string Arg_KeyNotFoundWithKey
Definition SR.cs:94
static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
Definition SR.cs:133