Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / Configuration / ScriptingScriptResourceHandlerSection.cs / 1 / ScriptingScriptResourceHandlerSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Configuration; using System.Security.Permissions; using System.Web; using System.Web.Configuration; using System.Web.Script.Serialization; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] 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.Security.Permissions; using System.Web; using System.Web.Configuration; using System.Web.Script.Serialization; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] 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
- OLEDB_Util.cs
- DynamicILGenerator.cs
- QilTypeChecker.cs
- ToggleButtonAutomationPeer.cs
- CacheSection.cs
- AppDomainUnloadedException.cs
- ConnectionPoolRegistry.cs
- MailDefinition.cs
- ObjectView.cs
- BlockCollection.cs
- Int32KeyFrameCollection.cs
- HtmlTableRowCollection.cs
- BamlTreeNode.cs
- HtmlGenericControl.cs
- InternalsVisibleToAttribute.cs
- ServicePointManager.cs
- InputBinder.cs
- RawTextInputReport.cs
- WaitHandle.cs
- versioninfo.cs
- ControlCollection.cs
- ToolStripGrip.cs
- Misc.cs
- SimpleMailWebEventProvider.cs
- ItemsChangedEventArgs.cs
- AttributeUsageAttribute.cs
- ObjectDisposedException.cs
- WeakReference.cs
- ViewBase.cs
- BoundColumn.cs
- KeyboardEventArgs.cs
- XmlSchemaIdentityConstraint.cs
- ExistsInCollection.cs
- MappedMetaModel.cs
- DiscoveryDocumentSearchPattern.cs
- DataBinding.cs
- DesignerDataParameter.cs
- PropertyCondition.cs
- DrawingServices.cs
- DebugInfoExpression.cs
- ProcessHostFactoryHelper.cs
- NativeMethods.cs
- ConfigurationStrings.cs
- SoapReflectionImporter.cs
- XmlSerializerNamespaces.cs
- ValidationErrorCollection.cs
- MenuBindingsEditorForm.cs
- RadioButtonPopupAdapter.cs
- ExpanderAutomationPeer.cs
- ObjectConverter.cs
- CopyAction.cs
- ValidatorCollection.cs
- HwndStylusInputProvider.cs
- BoundColumn.cs
- TaskFileService.cs
- XmlSchemaType.cs
- WebFormsRootDesigner.cs
- SqlCacheDependencyDatabaseCollection.cs
- WebPartDisplayMode.cs
- SqlDependencyUtils.cs
- SystemFonts.cs
- Metafile.cs
- _UriSyntax.cs
- QilName.cs
- EncodingDataItem.cs
- RolePrincipal.cs
- ActivationServices.cs
- SecureConversationDriver.cs
- SmtpLoginAuthenticationModule.cs
- StreamResourceInfo.cs
- ChangeTracker.cs
- ManagementObjectSearcher.cs
- ObjectTag.cs
- SystemWebCachingSectionGroup.cs
- MD5CryptoServiceProvider.cs
- DetailsViewInsertedEventArgs.cs
- FlowNode.cs
- LocationReference.cs
- DataTransferEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- DataView.cs
- DataConnectionHelper.cs
- GraphicsContext.cs
- SrgsGrammarCompiler.cs
- BinHexEncoding.cs
- UnknownBitmapEncoder.cs
- ScrollChrome.cs
- FastPropertyAccessor.cs
- ProtocolElementCollection.cs
- ToolStripLabel.cs
- BulletedListDesigner.cs
- QueryRewriter.cs
- RoleService.cs
- CodeMethodInvokeExpression.cs
- SiteMap.cs
- BufferedStream2.cs
- NativeMethods.cs
- ScrollEvent.cs
- FileReader.cs
- WebPartDescriptionCollection.cs