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
- ConstNode.cs
- InternalUserCancelledException.cs
- DbBuffer.cs
- HandleCollector.cs
- SqlInternalConnection.cs
- SafeSecurityHelper.cs
- CoTaskMemSafeHandle.cs
- SocketStream.cs
- XslTransform.cs
- EventLogException.cs
- SQlBooleanStorage.cs
- View.cs
- WindowsGraphicsCacheManager.cs
- CharacterBuffer.cs
- PauseStoryboard.cs
- _LocalDataStoreMgr.cs
- HttpUnhandledOperationInvoker.cs
- ConversionValidationRule.cs
- WizardStepBase.cs
- PeerObject.cs
- HttpProcessUtility.cs
- XmlElementAttribute.cs
- TextParentUndoUnit.cs
- UserNameSecurityToken.cs
- ListItem.cs
- QilPatternFactory.cs
- ProxyAttribute.cs
- recordstatefactory.cs
- TogglePattern.cs
- HwndProxyElementProvider.cs
- AppDomainResourcePerfCounters.cs
- WindowsFormsEditorServiceHelper.cs
- DataGridViewSortCompareEventArgs.cs
- DocumentOrderQuery.cs
- MDIControlStrip.cs
- JavaScriptString.cs
- ConstrainedGroup.cs
- TraceXPathNavigator.cs
- StylusPointPropertyId.cs
- SerializationException.cs
- CompilerLocalReference.cs
- TemplatePropertyEntry.cs
- MenuItem.cs
- GeneralTransformGroup.cs
- TabItemWrapperAutomationPeer.cs
- ValidationHelpers.cs
- CompatibleIComparer.cs
- BaseDataBoundControl.cs
- CustomAttributeFormatException.cs
- JulianCalendar.cs
- ThreadPool.cs
- ColumnResult.cs
- DesignerDataSchemaClass.cs
- WebPartUtil.cs
- HttpListenerTimeoutManager.cs
- CollectionsUtil.cs
- HttpConfigurationContext.cs
- SHA512Cng.cs
- FrameSecurityDescriptor.cs
- ExtractedStateEntry.cs
- FormConverter.cs
- DateTimeFormat.cs
- XsltContext.cs
- CircleEase.cs
- TextPattern.cs
- TaskFileService.cs
- StringFreezingAttribute.cs
- OutOfMemoryException.cs
- ToolBar.cs
- _RegBlobWebProxyDataBuilder.cs
- TransformPattern.cs
- InputGestureCollection.cs
- DashStyle.cs
- ModuleBuilder.cs
- InputLangChangeEvent.cs
- ClipboardProcessor.cs
- ZoneLinkButton.cs
- ListViewDeleteEventArgs.cs
- DataBindingCollection.cs
- OutputCacheProfileCollection.cs
- ValidationEventArgs.cs
- DataColumnMapping.cs
- httpapplicationstate.cs
- HttpDebugHandler.cs
- XmlCodeExporter.cs
- PanelContainerDesigner.cs
- ManageRequest.cs
- HtmlShimManager.cs
- XmlSerializationReader.cs
- GeometryCollection.cs
- MethodAccessException.cs
- SslStream.cs
- TransformCollection.cs
- AssemblyAttributes.cs
- FontSource.cs
- OdbcReferenceCollection.cs
- BasicHttpSecurityMode.cs
- ToolBarButton.cs
- infer.cs
- MemberJoinTreeNode.cs