Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SmtpMail.cs
- MethodBody.cs
- SQLRoleProvider.cs
- MetadataArtifactLoaderResource.cs
- LazyTextWriterCreator.cs
- CompositionDesigner.cs
- ChtmlTextWriter.cs
- DefaultValidator.cs
- SecurityResources.cs
- HGlobalSafeHandle.cs
- MethodCallTranslator.cs
- WebException.cs
- CustomErrorsSection.cs
- PropertyPath.cs
- RoleManagerModule.cs
- TextRunCache.cs
- LambdaSerializationException.cs
- GridViewRowPresenterBase.cs
- WpfXamlMember.cs
- InfoCardXmlSerializer.cs
- StringAnimationUsingKeyFrames.cs
- ProjectedWrapper.cs
- TextFormatterHost.cs
- TableChangeProcessor.cs
- CheckBox.cs
- HttpValueCollection.cs
- ListViewSelectEventArgs.cs
- XmlDataLoader.cs
- XmlWellformedWriter.cs
- MessageContractExporter.cs
- XmlQuerySequence.cs
- XmlObjectSerializerReadContextComplexJson.cs
- SortFieldComparer.cs
- PairComparer.cs
- ResourceManagerWrapper.cs
- OptimalTextSource.cs
- FormViewCommandEventArgs.cs
- BindStream.cs
- XPathNodePointer.cs
- QueryAccessibilityHelpEvent.cs
- SchemaNames.cs
- XsltLoader.cs
- RouteData.cs
- XmlCharType.cs
- SimpleWebHandlerParser.cs
- SmiRecordBuffer.cs
- EventLogPermissionHolder.cs
- DetailsViewPagerRow.cs
- SpecialFolderEnumConverter.cs
- Processor.cs
- FactoryId.cs
- SqlCacheDependencyDatabase.cs
- PropertySegmentSerializer.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- DesignerView.Commands.cs
- InkSerializer.cs
- RequiredAttributeAttribute.cs
- Config.cs
- SmtpNtlmAuthenticationModule.cs
- PointF.cs
- OleDbStruct.cs
- XmlNamespaceMappingCollection.cs
- MediaCommands.cs
- SerializerDescriptor.cs
- DocumentPageView.cs
- SafeLibraryHandle.cs
- ArgumentsParser.cs
- MouseCaptureWithinProperty.cs
- base64Transforms.cs
- UserPreferenceChangingEventArgs.cs
- TypeSource.cs
- EmissiveMaterial.cs
- SafeThreadHandle.cs
- CodeFieldReferenceExpression.cs
- controlskin.cs
- TemplatePagerField.cs
- ConfigXmlComment.cs
- SqlConnectionPoolProviderInfo.cs
- ExecutionEngineException.cs
- BaseServiceProvider.cs
- Setter.cs
- InheritedPropertyChangedEventArgs.cs
- MembershipUser.cs
- _BaseOverlappedAsyncResult.cs
- XmlSerializerFactory.cs
- SQLDoubleStorage.cs
- BuildResultCache.cs
- DocumentXPathNavigator.cs
- QfeChecker.cs
- PageThemeParser.cs
- MarginsConverter.cs
- PackageRelationshipSelector.cs
- AuthorizationSection.cs
- DbConnectionHelper.cs
- GeometryGroup.cs
- GeneralTransform3DGroup.cs
- Compiler.cs
- CultureSpecificStringDictionary.cs
- ZipIOCentralDirectoryBlock.cs
- PropertyInfoSet.cs