Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TemplateBindingExtensionConverter.cs
- StringFunctions.cs
- DictionaryContent.cs
- GlyphsSerializer.cs
- SizeConverter.cs
- APCustomTypeDescriptor.cs
- RTTypeWrapper.cs
- TableColumn.cs
- SafeThemeHandle.cs
- TrustLevelCollection.cs
- DSASignatureDeformatter.cs
- PasswordTextContainer.cs
- unitconverter.cs
- ArraySegment.cs
- CommonDialog.cs
- IdleTimeoutMonitor.cs
- Version.cs
- SecurityDescriptor.cs
- FieldNameLookup.cs
- CharEnumerator.cs
- HexParser.cs
- MapPathBasedVirtualPathProvider.cs
- BaseDataList.cs
- TileModeValidation.cs
- WebPartManager.cs
- KeyConverter.cs
- SerializationInfoEnumerator.cs
- Cursors.cs
- DataFormats.cs
- ApplicationHost.cs
- NamespaceDecl.cs
- JournalEntryStack.cs
- InterleavedZipPartStream.cs
- TextRangeSerialization.cs
- AxImporter.cs
- DetailsViewRow.cs
- NavigateEvent.cs
- TimelineClockCollection.cs
- ScrollChrome.cs
- PingReply.cs
- ProviderCollection.cs
- XmlSchemaSequence.cs
- AutomationElementCollection.cs
- MemberAccessException.cs
- DataControlImageButton.cs
- CombinedGeometry.cs
- ContentControl.cs
- OutputCacheSettings.cs
- SoapExtensionReflector.cs
- TransactionOptions.cs
- ICspAsymmetricAlgorithm.cs
- entityreference_tresulttype.cs
- KeyValuePairs.cs
- CustomCredentialPolicy.cs
- EllipseGeometry.cs
- ViewGenResults.cs
- RectangleF.cs
- Rotation3DKeyFrameCollection.cs
- RoleService.cs
- SqlConnectionFactory.cs
- AutomationProperty.cs
- PartBasedPackageProperties.cs
- CodeDelegateInvokeExpression.cs
- AppDomainManager.cs
- ResumeStoryboard.cs
- ResourceReader.cs
- MessageFormatterConverter.cs
- EventLogWatcher.cs
- ObjectSpanRewriter.cs
- FrugalList.cs
- DynamicValidator.cs
- RootCodeDomSerializer.cs
- HttpChannelFactory.cs
- HashHelper.cs
- VisualTreeUtils.cs
- GridViewCommandEventArgs.cs
- Rect3DConverter.cs
- PartBasedPackageProperties.cs
- MarshalDirectiveException.cs
- LineVisual.cs
- TextEditorLists.cs
- Attributes.cs
- CompensationDesigner.cs
- UrlSyndicationContent.cs
- OleDbSchemaGuid.cs
- HttpContextServiceHost.cs
- DrawingVisual.cs
- SettingsAttributes.cs
- StreamGeometry.cs
- SqlDataSourceRefreshSchemaForm.cs
- StylusEventArgs.cs
- ReflectEventDescriptor.cs
- StreamSecurityUpgradeAcceptor.cs
- SystemTcpStatistics.cs
- XmlReader.cs
- TypographyProperties.cs
- ComponentResourceKeyConverter.cs
- ConversionContext.cs
- UnsafeNativeMethods.cs
- MemoryRecordBuffer.cs