Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / AppLevelCompilationSectionCache.cs / 1305376 / 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), SecuritySafeCritical(), ] 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), SecuritySafeCritical(), ] 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
- IPipelineRuntime.cs
- TypeConverter.cs
- compensatingcollection.cs
- MailMessage.cs
- PerformanceCounterManager.cs
- TdsParser.cs
- NetworkInterface.cs
- DateRangeEvent.cs
- XmlConverter.cs
- LoginView.cs
- GridItem.cs
- DecimalConstantAttribute.cs
- TrailingSpaceComparer.cs
- ParseHttpDate.cs
- InternalDispatchObject.cs
- HttpCookie.cs
- ComponentRenameEvent.cs
- SelectionItemProviderWrapper.cs
- QuaternionValueSerializer.cs
- SocketException.cs
- StylusTip.cs
- AnimatedTypeHelpers.cs
- QueryCursorEventArgs.cs
- BinaryEditor.cs
- NetworkAddressChange.cs
- SqlException.cs
- HttpSessionStateWrapper.cs
- BookmarkList.cs
- AdRotator.cs
- ContourSegment.cs
- ADMembershipUser.cs
- Win32SafeHandles.cs
- ObjectSet.cs
- SequenceDesigner.cs
- ToolStripDropTargetManager.cs
- BinaryWriter.cs
- PieceNameHelper.cs
- StyleTypedPropertyAttribute.cs
- XmlExceptionHelper.cs
- HyperLinkField.cs
- SetIterators.cs
- ConstNode.cs
- ToolboxCategory.cs
- ExpressionBindings.cs
- DockPanel.cs
- AppManager.cs
- WebServiceEnumData.cs
- MembershipAdapter.cs
- HTTPRemotingHandler.cs
- CodeExpressionCollection.cs
- MimeFormatExtensions.cs
- XPathQueryGenerator.cs
- Renderer.cs
- DependencyPropertyValueSerializer.cs
- BindingCollection.cs
- basenumberconverter.cs
- OledbConnectionStringbuilder.cs
- TextTreeRootNode.cs
- FileEnumerator.cs
- SqlExpander.cs
- EventLogPermissionHolder.cs
- CategoryEditor.cs
- SqlOuterApplyReducer.cs
- TraceListener.cs
- ContainerControl.cs
- ListDictionary.cs
- Graph.cs
- QueueProcessor.cs
- ApplicationHost.cs
- DataGridViewRowCollection.cs
- DataErrorValidationRule.cs
- RootNamespaceAttribute.cs
- EntityDataSourceChangingEventArgs.cs
- RotateTransform.cs
- NonBatchDirectoryCompiler.cs
- Hash.cs
- FunctionCommandText.cs
- StickyNoteHelper.cs
- IPPacketInformation.cs
- NullableIntSumAggregationOperator.cs
- ListViewEditEventArgs.cs
- Column.cs
- ProfileServiceManager.cs
- EventLogLink.cs
- DataObjectEventArgs.cs
- GraphicsContainer.cs
- BrowsableAttribute.cs
- TableCell.cs
- __FastResourceComparer.cs
- NetPeerTcpBinding.cs
- TagMapCollection.cs
- DataGridColumnCollection.cs
- FreezableOperations.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- FixedSOMElement.cs
- TabItem.cs
- NavigationService.cs
- WebSysDefaultValueAttribute.cs
- PolyBezierSegment.cs
- IsolatedStorageFileStream.cs