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
- ErrorRuntimeConfig.cs
- DockPatternIdentifiers.cs
- StringSorter.cs
- ToolStripManager.cs
- GenericWebPart.cs
- StrongTypingException.cs
- Metadata.cs
- DataGridViewRowHeaderCell.cs
- WindowsListViewSubItem.cs
- DetailsViewUpdatedEventArgs.cs
- SafeEventHandle.cs
- BaseTreeIterator.cs
- NavigationProperty.cs
- Html32TextWriter.cs
- ChildrenQuery.cs
- AsyncPostBackErrorEventArgs.cs
- WebPartMenu.cs
- CultureInfo.cs
- DefaultValidator.cs
- PartDesigner.cs
- SizeChangedEventArgs.cs
- BitmapMetadata.cs
- ISO2022Encoding.cs
- RootCodeDomSerializer.cs
- EntityKeyElement.cs
- HuffModule.cs
- FileVersionInfo.cs
- BindingContext.cs
- ListenerElementsCollection.cs
- DeviceContext.cs
- Wizard.cs
- HttpHandlerAction.cs
- EllipseGeometry.cs
- Timeline.cs
- HtmlAnchor.cs
- NegotiateStream.cs
- UiaCoreProviderApi.cs
- Viewport2DVisual3D.cs
- ECDiffieHellmanCngPublicKey.cs
- IntegerValidatorAttribute.cs
- DefaultBinder.cs
- TreeViewBindingsEditor.cs
- BoundField.cs
- SurrogateChar.cs
- SafeEventLogWriteHandle.cs
- ResourceDescriptionAttribute.cs
- ZoneIdentityPermission.cs
- VerticalAlignConverter.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- CalendarDesigner.cs
- UpdateManifestForBrowserApplication.cs
- WebPartHeaderCloseVerb.cs
- CollectionViewGroupInternal.cs
- DomNameTable.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- CustomMenuItemCollection.cs
- OrthographicCamera.cs
- PenContexts.cs
- ElementNotAvailableException.cs
- Menu.cs
- AppDomainFactory.cs
- DataSourceConverter.cs
- HostProtectionException.cs
- Translator.cs
- BehaviorEditorPart.cs
- SignedXml.cs
- LocalizeDesigner.cs
- EventlogProvider.cs
- XPathBinder.cs
- SqlAggregateChecker.cs
- SqlDataSourceFilteringEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- BinaryCommonClasses.cs
- MetadataSource.cs
- GraphicsPathIterator.cs
- ObjectViewFactory.cs
- RegionIterator.cs
- CharEnumerator.cs
- InputLanguageEventArgs.cs
- OrderedDictionaryStateHelper.cs
- OdbcPermission.cs
- DesignerVerb.cs
- BaseCodeDomTreeGenerator.cs
- MessageQueueCriteria.cs
- SignatureDescription.cs
- SocketAddress.cs
- DocumentApplicationJournalEntry.cs
- wgx_exports.cs
- Tool.cs
- HttpRequest.cs
- CfgParser.cs
- CodeCompiler.cs
- PrivateFontCollection.cs
- AuthenticationModuleElement.cs
- TdsRecordBufferSetter.cs
- ScrollProperties.cs
- ServiceConfigurationTraceRecord.cs
- DataGridViewTopLeftHeaderCell.cs
- ExclusiveTcpTransportManager.cs
- NullableBoolConverter.cs