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
- SqlClientWrapperSmiStream.cs
- _Events.cs
- LowerCaseStringConverter.cs
- ChangePassword.cs
- SchemaNamespaceManager.cs
- PathFigureCollectionValueSerializer.cs
- RequiredFieldValidator.cs
- XmlSchemaSimpleTypeList.cs
- TypeLoadException.cs
- Array.cs
- SqlInternalConnectionTds.cs
- OpenFileDialog.cs
- ZoomPercentageConverter.cs
- FunctionMappingTranslator.cs
- GridView.cs
- Geometry3D.cs
- ErrorWebPart.cs
- Propagator.Evaluator.cs
- ObjectPersistData.cs
- PropertyBuilder.cs
- TextEditorSpelling.cs
- XmlComment.cs
- ProfessionalColorTable.cs
- contentDescriptor.cs
- columnmapkeybuilder.cs
- NavigationProgressEventArgs.cs
- OperationInfoBase.cs
- TreeView.cs
- HandlerMappingMemo.cs
- ConnectionManagementElement.cs
- ColumnCollection.cs
- ButtonBaseAutomationPeer.cs
- CharacterHit.cs
- TextBounds.cs
- ConstructorArgumentAttribute.cs
- XmlQueryRuntime.cs
- HttpContextServiceHost.cs
- mediaclock.cs
- ListViewGroup.cs
- Int64AnimationUsingKeyFrames.cs
- FixedSOMTableCell.cs
- XmlLoader.cs
- PrimaryKeyTypeConverter.cs
- DataAdapter.cs
- ExceptionUtility.cs
- AttributeEmitter.cs
- ClientCultureInfo.cs
- ZipFileInfo.cs
- AssemblyAttributes.cs
- HttpInputStream.cs
- XmlChildEnumerator.cs
- SubpageParaClient.cs
- ValuePattern.cs
- PageSettings.cs
- ServiceReference.cs
- IWorkflowDebuggerService.cs
- GeneralTransform3D.cs
- EventDescriptor.cs
- Process.cs
- BitmapEffectGeneralTransform.cs
- CodeNamespaceCollection.cs
- XmlTextReaderImpl.cs
- XmlValidatingReader.cs
- milexports.cs
- SerializationEventsCache.cs
- TextTreeRootTextBlock.cs
- PersonalizationStateInfo.cs
- HttpCookieCollection.cs
- CacheMemory.cs
- HostTimeoutsElement.cs
- TextProviderWrapper.cs
- DetailsViewDeletedEventArgs.cs
- ImplicitInputBrush.cs
- DBConnection.cs
- SqlComparer.cs
- FlowDocumentReaderAutomationPeer.cs
- CallSiteBinder.cs
- ControlBindingsCollection.cs
- ViewStateException.cs
- Page.cs
- LinkConverter.cs
- Bits.cs
- DateTimeValueSerializerContext.cs
- ClientConvert.cs
- GroupItem.cs
- HtmlTableRowCollection.cs
- _SslState.cs
- Form.cs
- DetailsViewPageEventArgs.cs
- PathFigure.cs
- ConsumerConnectionPoint.cs
- ChannelHandler.cs
- GroupBoxDesigner.cs
- DurationConverter.cs
- ClassHandlersStore.cs
- XmlFormatExtensionPointAttribute.cs
- ConstantSlot.cs
- Function.cs
- CloseCollectionAsyncResult.cs
- PerspectiveCamera.cs