Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Configuration / ScriptingScriptResourceHandlerSection.cs / 1 / ScriptingScriptResourceHandlerSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Configuration; using System.Security.Permissions; using System.Web; using System.Web.Configuration; using System.Web.Script.Serialization; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public sealed class ScriptingScriptResourceHandlerSection : ConfigurationSection { private static readonly ConfigurationProperty _propEnableCaching = new ConfigurationProperty("enableCaching", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propEnableCompression = new ConfigurationProperty("enableCompression", typeof(bool), true, ConfigurationPropertyOptions.None); private static ConfigurationPropertyCollection _properties = BuildProperties(); private static ConfigurationPropertyCollection BuildProperties() { ConfigurationPropertyCollection props = new ConfigurationPropertyCollection(); props.Add(_propEnableCaching); props.Add(_propEnableCompression); return props; } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("enableCaching", DefaultValue = true)] public bool EnableCaching { get { return (bool)base[_propEnableCaching]; } set { base[_propEnableCaching] = value; } } [ConfigurationProperty("enableCompression", DefaultValue = true)] public bool EnableCompression { get { return (bool)base[_propEnableCompression]; } set { base[_propEnableCompression] = value; } } internal static class ApplicationSettings { private volatile static bool s_sectionLoaded; private static bool s_enableCaching; private static bool s_enableCompression; private static void EnsureSectionLoaded() { if (!s_sectionLoaded) { ScriptingScriptResourceHandlerSection section = (ScriptingScriptResourceHandlerSection) WebConfigurationManager.GetWebApplicationSection("system.web.extensions/scripting/scriptResourceHandler"); if (section != null) { s_enableCaching = section.EnableCaching; s_enableCompression = section.EnableCompression; } else { s_enableCaching = (bool)_propEnableCaching.DefaultValue; s_enableCompression = (bool)_propEnableCompression.DefaultValue; } s_sectionLoaded = true; } } internal static bool EnableCaching { get { EnsureSectionLoaded(); return s_enableCaching; } } internal static bool EnableCompression { get { EnsureSectionLoaded(); return s_enableCompression; } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- cryptoapiTransform.cs
- XmlBinaryReader.cs
- ObjectItemConventionAssemblyLoader.cs
- SiteMapSection.cs
- FontNameEditor.cs
- XamlFrame.cs
- WebResourceAttribute.cs
- _UriSyntax.cs
- TextEditorMouse.cs
- StructuralComparisons.cs
- RelatedView.cs
- ControlValuePropertyAttribute.cs
- DynamicRenderer.cs
- RegexCapture.cs
- DataGridDesigner.cs
- DerivedKeySecurityToken.cs
- MethodExecutor.cs
- Light.cs
- HeaderedItemsControl.cs
- XXXOnTypeBuilderInstantiation.cs
- AliasExpr.cs
- FileInfo.cs
- ListControlActionList.cs
- RoleGroup.cs
- ShapeTypeface.cs
- ScriptingRoleServiceSection.cs
- GZipUtils.cs
- SwitchElementsCollection.cs
- TextTreeObjectNode.cs
- ManagedIStream.cs
- ApplicationDirectory.cs
- InternalBufferOverflowException.cs
- Vector3D.cs
- TableLayoutCellPaintEventArgs.cs
- SiteMapDataSourceView.cs
- _ProxyChain.cs
- HttpModuleActionCollection.cs
- BufferedWebEventProvider.cs
- FacetChecker.cs
- BitSet.cs
- JapaneseLunisolarCalendar.cs
- XmlCharType.cs
- KeyFrames.cs
- SystemDropShadowChrome.cs
- SoapFault.cs
- Pair.cs
- SizeKeyFrameCollection.cs
- ButtonBaseAdapter.cs
- DbConnectionPoolIdentity.cs
- PieceDirectory.cs
- SiteMembershipCondition.cs
- DesignTimeTemplateParser.cs
- VarRemapper.cs
- PerformanceCounterPermission.cs
- CapiNative.cs
- ApplicationHost.cs
- HtmlInputButton.cs
- NavigationCommands.cs
- RotateTransform.cs
- ZipPackage.cs
- ContentFileHelper.cs
- _SSPISessionCache.cs
- RepeaterCommandEventArgs.cs
- Span.cs
- PersistNameAttribute.cs
- JsonServiceDocumentSerializer.cs
- DurableOperationAttribute.cs
- WebPartDisplayModeEventArgs.cs
- CngProvider.cs
- UrlAuthorizationModule.cs
- MobileUserControlDesigner.cs
- InstanceOwnerQueryResult.cs
- ServiceHttpModule.cs
- WorkflowExecutor.cs
- CodeCommentStatement.cs
- XmlnsCache.cs
- TemplateParser.cs
- InvokeMethodActivityDesigner.cs
- CacheOutputQuery.cs
- TextFormatterImp.cs
- IconBitmapDecoder.cs
- StringAttributeCollection.cs
- TableColumn.cs
- PropertyValueChangedEvent.cs
- TableLayoutPanel.cs
- HandlerFactoryCache.cs
- KnownBoxes.cs
- Base64Stream.cs
- ScriptBehaviorDescriptor.cs
- FileDialog_Vista_Interop.cs
- IncrementalReadDecoders.cs
- SqlCommandAsyncResult.cs
- AuthorizationSection.cs
- PageVisual.cs
- UIPropertyMetadata.cs
- PolicyLevel.cs
- BatchStream.cs
- CodeVariableReferenceExpression.cs
- DataColumn.cs
- StylusDevice.cs