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
- NamedPipeTransportBindingElement.cs
- OutputCacheProfile.cs
- LinkButton.cs
- LayoutTableCell.cs
- WindowsToolbarAsMenu.cs
- Repeater.cs
- CompModSwitches.cs
- autovalidator.cs
- ChannelManager.cs
- XmlSchemaRedefine.cs
- SafeArrayTypeMismatchException.cs
- FastEncoder.cs
- ZipIOExtraField.cs
- PrivilegedConfigurationManager.cs
- TableLayoutPanelCellPosition.cs
- PresentationTraceSources.cs
- TextEffectResolver.cs
- SystemNetworkInterface.cs
- XmlFormatWriterGenerator.cs
- QuaternionRotation3D.cs
- OleDbParameterCollection.cs
- KeyPressEvent.cs
- WebBrowserEvent.cs
- XmlSchemaImporter.cs
- PersonalizationStateInfoCollection.cs
- DataKeyCollection.cs
- OLEDB_Util.cs
- TemplateInstanceAttribute.cs
- ElementHostPropertyMap.cs
- ExpressionBuilderContext.cs
- StyleBamlRecordReader.cs
- TriState.cs
- CodeValidator.cs
- ButtonChrome.cs
- BeginCreateSecurityTokenRequest.cs
- DataServiceHostWrapper.cs
- CompensatableSequenceActivity.cs
- SqlHelper.cs
- ExternalFile.cs
- SystemWebSectionGroup.cs
- StateMachineExecutionState.cs
- ServiceOperationParameter.cs
- StreamInfo.cs
- HebrewCalendar.cs
- ColorDialog.cs
- TableLayout.cs
- RuleSet.cs
- DbParameterCollection.cs
- UntypedNullExpression.cs
- XmlBaseWriter.cs
- SqlInfoMessageEvent.cs
- SqlDependencyUtils.cs
- CatchBlock.cs
- TextBlock.cs
- Clock.cs
- DiscoveryClientChannelBase.cs
- Vector3DCollection.cs
- ClientRolePrincipal.cs
- ConsumerConnectionPoint.cs
- GACIdentityPermission.cs
- Object.cs
- Image.cs
- SafeSystemMetrics.cs
- FunctionImportMapping.cs
- WorkflowDefinitionDispenser.cs
- Rotation3D.cs
- PeerTransportSecurityElement.cs
- _AutoWebProxyScriptEngine.cs
- DBConcurrencyException.cs
- DataProtectionSecurityStateEncoder.cs
- PerformanceCounterPermissionEntry.cs
- XmlUtf8RawTextWriter.cs
- MatrixUtil.cs
- Int16.cs
- ToolStripLabel.cs
- BitmapData.cs
- HtmlElementCollection.cs
- _Events.cs
- ButtonBase.cs
- SeekStoryboard.cs
- PathData.cs
- PagerSettings.cs
- CompiledELinqQueryState.cs
- FixedSOMPageElement.cs
- ExpressionWriter.cs
- ProbeDuplexCD1AsyncResult.cs
- ExternalFile.cs
- DriveNotFoundException.cs
- MetadataItemSerializer.cs
- SmtpCommands.cs
- StringSorter.cs
- TableRow.cs
- DataColumnChangeEvent.cs
- GrammarBuilder.cs
- ContextDataSource.cs
- ToolStripPanelCell.cs
- ValidatorUtils.cs
- ApplyImportsAction.cs
- ObjectStateManagerMetadata.cs
- ClientScriptManagerWrapper.cs