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
- DictionaryEditChange.cs
- NumericUpDown.cs
- ObjectItemAttributeAssemblyLoader.cs
- DoubleCollectionValueSerializer.cs
- NGCUIElementCollectionSerializerAsync.cs
- DoubleUtil.cs
- ExpressionWriter.cs
- StrokeSerializer.cs
- ScrollItemProviderWrapper.cs
- SizeKeyFrameCollection.cs
- DataGridViewBindingCompleteEventArgs.cs
- XamlRtfConverter.cs
- RuleInfoComparer.cs
- SessionParameter.cs
- Decorator.cs
- _HTTPDateParse.cs
- ActivityTypeResolver.xaml.cs
- StateElementCollection.cs
- MulticastNotSupportedException.cs
- CompressionTransform.cs
- CatchDesigner.xaml.cs
- FontStretchConverter.cs
- CompiledXpathExpr.cs
- PrintEvent.cs
- QueryContinueDragEventArgs.cs
- InkSerializer.cs
- rsa.cs
- MethodToken.cs
- XPathNavigatorReader.cs
- ByteArrayHelperWithString.cs
- GridViewColumnHeaderAutomationPeer.cs
- WeakReadOnlyCollection.cs
- XmlByteStreamWriter.cs
- RelatedImageListAttribute.cs
- PeerObject.cs
- IndexedEnumerable.cs
- SettingsPropertyIsReadOnlyException.cs
- DataGridRowHeaderAutomationPeer.cs
- SmiConnection.cs
- LookupBindingPropertiesAttribute.cs
- FactoryGenerator.cs
- PropertyToken.cs
- RequiredFieldValidator.cs
- XmlBinaryReader.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- WebException.cs
- PersistenceProvider.cs
- DockAndAnchorLayout.cs
- SerializationFieldInfo.cs
- MULTI_QI.cs
- RowToFieldTransformer.cs
- SevenBitStream.cs
- Bezier.cs
- EntitySqlQueryBuilder.cs
- AmbientProperties.cs
- HMACRIPEMD160.cs
- PersistChildrenAttribute.cs
- LocationReference.cs
- ToolboxDataAttribute.cs
- PassportAuthenticationEventArgs.cs
- TabletDevice.cs
- LogExtentCollection.cs
- PrefixHandle.cs
- SHA384.cs
- MediaSystem.cs
- TypeViewSchema.cs
- SQLUtility.cs
- CombinedGeometry.cs
- Sentence.cs
- SectionRecord.cs
- DataGridViewColumnCollection.cs
- JournalEntryStack.cs
- ToolStripSeparator.cs
- FormsAuthenticationUser.cs
- ContentDesigner.cs
- InkSerializer.cs
- RectAnimation.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- Content.cs
- GcHandle.cs
- ListViewItemEventArgs.cs
- TableRowsCollectionEditor.cs
- Point4D.cs
- StructuredTypeInfo.cs
- SimpleTypeResolver.cs
- SmiXetterAccessMap.cs
- SqlDataSourceFilteringEventArgs.cs
- MessageQueueInstaller.cs
- ReadOnlyObservableCollection.cs
- XamlBrushSerializer.cs
- HttpHandlersInstallComponent.cs
- ListViewPagedDataSource.cs
- TextContainerChangeEventArgs.cs
- Win32SafeHandles.cs
- HashCodeCombiner.cs
- CipherData.cs
- GenericsInstances.cs
- EncodingDataItem.cs
- XPathExpr.cs
- MultiAsyncResult.cs