Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewToolTip.cs
- Rijndael.cs
- HtmlInputFile.cs
- FixedSOMTableCell.cs
- Mutex.cs
- CodeIterationStatement.cs
- GroupBoxAutomationPeer.cs
- HtmlMobileTextWriter.cs
- ScalarType.cs
- CodeNamespaceImportCollection.cs
- FileDialog_Vista.cs
- GacUtil.cs
- SendDesigner.xaml.cs
- IndexedEnumerable.cs
- BoundField.cs
- UnsafeNativeMethods.cs
- TransformerTypeCollection.cs
- RegexCapture.cs
- MouseButton.cs
- DataSysAttribute.cs
- FirstMatchCodeGroup.cs
- AssemblyInfo.cs
- loginstatus.cs
- Menu.cs
- RegexMatchCollection.cs
- DragStartedEventArgs.cs
- ErrorHandler.cs
- StreamingContext.cs
- XmlTypeMapping.cs
- ResourceIDHelper.cs
- EntityWithChangeTrackerStrategy.cs
- HttpWebRequestElement.cs
- TransformBlockRequest.cs
- CodeConditionStatement.cs
- SecUtil.cs
- PolicyException.cs
- DateTimeSerializationSection.cs
- RestHandlerFactory.cs
- Profiler.cs
- SamlAttributeStatement.cs
- ComponentEditorPage.cs
- EditorZone.cs
- CreateUserWizard.cs
- TableLayoutCellPaintEventArgs.cs
- FixedMaxHeap.cs
- TimeManager.cs
- SchemaTypeEmitter.cs
- SafeLocalMemHandle.cs
- PasswordRecovery.cs
- EntityModelBuildProvider.cs
- WpfMemberInvoker.cs
- TreeViewBindingsEditorForm.cs
- XmlSchemaExporter.cs
- ByteStorage.cs
- MergeFailedEvent.cs
- OleDbCommandBuilder.cs
- SupportingTokenProviderSpecification.cs
- XmlLanguageConverter.cs
- FrameworkContentElement.cs
- BlobPersonalizationState.cs
- TraceContextEventArgs.cs
- Label.cs
- AppDomainShutdownMonitor.cs
- NameValueCollection.cs
- TextBox.cs
- IgnoreDataMemberAttribute.cs
- XmlSchemaSubstitutionGroup.cs
- BuildProviderCollection.cs
- Int64Animation.cs
- TabControl.cs
- FontEmbeddingManager.cs
- SystemWebExtensionsSectionGroup.cs
- RowToParametersTransformer.cs
- ListViewGroup.cs
- ScrollItemProviderWrapper.cs
- MemberInfoSerializationHolder.cs
- ProcessInputEventArgs.cs
- KerberosReceiverSecurityToken.cs
- EventMap.cs
- CodeGroup.cs
- NativeActivityFaultContext.cs
- RegexCompiler.cs
- ToolBar.cs
- SecurityTokenAuthenticator.cs
- Root.cs
- FormsAuthenticationConfiguration.cs
- ContentIterators.cs
- ApplicationActivator.cs
- GeometryModel3D.cs
- SafeSerializationManager.cs
- TableItemStyle.cs
- NotifyParentPropertyAttribute.cs
- ScriptReference.cs
- JsonSerializer.cs
- AttributedMetaModel.cs
- WebPartPersonalization.cs
- SqlClientFactory.cs
- COM2ColorConverter.cs
- mansign.cs
- DefaultBindingPropertyAttribute.cs