Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- VerificationAttribute.cs
- EncoderBestFitFallback.cs
- DataServiceConfiguration.cs
- IdnMapping.cs
- PropertyDescriptors.cs
- OletxVolatileEnlistment.cs
- HostedBindingBehavior.cs
- AQNBuilder.cs
- SqlInternalConnectionSmi.cs
- XpsTokenContext.cs
- DataGridColumnCollection.cs
- LogArchiveSnapshot.cs
- TrackingServices.cs
- SqlRecordBuffer.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- SqlBulkCopyColumnMapping.cs
- StaticExtensionConverter.cs
- XmlAutoDetectWriter.cs
- ContainerCodeDomSerializer.cs
- Vector3DCollectionValueSerializer.cs
- HtmlForm.cs
- BulletDecorator.cs
- ScriptReferenceBase.cs
- XmlSortKey.cs
- ObjectTag.cs
- DataSysAttribute.cs
- CaseInsensitiveOrdinalStringComparer.cs
- TickBar.cs
- SystemNetworkInterface.cs
- OptimisticConcurrencyException.cs
- ShapingWorkspace.cs
- TdsParserSessionPool.cs
- DnsPermission.cs
- BaseServiceProvider.cs
- EntityConnectionStringBuilder.cs
- PopOutPanel.cs
- HyperLinkColumn.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- OracleEncoding.cs
- WebConfigurationManager.cs
- UpdateCommand.cs
- ExpandoClass.cs
- LinkedResource.cs
- ProtectedConfiguration.cs
- SystemUdpStatistics.cs
- ThreadExceptionDialog.cs
- CriticalHandle.cs
- DynamicDiscoSearcher.cs
- StorageMappingItemCollection.cs
- EventProperty.cs
- DbParameterCollectionHelper.cs
- Models.cs
- SafeArrayRankMismatchException.cs
- SecurityTokenException.cs
- WhileDesigner.xaml.cs
- KeyFrames.cs
- HttpChannelBindingToken.cs
- TextParaClient.cs
- PathBox.cs
- RegexRunnerFactory.cs
- ADRole.cs
- OptimizedTemplateContent.cs
- ArrayWithOffset.cs
- ResourceReferenceKeyNotFoundException.cs
- ImageKeyConverter.cs
- OracleColumn.cs
- MemoryMappedViewStream.cs
- FontFamilyValueSerializer.cs
- WebServiceHostFactory.cs
- SecurityElement.cs
- MonthChangedEventArgs.cs
- DataRowChangeEvent.cs
- FileStream.cs
- HandlerBase.cs
- ToolStripScrollButton.cs
- WebPartsSection.cs
- SpeakInfo.cs
- ThreadPoolTaskScheduler.cs
- VisualStyleElement.cs
- ArrayConverter.cs
- NameValueCollection.cs
- HandlerBase.cs
- ConfigXmlWhitespace.cs
- TypeInfo.cs
- Canvas.cs
- ValueConversionAttribute.cs
- CompilerState.cs
- SystemWebSectionGroup.cs
- TraceData.cs
- ScrollableControl.cs
- OracleColumn.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- RepeaterItemCollection.cs
- ObjectDataSourceEventArgs.cs
- TreeNodeClickEventArgs.cs
- HttpStaticObjectsCollectionBase.cs
- DependencyObjectValidator.cs
- HttpModuleActionCollection.cs
- SqlProvider.cs
- SqlException.cs