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
- GrammarBuilderDictation.cs
- BamlStream.cs
- SQLDateTime.cs
- RegionIterator.cs
- SessionPageStatePersister.cs
- DoubleCollection.cs
- DataGridViewCellPaintingEventArgs.cs
- ElementHostAutomationPeer.cs
- InputLanguage.cs
- KeyEventArgs.cs
- PeerPresenceInfo.cs
- QuotedPrintableStream.cs
- PropertyGridDesigner.cs
- ControlBindingsCollection.cs
- OverflowException.cs
- RenderData.cs
- NameScope.cs
- PathSegmentCollection.cs
- HwndAppCommandInputProvider.cs
- RegexCompilationInfo.cs
- Screen.cs
- MetabaseServerConfig.cs
- CharacterString.cs
- DataServiceQueryException.cs
- SoapInteropTypes.cs
- ContainerTracking.cs
- WebEventTraceProvider.cs
- SqlConnectionHelper.cs
- Queue.cs
- ToolStripGripRenderEventArgs.cs
- NativeRightsManagementAPIsStructures.cs
- ProtocolsConfigurationEntry.cs
- PropertyMapper.cs
- KeyGestureConverter.cs
- PlanCompiler.cs
- TextServicesCompartment.cs
- ToolstripProfessionalRenderer.cs
- LinqDataSourceValidationException.cs
- SystemIPInterfaceProperties.cs
- DSASignatureDeformatter.cs
- XmlDataImplementation.cs
- WrapPanel.cs
- WebPartDescription.cs
- TransformerInfoCollection.cs
- CommandEventArgs.cs
- WorkflowPrinting.cs
- EdmItemCollection.cs
- ImportContext.cs
- SplashScreenNativeMethods.cs
- TokenFactoryCredential.cs
- CompiledIdentityConstraint.cs
- XslCompiledTransform.cs
- ShapingEngine.cs
- SocketPermission.cs
- ClassicBorderDecorator.cs
- BaseCodePageEncoding.cs
- RootBuilder.cs
- CapabilitiesRule.cs
- SizeConverter.cs
- DataGridViewCellValueEventArgs.cs
- AnnotationResourceChangedEventArgs.cs
- QilList.cs
- TemplateLookupAction.cs
- PublisherMembershipCondition.cs
- X509UI.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- ViewBox.cs
- DetailsViewDeletedEventArgs.cs
- FederatedMessageSecurityOverHttp.cs
- CodeIdentifier.cs
- PersonalizationState.cs
- XmlUnspecifiedAttribute.cs
- SafeEventLogReadHandle.cs
- Attachment.cs
- ValueTypeFieldReference.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- ExtensionWindow.cs
- ValidatorAttribute.cs
- DbDataSourceEnumerator.cs
- SqlBooleanMismatchVisitor.cs
- ListControlConvertEventArgs.cs
- XmlNamespaceMapping.cs
- Normalization.cs
- RSAPKCS1SignatureDeformatter.cs
- ControlParser.cs
- ConstraintStruct.cs
- SmtpReplyReader.cs
- ConfigurationLockCollection.cs
- MenuAutomationPeer.cs
- EntityDataSourceReferenceGroup.cs
- DbDataReader.cs
- MessageQueuePermissionAttribute.cs
- BorderGapMaskConverter.cs
- XPathBinder.cs
- UniqueConstraint.cs
- XhtmlMobileTextWriter.cs
- StrongNameKeyPair.cs
- ProviderSettings.cs
- ListBox.cs
- SoapEnumAttribute.cs