Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Configuration / ScriptingScriptResourceHandlerSection.cs / 1305376 / ScriptingScriptResourceHandlerSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Configuration; using System.Web; using System.Web.Configuration; using System.Web.Script.Serialization; 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.Web; using System.Web.Configuration; using System.Web.Script.Serialization; 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
- DetailsViewRowCollection.cs
- HitTestFilterBehavior.cs
- ScaleTransform.cs
- UnknownWrapper.cs
- HttpRuntime.cs
- TargetParameterCountException.cs
- DrawItemEvent.cs
- ReferentialConstraint.cs
- Clause.cs
- HTTPNotFoundHandler.cs
- DoubleStorage.cs
- AddressHeader.cs
- SaveFileDialog.cs
- TypeConverterHelper.cs
- XmlReturnReader.cs
- DataException.cs
- OdbcConnection.cs
- DataGridCommandEventArgs.cs
- MediaElementAutomationPeer.cs
- DeclarativeCatalogPart.cs
- ConfigXmlText.cs
- NetNamedPipeSecurity.cs
- Pair.cs
- Triangle.cs
- Crc32.cs
- ProcessProtocolHandler.cs
- CacheOutputQuery.cs
- GraphicsState.cs
- PreProcessInputEventArgs.cs
- DecoderFallback.cs
- Utils.cs
- PublishLicense.cs
- WebResourceAttribute.cs
- ChannelDemuxer.cs
- Memoizer.cs
- TouchEventArgs.cs
- QilLiteral.cs
- ServiceKnownTypeAttribute.cs
- mediaeventargs.cs
- Queue.cs
- DesignSurfaceCollection.cs
- MobileFormsAuthentication.cs
- UpdateManifestForBrowserApplication.cs
- TreeViewImageKeyConverter.cs
- OperationCanceledException.cs
- EntityKey.cs
- WebPartDescriptionCollection.cs
- Matrix3DConverter.cs
- Keywords.cs
- XmlObjectSerializerReadContextComplex.cs
- ToolStripDesignerAvailabilityAttribute.cs
- SectionInformation.cs
- ArgumentValidation.cs
- Peer.cs
- XmlStringTable.cs
- ButtonRenderer.cs
- ClrPerspective.cs
- XmlEncoding.cs
- Visual3D.cs
- SecUtil.cs
- ExpressionStringBuilder.cs
- RelationshipEnd.cs
- XhtmlBasicLabelAdapter.cs
- EntityProviderServices.cs
- DiscoveryRequestHandler.cs
- PolicyManager.cs
- DecoderExceptionFallback.cs
- RequestCacheEntry.cs
- Pointer.cs
- WebBrowserContainer.cs
- KeySpline.cs
- CreateUserWizard.cs
- ConfigPathUtility.cs
- ToolStripButton.cs
- TypeCodeDomSerializer.cs
- DataGridViewRow.cs
- PromptEventArgs.cs
- VectorKeyFrameCollection.cs
- FlowDocumentReaderAutomationPeer.cs
- TransactionFlowBindingElementImporter.cs
- FloaterParagraph.cs
- DefaultPrintController.cs
- Dictionary.cs
- CustomLineCap.cs
- ForeignConstraint.cs
- EditCommandColumn.cs
- Highlights.cs
- GroupAggregateExpr.cs
- XmlReturnReader.cs
- MinMaxParagraphWidth.cs
- InfiniteTimeSpanConverter.cs
- localization.cs
- Hyperlink.cs
- FormatControl.cs
- XmlCharCheckingWriter.cs
- DynamicEntity.cs
- OrthographicCamera.cs
- RevocationPoint.cs
- TextAction.cs
- FileDetails.cs