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
- EventData.cs
- HasRunnableWorkflowEvent.cs
- BulletedList.cs
- MessageQueuePermissionAttribute.cs
- LambdaCompiler.ControlFlow.cs
- XPathEmptyIterator.cs
- GridErrorDlg.cs
- ActiveXSite.cs
- ListViewItemMouseHoverEvent.cs
- ResourcePool.cs
- SubtreeProcessor.cs
- MenuItemBindingCollection.cs
- ViewPort3D.cs
- DocumentGridContextMenu.cs
- DataServiceBehavior.cs
- DataGridViewCellLinkedList.cs
- ThreadInterruptedException.cs
- SponsorHelper.cs
- StructuredProperty.cs
- DataGridItemCollection.cs
- UnionCodeGroup.cs
- AspNetPartialTrustHelpers.cs
- COM2ExtendedUITypeEditor.cs
- SQLInt16Storage.cs
- _ListenerResponseStream.cs
- StorageModelBuildProvider.cs
- QueryStringConverter.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- NullExtension.cs
- BuildProviderCollection.cs
- DynamicMethod.cs
- VisualTarget.cs
- CodeAttributeArgumentCollection.cs
- SQLInt32.cs
- SymbolDocumentGenerator.cs
- DateRangeEvent.cs
- MimeMapping.cs
- CapacityStreamGeometryContext.cs
- AuthenticateEventArgs.cs
- SecurityUtils.cs
- XmlNamespaceDeclarationsAttribute.cs
- WebPartManagerInternals.cs
- VScrollProperties.cs
- BoundPropertyEntry.cs
- PrimitiveType.cs
- PropertyPath.cs
- XmlNullResolver.cs
- FileLoadException.cs
- WriteFileContext.cs
- cache.cs
- LogicalExpr.cs
- SoapReflectionImporter.cs
- GridItemPattern.cs
- DataGridViewIntLinkedList.cs
- SecureConversationVersion.cs
- CollectionViewSource.cs
- AnimationException.cs
- VoiceObjectToken.cs
- PathGradientBrush.cs
- XPathAncestorQuery.cs
- XmlEncoding.cs
- DbMetaDataColumnNames.cs
- CDSCollectionETWBCLProvider.cs
- WmlPhoneCallAdapter.cs
- CollectionViewSource.cs
- SinglePhaseEnlistment.cs
- TdsParserSafeHandles.cs
- JoinGraph.cs
- DataServiceEntityAttribute.cs
- RequestNavigateEventArgs.cs
- XslVisitor.cs
- BitmapEffectvisualstate.cs
- TextSchema.cs
- StringFreezingAttribute.cs
- QilStrConcat.cs
- PropertyPushdownHelper.cs
- RuntimeResourceSet.cs
- SimpleHandlerFactory.cs
- InvalidEnumArgumentException.cs
- AppearanceEditorPart.cs
- ClientTargetSection.cs
- UnauthorizedAccessException.cs
- InputLangChangeEvent.cs
- StrongName.cs
- Inflater.cs
- SqlProvider.cs
- DynamicRendererThreadManager.cs
- DataServiceKeyAttribute.cs
- WindowsListViewItem.cs
- SQLByte.cs
- DetailsViewModeEventArgs.cs
- GACMembershipCondition.cs
- XmlAnyElementAttributes.cs
- TextTreeExtractElementUndoUnit.cs
- TextServicesContext.cs
- DeclarativeExpressionConditionDeclaration.cs
- DebugHandleTracker.cs
- WmfPlaceableFileHeader.cs
- WebServiceResponse.cs
- ListDictionaryInternal.cs