Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / DeploymentSectionCache.cs / 1305376 / 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), SecuritySafeCritical() ] 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
- FilteredAttributeCollection.cs
- MSHTMLHost.cs
- StringBuilder.cs
- SQLMoney.cs
- UITypeEditor.cs
- PropertyInformation.cs
- TraceHwndHost.cs
- XmlToDatasetMap.cs
- MediaPlayer.cs
- EntitySqlQueryBuilder.cs
- ConnectionInterfaceCollection.cs
- Stacktrace.cs
- LinearKeyFrames.cs
- RowBinding.cs
- shaperfactory.cs
- XslCompiledTransform.cs
- MouseEvent.cs
- TextEditorThreadLocalStore.cs
- LocatorPartList.cs
- RC2CryptoServiceProvider.cs
- GPPOINTF.cs
- SendMessageRecord.cs
- baseshape.cs
- SizeFConverter.cs
- SecurityTokenTypes.cs
- Attribute.cs
- EditorBrowsableAttribute.cs
- Expander.cs
- IMembershipProvider.cs
- __Filters.cs
- XPathParser.cs
- MediaTimeline.cs
- FlowDocumentReader.cs
- ProfileGroupSettings.cs
- Window.cs
- VisualCollection.cs
- TypefaceMap.cs
- EmptyReadOnlyDictionaryInternal.cs
- VirtualPath.cs
- ProtocolImporter.cs
- ProvidersHelper.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- Codec.cs
- EntitySqlQueryCacheKey.cs
- LinkButton.cs
- CryptoConfig.cs
- JournalEntryStack.cs
- InteropAutomationProvider.cs
- PLINQETWProvider.cs
- ContentTypeSettingClientMessageFormatter.cs
- Propagator.ExtentPlaceholderCreator.cs
- ContainerVisual.cs
- InvalidComObjectException.cs
- _SpnDictionary.cs
- Misc.cs
- MutexSecurity.cs
- ZoneButton.cs
- PersonalizationAdministration.cs
- ConstraintCollection.cs
- HasCopySemanticsAttribute.cs
- BindingManagerDataErrorEventArgs.cs
- AccessControlList.cs
- User.cs
- TimeoutConverter.cs
- DefaultTextStore.cs
- InvalidPipelineStoreException.cs
- HashJoinQueryOperatorEnumerator.cs
- SpinWait.cs
- OracleConnectionString.cs
- SchemaElementLookUpTable.cs
- DataGridParentRows.cs
- PasswordBoxAutomationPeer.cs
- DynamicResourceExtensionConverter.cs
- XamlGridLengthSerializer.cs
- Console.cs
- AccessDataSourceWizardForm.cs
- DateTime.cs
- OdbcErrorCollection.cs
- ServiceObjectContainer.cs
- RemotingConfiguration.cs
- AsyncOperation.cs
- MulticastNotSupportedException.cs
- XhtmlBasicFormAdapter.cs
- HttpValueCollection.cs
- StdValidatorsAndConverters.cs
- XmlSchemaInclude.cs
- FileDialogCustomPlacesCollection.cs
- TaskResultSetter.cs
- Matrix3D.cs
- HttpHeaderCollection.cs
- FloatSumAggregationOperator.cs
- InputLanguageManager.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- CalendarDateRange.cs
- AppDomainProtocolHandler.cs
- FtpRequestCacheValidator.cs
- RadioButtonBaseAdapter.cs
- DirectoryGroupQuery.cs
- RsaSecurityKey.cs
- HorizontalAlignConverter.cs