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
- HelpInfo.cs
- StylusPoint.cs
- DataGridViewCheckBoxCell.cs
- DeferredSelectedIndexReference.cs
- UnsettableComboBox.cs
- SiteMapHierarchicalDataSourceView.cs
- KeyInfo.cs
- SecurityKeyType.cs
- PriorityBindingExpression.cs
- TableLayoutStyle.cs
- CurrentChangedEventManager.cs
- EntityDescriptor.cs
- Bookmark.cs
- CustomLineCap.cs
- COM2ColorConverter.cs
- CodeTypeReference.cs
- WebPartMenu.cs
- URLMembershipCondition.cs
- TextTreeTextElementNode.cs
- TCPListener.cs
- DnsPermission.cs
- HiddenFieldPageStatePersister.cs
- SmuggledIUnknown.cs
- WpfKnownTypeInvoker.cs
- DrawingDrawingContext.cs
- ListControlStringCollectionEditor.cs
- FullTextState.cs
- Model3DGroup.cs
- ConsoleKeyInfo.cs
- XPathParser.cs
- HitTestDrawingContextWalker.cs
- EntityDataSourceUtil.cs
- __TransparentProxy.cs
- BeginStoryboard.cs
- PropertyItemInternal.cs
- SqlLiftWhereClauses.cs
- Msmq4PoisonHandler.cs
- SoapElementAttribute.cs
- DataControlFieldHeaderCell.cs
- NetworkInformationPermission.cs
- BitmapEffectDrawingContextWalker.cs
- WindowsAuthenticationEventArgs.cs
- TablePatternIdentifiers.cs
- VarRemapper.cs
- HttpCookieCollection.cs
- UnknownBitmapDecoder.cs
- MailAddressCollection.cs
- SystemIcons.cs
- DiscriminatorMap.cs
- FontSizeConverter.cs
- TreeBuilder.cs
- ObjectDataSourceDisposingEventArgs.cs
- DocumentSchemaValidator.cs
- Rotation3D.cs
- AnchoredBlock.cs
- SystemColorTracker.cs
- ZipIOLocalFileDataDescriptor.cs
- GenerateTemporaryTargetAssembly.cs
- ReliableOutputConnection.cs
- LoginCancelEventArgs.cs
- DisposableCollectionWrapper.cs
- AuthenticationManager.cs
- ContentOperations.cs
- Rect3DConverter.cs
- UidPropertyAttribute.cs
- CriticalHandle.cs
- XPathBuilder.cs
- IDataContractSurrogate.cs
- WebPartDescription.cs
- StreamAsIStream.cs
- DateTimeFormatInfo.cs
- DynamicMethod.cs
- Baml2006Reader.cs
- FacetChecker.cs
- TypeDescriptionProvider.cs
- ScaleTransform.cs
- DigestTraceRecordHelper.cs
- ContainerUIElement3D.cs
- CacheRequest.cs
- KeyInfo.cs
- HttpResponseHeader.cs
- PositiveTimeSpanValidatorAttribute.cs
- TrackBar.cs
- JapaneseCalendar.cs
- Translator.cs
- RoleGroupCollection.cs
- PerformanceCountersElement.cs
- SecureConversationVersion.cs
- ForeignConstraint.cs
- WpfSharedXamlSchemaContext.cs
- LocatorBase.cs
- DocumentViewerHelper.cs
- _NestedMultipleAsyncResult.cs
- WebPartConnectionsDisconnectVerb.cs
- WmlPanelAdapter.cs
- JsonDeserializer.cs
- Utils.cs
- Content.cs
- WebHttpElement.cs
- KeyValuePair.cs