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
- WorkflowTimerService.cs
- ZeroOpNode.cs
- ThemeDictionaryExtension.cs
- ColumnResizeAdorner.cs
- WebRequestModuleElementCollection.cs
- UnsafeNativeMethodsTablet.cs
- XmlSchemaComplexType.cs
- CultureTable.cs
- DiscoveryInnerClientAdhocCD1.cs
- ListSourceHelper.cs
- ParserOptions.cs
- ApplicationDirectory.cs
- HttpStreamMessage.cs
- ReachDocumentPageSerializer.cs
- Win32SafeHandles.cs
- TextWriter.cs
- InternalsVisibleToAttribute.cs
- SiteMembershipCondition.cs
- RegexFCD.cs
- ModelServiceImpl.cs
- RegistryPermission.cs
- FontStyleConverter.cs
- StateDesigner.Layouts.cs
- DynamicRenderer.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- bidPrivateBase.cs
- HandledMouseEvent.cs
- XmlEncodedRawTextWriter.cs
- XPathChildIterator.cs
- SlotInfo.cs
- WindowsTokenRoleProvider.cs
- ComNativeDescriptor.cs
- DefaultMemberAttribute.cs
- DrawListViewItemEventArgs.cs
- ToolBarOverflowPanel.cs
- _UncName.cs
- ArrayConverter.cs
- BooleanConverter.cs
- DBConnectionString.cs
- PassportAuthenticationModule.cs
- HScrollBar.cs
- AssertFilter.cs
- DiscoveryInnerClientAdhoc11.cs
- TransformProviderWrapper.cs
- SystemWebSectionGroup.cs
- DSASignatureDeformatter.cs
- ProfileInfo.cs
- BridgeDataRecord.cs
- PropertyRecord.cs
- SpecularMaterial.cs
- GlyphRun.cs
- WrappedReader.cs
- SqlNodeAnnotations.cs
- AppDomainFactory.cs
- OrderedEnumerableRowCollection.cs
- RegexStringValidator.cs
- StickyNote.cs
- CustomPeerResolverService.cs
- DebuggerAttributes.cs
- UriTemplateLiteralPathSegment.cs
- PerformanceCounter.cs
- GCHandleCookieTable.cs
- ExpressionBuilder.cs
- BindingContext.cs
- DatagridviewDisplayedBandsData.cs
- ResXDataNode.cs
- ObjectNavigationPropertyMapping.cs
- ResizingMessageFilter.cs
- LocalizableAttribute.cs
- ProcessingInstructionAction.cs
- ProtocolsConfiguration.cs
- IgnoreSectionHandler.cs
- UniqueConstraint.cs
- COMException.cs
- XmlSchemaResource.cs
- ContextStack.cs
- XmlValueConverter.cs
- PasswordPropertyTextAttribute.cs
- DoubleLinkList.cs
- AudienceUriMode.cs
- EndOfStreamException.cs
- Assign.cs
- JsonServiceDocumentSerializer.cs
- HyperLink.cs
- AutomationIdentifier.cs
- VersionedStream.cs
- IISMapPath.cs
- TextRunTypographyProperties.cs
- __Filters.cs
- WebPartDescription.cs
- Task.cs
- FixedTextView.cs
- EventEntry.cs
- ErrorInfoXmlDocument.cs
- LocalBuilder.cs
- EntityProxyFactory.cs
- AspNetSynchronizationContext.cs
- RelationshipConstraintValidator.cs
- CodeParameterDeclarationExpression.cs
- ACE.cs