Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / ui / AppLevelCompilationSectionCache.cs / 1 / AppLevelCompilationSectionCache.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; // The compilation section can be defined below the application level, but ScriptManager only considers the // application-level debug setting. internal sealed class AppLevelCompilationSectionCache : ICompilationSection { private static readonly AppLevelCompilationSectionCache _instance = new AppLevelCompilationSectionCache(); // Value is cached statically, because AppLevelCompilationSectionCache is a Singleton. private bool? _debug; private AppLevelCompilationSectionCache() { } public static AppLevelCompilationSectionCache Instance { get { return _instance; } } public bool Debug { get { if (_debug == null) { _debug = GetDebugFromConfig(); } return _debug.Value; } } [ ConfigurationPermission(SecurityAction.Assert, Unrestricted = true), SecurityCritical(), SecurityTreatAsSafe(), ] private static bool GetDebugFromConfig() { CompilationSection section = (CompilationSection)WebConfigurationManager.GetWebApplicationSection("system.web/compilation"); return section.Debug; } } } // 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; // The compilation section can be defined below the application level, but ScriptManager only considers the // application-level debug setting. internal sealed class AppLevelCompilationSectionCache : ICompilationSection { private static readonly AppLevelCompilationSectionCache _instance = new AppLevelCompilationSectionCache(); // Value is cached statically, because AppLevelCompilationSectionCache is a Singleton. private bool? _debug; private AppLevelCompilationSectionCache() { } public static AppLevelCompilationSectionCache Instance { get { return _instance; } } public bool Debug { get { if (_debug == null) { _debug = GetDebugFromConfig(); } return _debug.Value; } } [ ConfigurationPermission(SecurityAction.Assert, Unrestricted = true), SecurityCritical(), SecurityTreatAsSafe(), ] private static bool GetDebugFromConfig() { CompilationSection section = (CompilationSection)WebConfigurationManager.GetWebApplicationSection("system.web/compilation"); return section.Debug; } } } // 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
- ObjectItemConventionAssemblyLoader.cs
- ServiceObjectContainer.cs
- InputBinding.cs
- SizeAnimationClockResource.cs
- GatewayDefinition.cs
- PipelineDeploymentState.cs
- DiagnosticsConfiguration.cs
- PersonalizationStateQuery.cs
- XamlSerializer.cs
- PeerApplicationLaunchInfo.cs
- SamlEvidence.cs
- ColumnReorderedEventArgs.cs
- ObjectQueryState.cs
- SessionStateSection.cs
- SafeEventLogWriteHandle.cs
- ValidationResult.cs
- ItemChangedEventArgs.cs
- Source.cs
- XmlSerializerAssemblyAttribute.cs
- DataTable.cs
- Int64KeyFrameCollection.cs
- WebPartAddingEventArgs.cs
- DataTemplateSelector.cs
- FrameworkContextData.cs
- SHA384.cs
- HandoffBehavior.cs
- CodeTypeConstructor.cs
- Thread.cs
- WebConfigurationManager.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- XmlNullResolver.cs
- ScalarType.cs
- ADRoleFactoryConfiguration.cs
- ContainerVisual.cs
- ProgressChangedEventArgs.cs
- BindingListCollectionView.cs
- EnvironmentPermission.cs
- HostingEnvironmentSection.cs
- DataGridRowHeaderAutomationPeer.cs
- SqlDataSourceCommandEventArgs.cs
- AlphabeticalEnumConverter.cs
- WindowsHyperlink.cs
- DataTableClearEvent.cs
- DefaultProxySection.cs
- PrimarySelectionAdorner.cs
- DbDataRecord.cs
- TagPrefixAttribute.cs
- wgx_sdk_version.cs
- AuthenticationServiceManager.cs
- XXXOnTypeBuilderInstantiation.cs
- HashAlgorithm.cs
- IconConverter.cs
- DataShape.cs
- HttpApplication.cs
- ModelItemKeyValuePair.cs
- TypeDelegator.cs
- QueryOperationResponseOfT.cs
- XPathNodeInfoAtom.cs
- ScriptIgnoreAttribute.cs
- compensatingcollection.cs
- OleCmdHelper.cs
- StringSource.cs
- XmlSubtreeReader.cs
- TypeReference.cs
- FileDetails.cs
- NumericUpDown.cs
- GridItemPattern.cs
- DataGridLinkButton.cs
- ADMembershipProvider.cs
- FixedNode.cs
- DoubleAnimationClockResource.cs
- DelimitedListTraceListener.cs
- WsatConfiguration.cs
- PropertyIDSet.cs
- SqlNodeAnnotation.cs
- ControlDesigner.cs
- ObjectTag.cs
- EncoderParameter.cs
- Error.cs
- RuleInfoComparer.cs
- ContextMenuService.cs
- BoundsDrawingContextWalker.cs
- SocketCache.cs
- CorrelationExtension.cs
- AuthenticateEventArgs.cs
- Line.cs
- FormsAuthentication.cs
- ControlLocalizer.cs
- SiteMapNodeItemEventArgs.cs
- ColorPalette.cs
- Size3DValueSerializer.cs
- RegexCapture.cs
- DataSource.cs
- entityreference_tresulttype.cs
- Viewport3DAutomationPeer.cs
- CrossSiteScriptingValidation.cs
- TraceHelpers.cs
- FastEncoderWindow.cs
- GregorianCalendar.cs
- TextTabProperties.cs