mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
// <copyright>
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace System.ServiceModel.Activation.Configuration
|
|
{
|
|
using System.Collections.Specialized;
|
|
using System.Configuration;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Runtime;
|
|
|
|
internal static class AppSettings
|
|
{
|
|
private const string UseClassicReadEntityBodyModeString = "wcf:serviceHostingEnvironment:useClassicReadEntityBodyMode";
|
|
private static bool useClassicReadEntityBodyMode = false;
|
|
|
|
private static volatile bool settingsInitalized = false;
|
|
private static object appSettingsLock = new object();
|
|
|
|
internal static bool UseClassicReadEntityMode
|
|
{
|
|
get
|
|
{
|
|
EnsureSettingsLoaded();
|
|
return useClassicReadEntityBodyMode;
|
|
}
|
|
}
|
|
|
|
[SuppressMessage(FxCop.Category.ReliabilityBasic, "Reliability104:CaughtAndHandledExceptionsRule",
|
|
Justification = "Handle the configuration exceptions here to avoid regressions on customer's existing scenarios")]
|
|
private static void EnsureSettingsLoaded()
|
|
{
|
|
if (!settingsInitalized)
|
|
{
|
|
lock (appSettingsLock)
|
|
{
|
|
if (!settingsInitalized)
|
|
{
|
|
NameValueCollection appSettingsSection = null;
|
|
try
|
|
{
|
|
appSettingsSection = ConfigurationManager.AppSettings;
|
|
}
|
|
catch (ConfigurationErrorsException)
|
|
{
|
|
}
|
|
finally
|
|
{
|
|
if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[UseClassicReadEntityBodyModeString], out useClassicReadEntityBodyMode))
|
|
{
|
|
useClassicReadEntityBodyMode = false;
|
|
}
|
|
|
|
settingsInitalized = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|