Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / ui / DeploymentSectionCache.cs / 1 / DeploymentSectionCache.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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), SecurityCritical(), SecurityTreatAsSafe(), ] private static bool GetRetailFromConfig() { DeploymentSection section = (DeploymentSection)WebConfigurationManager.GetSection("system.web/deployment"); return section.Retail; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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), SecurityCritical(), SecurityTreatAsSafe(), ] private static bool GetRetailFromConfig() { DeploymentSection section = (DeploymentSection)WebConfigurationManager.GetSection("system.web/deployment"); return section.Retail; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaChoice.cs
- CodeExpressionCollection.cs
- FrameworkContextData.cs
- WorkflowTimerService.cs
- FactoryId.cs
- Boolean.cs
- Win32Native.cs
- TypeSystemHelpers.cs
- LabelAutomationPeer.cs
- ProcessHostFactoryHelper.cs
- Dispatcher.cs
- NonParentingControl.cs
- Parser.cs
- ComplexTypeEmitter.cs
- LongMinMaxAggregationOperator.cs
- MonikerUtility.cs
- DomainLiteralReader.cs
- CopyEncoder.cs
- PrivilegedConfigurationManager.cs
- WrapPanel.cs
- DiagnosticTrace.cs
- RichTextBoxDesigner.cs
- TypeContext.cs
- DesignerTextBoxAdapter.cs
- CriticalHandle.cs
- IPipelineRuntime.cs
- X509CertificateValidator.cs
- XmlEventCache.cs
- XmlSchemaSimpleTypeList.cs
- StylusShape.cs
- SafeEventHandle.cs
- FixedTextSelectionProcessor.cs
- HierarchicalDataBoundControl.cs
- SystemIcmpV4Statistics.cs
- RsaSecurityToken.cs
- SafeRightsManagementHandle.cs
- TextServicesDisplayAttributePropertyRanges.cs
- TextShapeableCharacters.cs
- Literal.cs
- WindowsTokenRoleProvider.cs
- DNS.cs
- Pointer.cs
- ProfileGroupSettingsCollection.cs
- SetterBase.cs
- PageEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- Guid.cs
- MissingManifestResourceException.cs
- EntityDataSourceDesignerHelper.cs
- XPathDocumentIterator.cs
- TreeViewImageKeyConverter.cs
- TrustManager.cs
- Html32TextWriter.cs
- ClickablePoint.cs
- SqlServices.cs
- Hashtable.cs
- IISMapPath.cs
- StringUtil.cs
- _SecureChannel.cs
- PropertyStore.cs
- TimeManager.cs
- BamlVersionHeader.cs
- FastPropertyAccessor.cs
- UrlPath.cs
- ContractCodeDomInfo.cs
- Privilege.cs
- XmlNodeReader.cs
- MediaContext.cs
- ErrorProvider.cs
- UnionCqlBlock.cs
- EntityDataSourceSelectedEventArgs.cs
- AlternationConverter.cs
- CriticalFinalizerObject.cs
- PropertyItem.cs
- UshortList2.cs
- MessageDecoder.cs
- DataGridViewControlCollection.cs
- HandleCollector.cs
- SQLChars.cs
- CommandPlan.cs
- SqlSupersetValidator.cs
- CompilerLocalReference.cs
- AsyncSerializedWorker.cs
- RadioButton.cs
- CustomAttribute.cs
- StorageSetMapping.cs
- Process.cs
- NativeActivityTransactionContext.cs
- SingleStorage.cs
- Column.cs
- Rect3D.cs
- CompilationLock.cs
- Rect3DConverter.cs
- RSAPKCS1SignatureDeformatter.cs
- XmlValueConverter.cs
- XamlTreeBuilder.cs
- DebugView.cs
- ParallelEnumerableWrapper.cs
- MediaContext.cs