Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventData.cs
- ThicknessConverter.cs
- ColorBlend.cs
- ImageAutomationPeer.cs
- QilIterator.cs
- HtmlInputControl.cs
- GregorianCalendarHelper.cs
- Visual3D.cs
- IndexerNameAttribute.cs
- SerializationSectionGroup.cs
- _ConnectOverlappedAsyncResult.cs
- CommonDialog.cs
- hebrewshape.cs
- AffineTransform3D.cs
- AdapterDictionary.cs
- LambdaReference.cs
- SyndicationElementExtensionCollection.cs
- Section.cs
- HtmlLiteralTextAdapter.cs
- ActivationArguments.cs
- QilTargetType.cs
- TextElement.cs
- XmlSchemas.cs
- WithParamAction.cs
- PathTooLongException.cs
- SmiEventSink_DeferedProcessing.cs
- ProxyWebPartManager.cs
- SizeChangedInfo.cs
- ChildTable.cs
- IIS7WorkerRequest.cs
- ThreadAbortException.cs
- _LocalDataStore.cs
- Atom10FormatterFactory.cs
- MetadataCache.cs
- UrlPropertyAttribute.cs
- OdbcUtils.cs
- SamlSerializer.cs
- Properties.cs
- AnimationTimeline.cs
- PipelineModuleStepContainer.cs
- FtpCachePolicyElement.cs
- DataMember.cs
- BitmapEffectrendercontext.cs
- DateTimeConverter.cs
- NeutralResourcesLanguageAttribute.cs
- IRCollection.cs
- MouseGestureValueSerializer.cs
- ListParagraph.cs
- RuntimeConfigurationRecord.cs
- SqlProvider.cs
- CodeTypeMemberCollection.cs
- UnhandledExceptionEventArgs.cs
- CompositeActivityValidator.cs
- AQNBuilder.cs
- XmlSerializerFormatAttribute.cs
- NonNullItemCollection.cs
- BinaryReader.cs
- CodeArrayCreateExpression.cs
- TextUtf8RawTextWriter.cs
- AppDomainAttributes.cs
- AppSettingsReader.cs
- DateBoldEvent.cs
- PreservationFileReader.cs
- CalendarTable.cs
- CallbackHandler.cs
- XmlUtil.cs
- TextTreeRootTextBlock.cs
- _DisconnectOverlappedAsyncResult.cs
- RenderingEventArgs.cs
- WindowHelperService.cs
- ExpressionPrefixAttribute.cs
- ControlEvent.cs
- AdornerHitTestResult.cs
- MultitargetingHelpers.cs
- EventPropertyMap.cs
- MarshalByRefObject.cs
- ResourceWriter.cs
- XhtmlStyleClass.cs
- ReadOnlyCollectionBase.cs
- ResourceManagerWrapper.cs
- InkCanvasInnerCanvas.cs
- SchemaNotation.cs
- Merger.cs
- LinqDataView.cs
- WebBrowser.cs
- ObjectDataSourceSelectingEventArgs.cs
- WebPartManagerInternals.cs
- RayMeshGeometry3DHitTestResult.cs
- CodeMethodInvokeExpression.cs
- IFormattable.cs
- BCLDebug.cs
- DataGridViewRowPostPaintEventArgs.cs
- BasePropertyDescriptor.cs
- DiscoveryRequestHandler.cs
- QueueProcessor.cs
- ControlBuilder.cs
- ByteRangeDownloader.cs
- ColumnMapCopier.cs
- AccessedThroughPropertyAttribute.cs
- PropertyChangeTracker.cs