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
- ForwardPositionQuery.cs
- ProfileSettingsCollection.cs
- EventProvider.cs
- ProfileGroupSettings.cs
- errorpatternmatcher.cs
- KnownTypesProvider.cs
- DynamicILGenerator.cs
- ContentElement.cs
- TypeConverters.cs
- PopupControlService.cs
- RecognizedWordUnit.cs
- unitconverter.cs
- ListBox.cs
- XmlDeclaration.cs
- SessionKeyExpiredException.cs
- xmlsaver.cs
- DataGridViewRowsAddedEventArgs.cs
- SByteConverter.cs
- SessionIDManager.cs
- HttpException.cs
- PropertyTabChangedEvent.cs
- IdnMapping.cs
- DBConnection.cs
- XmlDataSourceNodeDescriptor.cs
- PerfService.cs
- DataSourceControl.cs
- TypeBuilderInstantiation.cs
- IgnorePropertiesAttribute.cs
- BinaryUtilClasses.cs
- DBPropSet.cs
- TextEditorSpelling.cs
- AnnotationElement.cs
- DataSvcMapFile.cs
- DataColumnMapping.cs
- DomainLiteralReader.cs
- SignatureHelper.cs
- LinqDataSourceHelper.cs
- MissingFieldException.cs
- ServiceDescriptionSerializer.cs
- QilNode.cs
- TransformerTypeCollection.cs
- ConfigurationSectionGroup.cs
- StaticSiteMapProvider.cs
- SequenceDesigner.cs
- LinqDataSource.cs
- AbsoluteQuery.cs
- XmlSchemaComplexType.cs
- ErrorTableItemStyle.cs
- PixelFormats.cs
- PenThreadPool.cs
- SafeViewOfFileHandle.cs
- StateWorkerRequest.cs
- XmlReaderSettings.cs
- SchemaElementDecl.cs
- Stopwatch.cs
- TrackingProfileCache.cs
- FontNamesConverter.cs
- CompositionAdorner.cs
- diagnosticsswitches.cs
- Parser.cs
- Int32Collection.cs
- Cast.cs
- ImageListUtils.cs
- _ListenerResponseStream.cs
- HostingEnvironmentException.cs
- LoginDesignerUtil.cs
- PointAnimationUsingPath.cs
- ConfigurationStrings.cs
- WS2007FederationHttpBindingCollectionElement.cs
- SqlDependencyUtils.cs
- NullableBoolConverter.cs
- SQLDateTime.cs
- HtmlInputPassword.cs
- BamlCollectionHolder.cs
- MapPathBasedVirtualPathProvider.cs
- IsolatedStorageFilePermission.cs
- _AuthenticationState.cs
- GeometryDrawing.cs
- CompleteWizardStep.cs
- ConnectionStringsSection.cs
- LoginView.cs
- PlainXmlWriter.cs
- BinarySerializer.cs
- LoggedException.cs
- TypeSystem.cs
- IgnoreDataMemberAttribute.cs
- SByteStorage.cs
- mediaeventargs.cs
- ThousandthOfEmRealDoubles.cs
- ConditionalWeakTable.cs
- CompositeDuplexBindingElement.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- RequestCachePolicy.cs
- EllipseGeometry.cs
- BitmapSourceSafeMILHandle.cs
- ConfigurationManager.cs
- ExpressionBinding.cs
- DocumentAutomationPeer.cs
- Sequence.cs
- JsonWriter.cs