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
- XPathDescendantIterator.cs
- EventSourceCreationData.cs
- RepeaterDataBoundAdapter.cs
- ToolboxBitmapAttribute.cs
- XmlRawWriter.cs
- InputScopeConverter.cs
- precedingsibling.cs
- TraceProvider.cs
- InputProcessorProfilesLoader.cs
- VersionedStream.cs
- MsmqSecureHashAlgorithm.cs
- QilTypeChecker.cs
- OracleConnectionString.cs
- PreservationFileReader.cs
- EntityDesignerDataSourceView.cs
- LayoutInformation.cs
- FontFamilyValueSerializer.cs
- HttpAsyncResult.cs
- GenericArgumentsUpdater.cs
- DrawingAttributesDefaultValueFactory.cs
- DocumentGridContextMenu.cs
- RouteItem.cs
- TextRunProperties.cs
- FlatButtonAppearance.cs
- Function.cs
- GatewayDefinition.cs
- ProfileSection.cs
- _NestedSingleAsyncResult.cs
- FixedHyperLink.cs
- LinqDataView.cs
- EntityContainerAssociationSetEnd.cs
- ListenerElementsCollection.cs
- ListBoxItem.cs
- Pts.cs
- ToolboxDataAttribute.cs
- HttpInputStream.cs
- ApplicationHost.cs
- ElementAction.cs
- CaseCqlBlock.cs
- SessionStateSection.cs
- StringArrayConverter.cs
- BasicHttpBindingElement.cs
- ApplicationGesture.cs
- DesignerEventService.cs
- MD5.cs
- PointConverter.cs
- InvariantComparer.cs
- CuspData.cs
- WebFormsRootDesigner.cs
- QilNode.cs
- StoreItemCollection.cs
- BrowserCapabilitiesCompiler.cs
- TransformerInfoCollection.cs
- ModifierKeysConverter.cs
- InputReferenceExpression.cs
- RoleManagerModule.cs
- RuntimeCompatibilityAttribute.cs
- Int32Storage.cs
- WorkflowHostingEndpoint.cs
- _RequestCacheProtocol.cs
- MessageBox.cs
- PeerNameResolver.cs
- Request.cs
- DataObjectFieldAttribute.cs
- ExceptionRoutedEventArgs.cs
- HotSpot.cs
- LingerOption.cs
- FollowerQueueCreator.cs
- UntypedNullExpression.cs
- DynamicRendererThreadManager.cs
- WindowsMenu.cs
- CollectionViewGroup.cs
- ExpressionBindings.cs
- RegexGroup.cs
- VideoDrawing.cs
- ErasingStroke.cs
- NativeRightsManagementAPIsStructures.cs
- Metafile.cs
- TextContainerChangedEventArgs.cs
- WebPartMenuStyle.cs
- HtmlShim.cs
- SBCSCodePageEncoding.cs
- DocumentPageView.cs
- DeclarativeCatalogPartDesigner.cs
- Blend.cs
- PowerEase.cs
- SqlStatistics.cs
- SortKey.cs
- WorkflowRuntimeElement.cs
- Psha1DerivedKeyGenerator.cs
- CompositeKey.cs
- PropertyEmitter.cs
- IntSecurity.cs
- XmlIlGenerator.cs
- GroupBox.cs
- Rect3D.cs
- HostedHttpRequestAsyncResult.cs
- PropertyItem.cs
- SQLDouble.cs
- CopyOfAction.cs