Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- RpcResponse.cs
- ColumnMapProcessor.cs
- ConfigurationLockCollection.cs
- LogFlushAsyncResult.cs
- glyphs.cs
- LocalValueEnumerator.cs
- ActivationArguments.cs
- Root.cs
- SqlCachedBuffer.cs
- CreateRefExpr.cs
- DTCTransactionManager.cs
- TypeReference.cs
- LambdaCompiler.Generated.cs
- sqlinternaltransaction.cs
- CryptoProvider.cs
- PropertyFilterAttribute.cs
- WmlTextBoxAdapter.cs
- Axis.cs
- Operator.cs
- OutputChannel.cs
- ClientSession.cs
- CryptoConfig.cs
- QueryReaderSettings.cs
- RadioButtonAutomationPeer.cs
- StandardOleMarshalObject.cs
- ConfigXmlSignificantWhitespace.cs
- MenuItemCollection.cs
- SoapEnumAttribute.cs
- TreeBuilderXamlTranslator.cs
- VectorCollectionValueSerializer.cs
- XslAstAnalyzer.cs
- CodeTypeParameter.cs
- IApplicationTrustManager.cs
- StringValueSerializer.cs
- CachingHintValidation.cs
- SafeBitVector32.cs
- EntityCommand.cs
- SevenBitStream.cs
- ProcessInputEventArgs.cs
- ObjectPersistData.cs
- CategoryNameCollection.cs
- RepeaterItemCollection.cs
- TrackingStringDictionary.cs
- KeyManager.cs
- ContextMenuService.cs
- TabPageDesigner.cs
- SmtpReplyReader.cs
- GridEntryCollection.cs
- SchemaElement.cs
- Int64Storage.cs
- DateTimeConverter.cs
- RankException.cs
- StrokeNodeOperations.cs
- Converter.cs
- SwitchElementsCollection.cs
- SoapReflectionImporter.cs
- GrammarBuilderDictation.cs
- SqlException.cs
- QueryCacheManager.cs
- TextServicesDisplayAttribute.cs
- WebReferencesBuildProvider.cs
- RuleInfoComparer.cs
- ConfigurationPermission.cs
- MimeWriter.cs
- Vector3DKeyFrameCollection.cs
- DrawingContextWalker.cs
- ColorTranslator.cs
- LineMetrics.cs
- ExpressionConverter.cs
- ThreadStaticAttribute.cs
- WebHostedComPlusServiceHost.cs
- TargetInvocationException.cs
- XslUrlEditor.cs
- _ListenerResponseStream.cs
- NativeMethods.cs
- FontFamilyIdentifier.cs
- ViewLoader.cs
- SchemaType.cs
- WebPartVerb.cs
- DecimalAnimationUsingKeyFrames.cs
- PrimitiveType.cs
- MemberAccessException.cs
- HebrewNumber.cs
- WmlTextBoxAdapter.cs
- InstanceLockQueryResult.cs
- BamlRecords.cs
- ValidationSummary.cs
- LabelEditEvent.cs
- MultipleCopiesCollection.cs
- ChannelSinkStacks.cs
- UserControlBuildProvider.cs
- WebPermission.cs
- CodePageUtils.cs
- BridgeDataRecord.cs
- AxParameterData.cs
- TreeNodeStyleCollectionEditor.cs
- VirtualDirectoryMappingCollection.cs
- XmlElementCollection.cs
- ComplexObject.cs
- AssociationProvider.cs