Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeActivity.cs
- SHA256.cs
- ReferenceEqualityComparer.cs
- ReceiveErrorHandling.cs
- PeerOutputChannel.cs
- DashStyles.cs
- DataGridViewLinkColumn.cs
- SiteMembershipCondition.cs
- DataGridItemEventArgs.cs
- GenericWebPart.cs
- SqlBulkCopyColumnMapping.cs
- UnsafeNativeMethods.cs
- TimeSpanSecondsConverter.cs
- BoundConstants.cs
- CopyEncoder.cs
- XsltSettings.cs
- LoginUtil.cs
- UpDownBase.cs
- DesigntimeLicenseContextSerializer.cs
- MarkedHighlightComponent.cs
- BamlTreeNode.cs
- InlinedAggregationOperatorEnumerator.cs
- SafeSystemMetrics.cs
- Lease.cs
- DatagridviewDisplayedBandsData.cs
- OracleInfoMessageEventArgs.cs
- BitmapPalettes.cs
- XmlSchemaChoice.cs
- FontCollection.cs
- DeadCharTextComposition.cs
- SoapSchemaMember.cs
- ReadOnlyAttribute.cs
- PolyQuadraticBezierSegment.cs
- EntityDataSourceSelectedEventArgs.cs
- BigInt.cs
- _SecureChannel.cs
- ManagedIStream.cs
- XmlUtil.cs
- ActivityCodeDomReferenceService.cs
- DataRecordInternal.cs
- CommandLibraryHelper.cs
- HttpCachePolicyElement.cs
- DataGrid.cs
- sqlinternaltransaction.cs
- SqlGatherConsumedAliases.cs
- SimpleRecyclingCache.cs
- CompoundFileIOPermission.cs
- XmlnsCompatibleWithAttribute.cs
- _ConnectionGroup.cs
- XamlToRtfWriter.cs
- PagerSettings.cs
- DataControlLinkButton.cs
- ImageList.cs
- MessageEnumerator.cs
- SQLBinary.cs
- TextRenderer.cs
- bidPrivateBase.cs
- peersecurityelement.cs
- ComboBox.cs
- IEnumerable.cs
- ColorTranslator.cs
- PartialCachingControl.cs
- HttpConfigurationContext.cs
- XDRSchema.cs
- TextViewBase.cs
- TogglePattern.cs
- TextParentUndoUnit.cs
- ValidationErrorEventArgs.cs
- XmlUrlResolver.cs
- GetLastErrorDetailsRequest.cs
- ProcessModule.cs
- PackageStore.cs
- ContextTokenTypeConverter.cs
- SessionStateUtil.cs
- UIElementAutomationPeer.cs
- PointConverter.cs
- SqlGenericUtil.cs
- BindingMemberInfo.cs
- Point3DIndependentAnimationStorage.cs
- OrthographicCamera.cs
- SchemaAttDef.cs
- ConnectionPool.cs
- WizardPanel.cs
- FactoryGenerator.cs
- CompilerLocalReference.cs
- SqlExpander.cs
- Journal.cs
- Menu.cs
- DesignTimeTemplateParser.cs
- TemplateBuilder.cs
- IndentTextWriter.cs
- MarkupCompilePass2.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- RenderingEventArgs.cs
- ConfigurationManager.cs
- XamlWrapperReaders.cs
- XPathSelectionIterator.cs
- UInt64.cs
- HandoffBehavior.cs
- ServiceContractListItem.cs