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
- ContractAdapter.cs
- IndentedWriter.cs
- ButtonBaseAdapter.cs
- FileDialog_Vista.cs
- DbInsertCommandTree.cs
- Attributes.cs
- DrawingContextDrawingContextWalker.cs
- XmlWriterSettings.cs
- FlatButtonAppearance.cs
- ExceptionHandlers.cs
- EnumType.cs
- ObjectRef.cs
- AnnotationService.cs
- MobileControlsSectionHelper.cs
- AsymmetricAlgorithm.cs
- WebServiceErrorEvent.cs
- fixedPageContentExtractor.cs
- ColorConverter.cs
- AutomationPatternInfo.cs
- Win32Exception.cs
- ControlPersister.cs
- ArglessEventHandlerProxy.cs
- RegexWriter.cs
- DisplayInformation.cs
- ObfuscationAttribute.cs
- XPathArrayIterator.cs
- WeakEventManager.cs
- connectionpool.cs
- HashAlgorithm.cs
- HtmlSelect.cs
- FontFamily.cs
- ProtectedProviderSettings.cs
- FlowDocumentReader.cs
- GraphicsPath.cs
- CanExecuteRoutedEventArgs.cs
- DiagnosticsConfigurationHandler.cs
- StackOverflowException.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ConfigurationSettings.cs
- Facet.cs
- XamlToRtfParser.cs
- XmlDocument.cs
- XmlTextReader.cs
- UnmanagedMarshal.cs
- InputLanguageProfileNotifySink.cs
- PageRouteHandler.cs
- ArrayExtension.cs
- TdsParserHelperClasses.cs
- Style.cs
- DependencySource.cs
- HttpListenerException.cs
- Function.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- CodeIdentifiers.cs
- TemplatedMailWebEventProvider.cs
- MsdtcClusterUtils.cs
- FixedHyperLink.cs
- EditorZone.cs
- ReflectionUtil.cs
- PageHandlerFactory.cs
- NewArrayExpression.cs
- Journaling.cs
- BindingOperations.cs
- JavaScriptObjectDeserializer.cs
- ReadWriteObjectLock.cs
- TableLayoutColumnStyleCollection.cs
- GridViewPageEventArgs.cs
- SoapProtocolImporter.cs
- DES.cs
- Padding.cs
- RuleRef.cs
- WindowsTokenRoleProvider.cs
- PixelFormats.cs
- RootBrowserWindow.cs
- AsymmetricKeyExchangeDeformatter.cs
- WindowsListView.cs
- WorkflowCommandExtensionItem.cs
- FieldMetadata.cs
- Brushes.cs
- TextSelectionHelper.cs
- FixUp.cs
- CallbackValidatorAttribute.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- Tool.cs
- SoapServerMethod.cs
- ReflectionPermission.cs
- WebServiceReceive.cs
- GenericAuthenticationEventArgs.cs
- ObjectItemCollection.cs
- DefaultParameterValueAttribute.cs
- WebSysDefaultValueAttribute.cs
- GraphicsState.cs
- AxHost.cs
- Avt.cs
- ComPlusDiagnosticTraceSchemas.cs
- ProfileEventArgs.cs
- RenderData.cs
- unsafeIndexingFilterStream.cs
- indexingfiltermarshaler.cs
- StrongName.cs