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
- CookieHandler.cs
- DataListItemCollection.cs
- CheckoutException.cs
- ControlBindingsCollection.cs
- wgx_commands.cs
- SerializeAbsoluteContext.cs
- HttpCacheVaryByContentEncodings.cs
- EdmProperty.cs
- PropertyEmitter.cs
- AuthenticationConfig.cs
- ObjectMemberMapping.cs
- ScriptReference.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- FilteredDataSetHelper.cs
- InlineObject.cs
- DataGridTextBox.cs
- Comparer.cs
- AssociationTypeEmitter.cs
- PointLight.cs
- AnimationTimeline.cs
- ImageClickEventArgs.cs
- LinqDataSourceContextEventArgs.cs
- ComplexBindingPropertiesAttribute.cs
- ObjectSecurityT.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- NameTable.cs
- ErrorWebPart.cs
- GlyphRun.cs
- TextPattern.cs
- RelationshipConverter.cs
- DataGridColumnCollection.cs
- DBDataPermissionAttribute.cs
- ClientCultureInfo.cs
- RSAPKCS1KeyExchangeFormatter.cs
- MatrixCamera.cs
- PermissionRequestEvidence.cs
- InputLanguageCollection.cs
- ClosableStream.cs
- GridItemPatternIdentifiers.cs
- HtmlButton.cs
- SafeCoTaskMem.cs
- configsystem.cs
- AccessDataSource.cs
- ArithmeticLiteral.cs
- MenuItemStyle.cs
- Stack.cs
- BooleanConverter.cs
- CheckoutException.cs
- SqlReorderer.cs
- IIS7UserPrincipal.cs
- ScriptReferenceEventArgs.cs
- DataTablePropertyDescriptor.cs
- DeviceOverridableAttribute.cs
- ConvertersCollection.cs
- WindowsFormsHostAutomationPeer.cs
- PropertyChangeTracker.cs
- PropertyGrid.cs
- DataQuery.cs
- ItemsChangedEventArgs.cs
- DependencyPropertyValueSerializer.cs
- DesignerAutoFormatCollection.cs
- XamlDebuggerXmlReader.cs
- SafeProcessHandle.cs
- BamlRecordReader.cs
- DictionaryBase.cs
- ValueOfAction.cs
- WebScriptMetadataFormatter.cs
- XmlImplementation.cs
- ReferentialConstraint.cs
- XmlTextWriter.cs
- PropertyInformation.cs
- KeyProperty.cs
- StylusPointPropertyInfoDefaults.cs
- BindingEditor.xaml.cs
- TextDecorationCollectionConverter.cs
- HTMLTagNameToTypeMapper.cs
- UIElement3DAutomationPeer.cs
- CharacterMetrics.cs
- TypeAccessException.cs
- MatrixCamera.cs
- TcpClientCredentialType.cs
- UriParserTemplates.cs
- PipelineDeploymentState.cs
- SafeFileMappingHandle.cs
- PublisherIdentityPermission.cs
- Helpers.cs
- printdlgexmarshaler.cs
- ReachPageContentSerializerAsync.cs
- GroupDescription.cs
- Brush.cs
- CacheForPrimitiveTypes.cs
- BookmarkResumptionRecord.cs
- _NtlmClient.cs
- BatchServiceHost.cs
- StickyNoteAnnotations.cs
- ClockController.cs
- SiteMapHierarchicalDataSourceView.cs
- FixedTextPointer.cs
- ListViewContainer.cs
- FlowPosition.cs