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
- UnitySerializationHolder.cs
- DataRecordObjectView.cs
- BaseCollection.cs
- Opcode.cs
- GridLength.cs
- UnsafeNativeMethods.cs
- ProfileEventArgs.cs
- EditorPartCollection.cs
- XmlSerializerFaultFormatter.cs
- AuthStoreRoleProvider.cs
- CacheAxisQuery.cs
- OneOfScalarConst.cs
- TextRangeEdit.cs
- NameValueSectionHandler.cs
- UnmanagedMemoryAccessor.cs
- MetadataPropertyvalue.cs
- ZipIOLocalFileDataDescriptor.cs
- OverflowException.cs
- OutputCacheProfile.cs
- ipaddressinformationcollection.cs
- Baml2006ReaderFrame.cs
- WebResponse.cs
- WorkerRequest.cs
- HtmlInputPassword.cs
- WebBrowserUriTypeConverter.cs
- PropertyFilterAttribute.cs
- WebServiceClientProxyGenerator.cs
- lengthconverter.cs
- LiteralTextContainerControlBuilder.cs
- RouteCollection.cs
- MetadataItemEmitter.cs
- SqlDuplicator.cs
- AxWrapperGen.cs
- ServiceModelExtensionElement.cs
- LayoutTableCell.cs
- AttachmentCollection.cs
- ConnectionPoint.cs
- ExpressionsCollectionConverter.cs
- XmlSchemaAppInfo.cs
- PolicyLevel.cs
- CommandLineParser.cs
- RpcResponse.cs
- TriggerCollection.cs
- OracleDataAdapter.cs
- _SingleItemRequestCache.cs
- UriTemplateCompoundPathSegment.cs
- PrivateFontCollection.cs
- ValidationError.cs
- Visual3D.cs
- ListBoxItemWrapperAutomationPeer.cs
- TiffBitmapEncoder.cs
- PackageDigitalSignatureManager.cs
- XmlCollation.cs
- Vector3DCollectionValueSerializer.cs
- HybridObjectCache.cs
- Int64AnimationUsingKeyFrames.cs
- CompleteWizardStep.cs
- CompiledQueryCacheEntry.cs
- CompositeControl.cs
- IisTraceWebEventProvider.cs
- _FixedSizeReader.cs
- RadioButtonDesigner.cs
- HtmlLink.cs
- HMACSHA384.cs
- DynamicRenderer.cs
- FilePrompt.cs
- mil_commands.cs
- Vector3DAnimationBase.cs
- SymDocumentType.cs
- Int64Storage.cs
- MissingManifestResourceException.cs
- XamlReader.cs
- WebPartZoneAutoFormat.cs
- DataTableMappingCollection.cs
- PartitionedDataSource.cs
- DataGridColumn.cs
- DataSourceHelper.cs
- UnsafeNativeMethods.cs
- ColorAnimationBase.cs
- SpecialFolderEnumConverter.cs
- Bitmap.cs
- DataGridViewColumn.cs
- IndexedString.cs
- ThemeableAttribute.cs
- NodeLabelEditEvent.cs
- XmlFormatExtensionAttribute.cs
- COM2EnumConverter.cs
- StorageEntitySetMapping.cs
- EventLogTraceListener.cs
- DelegateSerializationHolder.cs
- WebPartConnectionCollection.cs
- BaseDataBoundControl.cs
- CodeExpressionCollection.cs
- VerticalAlignConverter.cs
- PatternMatchRules.cs
- TimeStampChecker.cs
- validation.cs
- ApplicationException.cs
- Vector3D.cs
- HtmlSelect.cs