Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@users.noreply.github.com>2017-04-24 11:20:20 +0300
committerMarek Safar <marek.safar@gmail.com>2017-04-24 11:20:20 +0300
commitcfeac85100c3230a8913b77ae4df9f6ed6dd30b9 (patch)
treedc18c962406bb5a43bad008971b9d4ef8f0aab7a /mcs/class/referencesource
parent1debf3934120547b3003c0ec4ec90bae4b08ee13 (diff)
[corlib] Use AppContextSwitches implementation from RS. Fixes #54448 (#4682)
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs6
-rw-r--r--mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs6
2 files changed, 6 insertions, 6 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
index 2dbd155f782..55373b7564e 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
@@ -79,10 +79,8 @@ namespace System
{
if (s_defaultsInitialized == false)
{
-#if !MONO
// populate the AppContext with the default set of values
AppContextDefaultValues.PopulateDefaultValues();
-#endif
s_defaultsInitialized = true;
}
}
@@ -142,7 +140,6 @@ namespace System
{
return true;
}
-#if !MONO
// 3. The switch has a valid value, but we need to check for overrides.
// Regardless of whether or not the switch has an override, we need to update the value to reflect
// the fact that we checked for overrides.
@@ -152,7 +149,6 @@ namespace System
// we found an override!
isEnabled = overrideValue;
}
-#endif
// Update the switch in the dictionary to mark it as 'checked for override'
s_switchMap[switchName] = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue)
| SwitchValueState.HasLookedForOverride;
@@ -172,7 +168,6 @@ namespace System
// In this case, we want to capture the fact that we looked for a value and found nothing by adding
// an entry in the dictionary with the 'sentinel' value of 'SwitchValueState.UnknownValue'.
// Example: This will prevent us from trying to find overrides for values that we don't have in the dictionary
-#if !MONO
// 1. The value has an override specified.
bool overrideValue;
if (AppContextDefaultValues.TryGetSwitchOverride(switchName, out overrideValue))
@@ -185,7 +180,6 @@ namespace System
return true;
}
-#endif
// 2. The value does not have an override.
s_switchMap[switchName] = SwitchValueState.UnknownValue;
}
diff --git a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
index 8a4018b3983..432d81001aa 100644
--- a/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
+++ b/mcs/class/referencesource/mscorlib/system/AppContext/AppContextSwitches.cs
@@ -11,6 +11,11 @@ namespace System
internal static class AppContextSwitches
{
+#if MOBILE
+ public static readonly bool ThrowExceptionIfDisposedCancellationTokenSource = false;
+ public static readonly bool SetActorAsReferenceWhenCopyingClaimsIdentity = false;
+ public static readonly bool NoAsyncCurrentCulture = false;
+#else
private static int _noAsyncCurrentCulture;
public static bool NoAsyncCurrentCulture
{
@@ -130,5 +135,6 @@ namespace System
switchValue = isSwitchEnabled ? 1 /*true*/ : -1 /*false*/;
return isSwitchEnabled;
}
+#endif
}
}