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
- DataGridAutoFormat.cs
- MarginCollapsingState.cs
- Adorner.cs
- StringArrayConverter.cs
- SecurityCapabilities.cs
- NativeMethods.cs
- ContentElement.cs
- PageParser.cs
- InvokerUtil.cs
- WindowsGraphics.cs
- xsdvalidator.cs
- BufferBuilder.cs
- TypedTableBaseExtensions.cs
- SettingsPropertyValue.cs
- StringResourceManager.cs
- AsyncOperation.cs
- ArraySegment.cs
- SimpleHandlerBuildProvider.cs
- Converter.cs
- WsatAdminException.cs
- SqlSelectStatement.cs
- streamingZipPartStream.cs
- EntityContainerEmitter.cs
- WorkflowIdleBehavior.cs
- _DigestClient.cs
- KeyedHashAlgorithm.cs
- XsdValidatingReader.cs
- VirtualDirectoryMapping.cs
- SinglePhaseEnlistment.cs
- Helpers.cs
- AppDomainManager.cs
- PageParserFilter.cs
- SocketInformation.cs
- FileStream.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- KeyValuePair.cs
- Debugger.cs
- SyndicationFeedFormatter.cs
- MD5CryptoServiceProvider.cs
- CompositeClientFormatter.cs
- Select.cs
- FilePrompt.cs
- propertyentry.cs
- Update.cs
- ObjectComplexPropertyMapping.cs
- WinEventWrap.cs
- MoveSizeWinEventHandler.cs
- ResourceDisplayNameAttribute.cs
- SafeRightsManagementPubHandle.cs
- PageFunction.cs
- _UriTypeConverter.cs
- TypeBuilder.cs
- WmlSelectionListAdapter.cs
- SqlCommandBuilder.cs
- followingquery.cs
- BooleanStorage.cs
- ToolStripRenderEventArgs.cs
- DbParameterHelper.cs
- CompleteWizardStep.cs
- DiagnosticsConfiguration.cs
- CngKeyBlobFormat.cs
- ButtonBaseDesigner.cs
- PersonalizablePropertyEntry.cs
- MessageDecoder.cs
- ConnectionPointCookie.cs
- MenuBase.cs
- ProfileModule.cs
- DispatcherEventArgs.cs
- DoubleAnimation.cs
- BaseEntityWrapper.cs
- ResourceDefaultValueAttribute.cs
- TextWriterEngine.cs
- LayoutUtils.cs
- SchemaImporterExtensionElement.cs
- SqlNotificationEventArgs.cs
- baseshape.cs
- StringExpressionSet.cs
- TextRenderingModeValidation.cs
- SessionStateModule.cs
- CallSiteBinder.cs
- Random.cs
- TdsRecordBufferSetter.cs
- ClassValidator.cs
- TextRange.cs
- TraceSource.cs
- ThreadAbortException.cs
- AttributeEmitter.cs
- RefreshEventArgs.cs
- DeleteMemberBinder.cs
- FontStyleConverter.cs
- EntitySet.cs
- SecureStringHasher.cs
- VariantWrapper.cs
- PrefixQName.cs
- PeerNameRecord.cs
- AncestorChangedEventArgs.cs
- InternalPolicyElement.cs
- SymmetricAlgorithm.cs
- RegexCaptureCollection.cs
- MethodBuilder.cs