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
- ScriptControlManager.cs
- ToolStripPanelRow.cs
- SoapObjectInfo.cs
- unsafenativemethodsother.cs
- Walker.cs
- PathSegment.cs
- UnsupportedPolicyOptionsException.cs
- BitmapDownload.cs
- PrinterUnitConvert.cs
- XPathDocument.cs
- CacheSection.cs
- ListViewCancelEventArgs.cs
- AndCondition.cs
- DataGridPageChangedEventArgs.cs
- ConnectionsZone.cs
- Timer.cs
- ProcessThread.cs
- CfgSemanticTag.cs
- CodeAssignStatement.cs
- MultiSelectRootGridEntry.cs
- ColumnResizeAdorner.cs
- ViewStateException.cs
- UnsafeNativeMethods.cs
- WebPartEditorOkVerb.cs
- CacheVirtualItemsEvent.cs
- AutoScrollExpandMessageFilter.cs
- MemberDescriptor.cs
- SpeakCompletedEventArgs.cs
- MenuItemStyle.cs
- DocumentDesigner.cs
- TextServicesProperty.cs
- ComponentEditorForm.cs
- CssStyleCollection.cs
- SelectorItemAutomationPeer.cs
- SkipStoryboardToFill.cs
- BindingExpression.cs
- NativeWindow.cs
- DataServiceClientException.cs
- PolygonHotSpot.cs
- SelectionRangeConverter.cs
- RouteParser.cs
- DataGridHeaderBorder.cs
- Container.cs
- NamedObject.cs
- ReturnType.cs
- FocusWithinProperty.cs
- DefaultBindingPropertyAttribute.cs
- Stackframe.cs
- PerformanceCounterPermissionEntry.cs
- PrintDialog.cs
- WorkflowTimerService.cs
- BinHexEncoder.cs
- StyleSheetComponentEditor.cs
- ArraySortHelper.cs
- SchemaEntity.cs
- XmlSchemaIdentityConstraint.cs
- UrlPath.cs
- PointConverter.cs
- BinaryExpression.cs
- UrlSyndicationContent.cs
- DelegateBodyWriter.cs
- NameValueCollection.cs
- DataGridViewAddColumnDialog.cs
- TypefaceMap.cs
- TextInfo.cs
- DatatypeImplementation.cs
- ExpressionPrefixAttribute.cs
- EasingKeyFrames.cs
- BuildProvidersCompiler.cs
- ListBase.cs
- RTLAwareMessageBox.cs
- UniqueEventHelper.cs
- AsyncParams.cs
- FlowLayoutPanel.cs
- UpdatableWrapper.cs
- SystemIPGlobalProperties.cs
- UpdatePanelTrigger.cs
- ListComponentEditor.cs
- GroupItemAutomationPeer.cs
- SourceElementsCollection.cs
- BitmapEffectInputData.cs
- BitConverter.cs
- MiniMapControl.xaml.cs
- WindowVisualStateTracker.cs
- DataGridRowHeaderAutomationPeer.cs
- DataControlImageButton.cs
- NotifyIcon.cs
- SHA512Managed.cs
- KeySpline.cs
- Calendar.cs
- XPathAncestorQuery.cs
- XslAst.cs
- DebugView.cs
- DetailsViewPagerRow.cs
- CriticalExceptions.cs
- DockProviderWrapper.cs
- InvalidDataException.cs
- ToolStripMenuItem.cs
- HtmlCommandAdapter.cs
- ScopedMessagePartSpecification.cs