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
- SoapSchemaImporter.cs
- TraceContext.cs
- CornerRadius.cs
- EdmMember.cs
- Panel.cs
- SqlTypeConverter.cs
- ObjectStateFormatter.cs
- RequestQueue.cs
- ConfigurationValue.cs
- RuntimeConfig.cs
- WebPartExportVerb.cs
- PropertyStore.cs
- RelOps.cs
- CellTreeNode.cs
- ApplicationServicesHostFactory.cs
- ReachVisualSerializer.cs
- DeclaredTypeElementCollection.cs
- RotateTransform3D.cs
- HtmlButton.cs
- Filter.cs
- BufferAllocator.cs
- Label.cs
- RoutedPropertyChangedEventArgs.cs
- FixUpCollection.cs
- _BaseOverlappedAsyncResult.cs
- SystemBrushes.cs
- SoapReflectionImporter.cs
- Size.cs
- TextSpanModifier.cs
- WebPartPersonalization.cs
- FixedSOMGroup.cs
- WmlTextViewAdapter.cs
- Stackframe.cs
- ShapeTypeface.cs
- TextProperties.cs
- MarkupWriter.cs
- XmlCharCheckingWriter.cs
- ClientTargetSection.cs
- FileUpload.cs
- BindingCollection.cs
- ExceptionHelpers.cs
- DateTimeConverter.cs
- UrlAuthFailedErrorFormatter.cs
- PackageDigitalSignatureManager.cs
- ThreadStaticAttribute.cs
- linebase.cs
- SharedUtils.cs
- ConstNode.cs
- SiteMapNodeCollection.cs
- HttpProfileBase.cs
- Normalization.cs
- Cloud.cs
- WeakReferenceList.cs
- FloaterBaseParagraph.cs
- SynchronizedPool.cs
- LifetimeServices.cs
- DataGridViewCheckBoxCell.cs
- IsolatedStoragePermission.cs
- ComplexLine.cs
- XmlValidatingReader.cs
- Point3D.cs
- Repeater.cs
- SynchronizedInputAdaptor.cs
- HandlerWithFactory.cs
- ConstructorArgumentAttribute.cs
- TrackingAnnotationCollection.cs
- ColumnMapTranslator.cs
- EventInfo.cs
- HostedBindingBehavior.cs
- IgnoreFlushAndCloseStream.cs
- ServiceProviders.cs
- SetStoryboardSpeedRatio.cs
- WebControlsSection.cs
- FileStream.cs
- KeyValueConfigurationCollection.cs
- Brush.cs
- TokenCreationException.cs
- DataBinder.cs
- WebPartEditorCancelVerb.cs
- ItemChangedEventArgs.cs
- Fonts.cs
- Transform3DCollection.cs
- GridViewColumn.cs
- DataKeyCollection.cs
- FrugalMap.cs
- ProgressBarRenderer.cs
- SolidColorBrush.cs
- RadialGradientBrush.cs
- FlowLayoutPanel.cs
- AuthenticationManager.cs
- AppDomainShutdownMonitor.cs
- Profiler.cs
- DbConnectionPool.cs
- BindingValueChangedEventArgs.cs
- GenericsNotImplementedException.cs
- mongolianshape.cs
- GeometryGroup.cs
- Transform.cs
- MetadataSerializer.cs
- OracleRowUpdatingEventArgs.cs