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
- UiaCoreApi.cs
- SynchronizationContextHelper.cs
- XmlHierarchicalDataSourceView.cs
- BindingMAnagerBase.cs
- AmbientLight.cs
- ProcessInfo.cs
- RecipientInfo.cs
- QilPatternFactory.cs
- EntityModelBuildProvider.cs
- ManagementObjectCollection.cs
- DocumentViewerBaseAutomationPeer.cs
- Debug.cs
- Polyline.cs
- SimpleTableProvider.cs
- ServiceOperationParameter.cs
- DelegatingTypeDescriptionProvider.cs
- UpdateRecord.cs
- FunctionQuery.cs
- ApplicationDirectory.cs
- HashCodeCombiner.cs
- ClusterSafeNativeMethods.cs
- Win32PrintDialog.cs
- OutKeywords.cs
- Descriptor.cs
- HtmlControlPersistable.cs
- LinkLabel.cs
- ArcSegment.cs
- HWStack.cs
- DBDataPermission.cs
- CapabilitiesUse.cs
- LinearKeyFrames.cs
- OleDbErrorCollection.cs
- EmbeddedMailObject.cs
- XmlSchemaSimpleContent.cs
- DataGridPageChangedEventArgs.cs
- SimpleNameService.cs
- InvalidateEvent.cs
- XmlCustomFormatter.cs
- SerializationException.cs
- OptimalTextSource.cs
- HierarchicalDataBoundControlAdapter.cs
- EmptyControlCollection.cs
- WindowsTab.cs
- Transform.cs
- CreatingCookieEventArgs.cs
- QueryTreeBuilder.cs
- ISAPIWorkerRequest.cs
- ProgressBar.cs
- RegistryConfigurationProvider.cs
- Expression.DebuggerProxy.cs
- TextServicesCompartmentEventSink.cs
- MultiSelectRootGridEntry.cs
- PropertyManager.cs
- TypeElement.cs
- MenuItemCollection.cs
- PropertyValueUIItem.cs
- CodeMemberProperty.cs
- NotCondition.cs
- XmlComment.cs
- SqlRemoveConstantOrderBy.cs
- PersonalizationStateQuery.cs
- BindingMAnagerBase.cs
- ResourceManagerWrapper.cs
- WebPartManagerInternals.cs
- KeyValuePairs.cs
- XmlRawWriter.cs
- StringDictionaryWithComparer.cs
- CultureInfoConverter.cs
- JapaneseLunisolarCalendar.cs
- TypeSystemProvider.cs
- DataGridViewComboBoxColumn.cs
- XamlTypeMapper.cs
- SystemResourceHost.cs
- ProfilePropertyNameValidator.cs
- Internal.cs
- ReadOnlyCollectionBase.cs
- DashStyle.cs
- MailAddress.cs
- EditorBrowsableAttribute.cs
- SettingsPropertyNotFoundException.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- SkipQueryOptionExpression.cs
- Baml2006ReaderContext.cs
- WebDescriptionAttribute.cs
- RectangleHotSpot.cs
- LogReservationCollection.cs
- QueryGeneratorBase.cs
- NavigationCommands.cs
- ValidatorAttribute.cs
- WindowsStatusBar.cs
- RelationshipConverter.cs
- WorkflowView.cs
- Int32RectConverter.cs
- ParallelTimeline.cs
- AffineTransform3D.cs
- MonitorWrapper.cs
- QueryRewriter.cs
- ProxyHwnd.cs
- MutexSecurity.cs
- DesignConnectionCollection.cs