static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) { // When defining a new switch you should add it to the last known version. // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should defined your switch // like this: // if (version <= 40502) ... // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) switch (platformIdentifier) { case ".NETCore": case ".NETFramework": { if (version <= 40502) { AppContext.DefineSwitchDefault(SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(SwitchThrowExceptionIfDisposedCancellationTokenSource, true); } if (version <= 40601) { AppContext.DefineSwitchDefault(SwitchUseLegacyPathHandling, true); AppContext.DefineSwitchDefault(SwitchBlockLongPaths, true); AppContext.DefineSwitchDefault(SwitchSetActorAsReferenceWhenCopyingClaimsIdentity, true); } if (version <= 40602) { AppContext.DefineSwitchDefault(SwitchDoNotAddrOfCspParentWindowHandle, true); } if (version <= 40701) { AppContext.DefineSwitchDefault(SwitchIgnorePortablePDBsInStackTraces, true); } break; } case "WindowsPhone": case "WindowsPhoneApp": { if (version <= 80100) { AppContext.DefineSwitchDefault(SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(SwitchThrowExceptionIfDisposedCancellationTokenSource, true); AppContext.DefineSwitchDefault(SwitchUseLegacyPathHandling, true); AppContext.DefineSwitchDefault(SwitchBlockLongPaths, true); AppContext.DefineSwitchDefault(SwitchDoNotAddrOfCspParentWindowHandle, true); AppContext.DefineSwitchDefault(SwitchIgnorePortablePDBsInStackTraces, true); } break; } } // At this point we should read the overrides if any are defined PopulateOverrideValuesPartial(); }
private static void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) { if (!(platformIdentifier == ".NETCore") && !(platformIdentifier == ".NETFramework")) { if ((platformIdentifier == "WindowsPhone" || platformIdentifier == "WindowsPhoneApp") && version <= 80100) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchThrowExceptionIfDisposedCancellationTokenSource, true); } } else if (version <= 40502) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchThrowExceptionIfDisposedCancellationTokenSource, true); } AppContextDefaultValues.PopulateOverrideValuesPartial(); }
// Token: 0x0600020E RID: 526 RVA: 0x000056CC File Offset: 0x000038CC private static void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) { if (!(platformIdentifier == ".NETCore") && !(platformIdentifier == ".NETFramework")) { if (platformIdentifier == "WindowsPhone" || platformIdentifier == "WindowsPhoneApp") { if (version <= 80100) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchThrowExceptionIfDisposedCancellationTokenSource, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchUseLegacyPathHandling, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchBlockLongPaths, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchDoNotAddrOfCspParentWindowHandle, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchIgnorePortablePDBsInStackTraces, true); } } } else { if (version <= 40502) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchNoAsyncCurrentCulture, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchThrowExceptionIfDisposedCancellationTokenSource, true); } if (version <= 40601) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchUseLegacyPathHandling, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchBlockLongPaths, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchSetActorAsReferenceWhenCopyingClaimsIdentity, true); } if (version <= 40602) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchDoNotAddrOfCspParentWindowHandle, true); } if (version <= 40701) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchIgnorePortablePDBsInStackTraces, true); } if (version <= 40702) { AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchCryptographyUseLegacyFipsThrow, true); AppContext.DefineSwitchDefault(AppContextDefaultValues.SwitchDoNotMarshalOutByrefSafeArrayOnInvoke, true); } } AppContextDefaultValues.PopulateOverrideValuesPartial(); }
static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) { // When defining a new switch you should add it to the last known version. // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should defined your switch // like this: // if (version <= 40502) ... // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) switch (platformIdentifier) { case ".NETCore": case ".NETFramework": { if (version <= 40502) { AppContext.DefineSwitchDefault(SwitchNoAsyncCurrentCulture, true); } break; } case "WindowsPhone": case "WindowsPhoneApp": { if (version <= 80100) { AppContext.DefineSwitchDefault(SwitchNoAsyncCurrentCulture, true); } break; } } // At this point we should read the overrides if any are defined PopulateOverrideValuesPartial(); }