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

◆ TryGetSwitch()

static bool System.AppContext.TryGetSwitch ( string switchName,
out bool isEnabled )
inlinestatic

Definition at line 74 of file AppContext.cs.

75 {
76 if (switchName == null)
77 {
78 throw new ArgumentNullException("switchName");
79 }
80 if (switchName.Length == 0)
81 {
82 throw new ArgumentException(SR.Argument_EmptyName, "switchName");
83 }
84 if (s_switches != null)
85 {
87 {
88 if (s_switches.TryGetValue(switchName, out isEnabled))
89 {
90 return true;
91 }
92 }
93 }
94 if (GetData(switchName) is string value && bool.TryParse(value, out isEnabled))
95 {
96 return true;
97 }
98 isEnabled = false;
99 return false;
100 }
static ? object GetData(string name)
Definition AppContext.cs:31
static Dictionary< string, bool > s_switches
Definition AppContext.cs:17

References System.SR.Argument_EmptyName, System.AppContext.GetData(), System.AppContext.s_switches, and System.value.

Referenced by System.AppContextConfigHelper.GetBooleanConfig(), System.AppContextConfigHelper.GetBooleanConfig(), System.LocalAppContextSwitches.GetCachedSwitchValueInternal(), System.LocalAppContextSwitches.GetSwitchValue(), Internal.Runtime.InteropServices.ComponentActivator.InitializeIsSupported(), Internal.Runtime.InteropServices.InMemoryAssemblyLoader.InitializeIsSupported(), System.Diagnostics.Tracing.EventSource.InitializeIsSupported(), System.AppDomain.IsCompatibilitySwitchSet(), System.Net.SocketProtocolSupportPal.IsIPv6Disabled(), System.Net.Http.RuntimeSettingParser.QueryRuntimeSettingSwitch(), and System.Runtime.Serialization.SerializationInfo.ThrowIfDeserializationInProgress().