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
48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
//------------------------------------------------------------------------------
|
|
// <copyright file="DeploymentSectionCache.cs" company="Microsoft">
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// </copyright>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace System.Web.UI {
|
|
using System;
|
|
using System.Configuration;
|
|
using System.Security;
|
|
using System.Security.Permissions;
|
|
using System.Web.Configuration;
|
|
|
|
// DeploymentSection can only be defined in machine.config, so it is safe to cache statically in the application
|
|
internal sealed class DeploymentSectionCache : IDeploymentSection {
|
|
private static readonly DeploymentSectionCache _instance = new DeploymentSectionCache();
|
|
// Value is cached statically, because DeploymentSectionCache is a Singleton.
|
|
private bool? _retail;
|
|
|
|
private DeploymentSectionCache() {
|
|
}
|
|
|
|
public static DeploymentSectionCache Instance {
|
|
get {
|
|
return _instance;
|
|
}
|
|
}
|
|
|
|
public bool Retail {
|
|
get {
|
|
if (_retail == null) {
|
|
_retail = GetRetailFromConfig();
|
|
}
|
|
return _retail.Value;
|
|
}
|
|
}
|
|
|
|
[
|
|
ConfigurationPermission(SecurityAction.Assert, Unrestricted = true),
|
|
SecuritySafeCritical()
|
|
]
|
|
private static bool GetRetailFromConfig() {
|
|
DeploymentSection section = (DeploymentSection)WebConfigurationManager.GetSection("system.web/deployment");
|
|
return section.Retail;
|
|
}
|
|
}
|
|
}
|