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

◆ InternalGetResourceString()

static string System.SR.InternalGetResourceString ( string key)
inlinestaticprivate

Definition at line 2214 of file SR.cs.

2215 {
2216 if (key.Length == 0)
2217 {
2218 return key;
2219 }
2220 bool lockTaken = false;
2221 try
2222 {
2224 if (_currentlyLoading != null && _currentlyLoading.Count > 0 && _currentlyLoading.LastIndexOf(key) != -1)
2225 {
2227 {
2228 return key;
2229 }
2231 string message = $"Infinite recursion during resource lookup within {"System.Private.CoreLib"}. This may be a bug in {"System.Private.CoreLib"}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}";
2232 Environment.FailFast(message);
2233 }
2234 if (_currentlyLoading == null)
2235 {
2237 }
2239 {
2245 }
2247 string @string = ResourceManager.GetString(key, null);
2248 _currentlyLoading.RemoveAt(_currentlyLoading.Count - 1);
2249 return @string ?? key;
2250 }
2251 catch
2252 {
2253 if (lockTaken)
2254 {
2255 s_resourceManager = null;
2256 _currentlyLoading = null;
2257 }
2258 throw;
2259 }
2260 finally
2261 {
2262 if (lockTaken)
2263 {
2265 }
2266 }
2267 }
virtual ? string GetString(string name)
static void RunClassConstructor(QCallTypeHandle type)
static ResourceManager s_resourceManager
Definition SR.cs:10
static bool _resourceManagerInited
Definition SR.cs:18
static List< string > _currentlyLoading
Definition SR.cs:14
static readonly object _lock
Definition SR.cs:12
static int _infinitelyRecursingCount
Definition SR.cs:16
static void Exit(object obj)
static void Enter(object obj)

References System.SR._currentlyLoading, System.SR._infinitelyRecursingCount, System.SR._lock, System.SR._resourceManagerInited, System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), System.Environment.FailFast(), System.Resources.ResourceManager.GetString(), System.key, System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(), and System.SR.s_resourceManager.

Referenced by System.SR.GetResourceString().