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
- MessageAction.cs
- SQLDecimalStorage.cs
- DrawingAttributeSerializer.cs
- TableSectionStyle.cs
- PartitionedStreamMerger.cs
- Literal.cs
- SmtpReplyReader.cs
- Renderer.cs
- WmlCalendarAdapter.cs
- QilGenerator.cs
- BmpBitmapDecoder.cs
- XmlHierarchicalEnumerable.cs
- SymmetricKeyWrap.cs
- OperatingSystemVersionCheck.cs
- TemplateParser.cs
- DataRow.cs
- Dispatcher.cs
- OleCmdHelper.cs
- ElementMarkupObject.cs
- DependentTransaction.cs
- ProgramPublisher.cs
- ColorConvertedBitmap.cs
- DataGridViewImageCell.cs
- WindowsBrush.cs
- TypeUtil.cs
- ObjectDataSourceFilteringEventArgs.cs
- IsolatedStoragePermission.cs
- QuarticEase.cs
- ListDictionaryInternal.cs
- BooleanConverter.cs
- ChtmlCalendarAdapter.cs
- ColumnMapVisitor.cs
- OperationBehaviorAttribute.cs
- DropShadowBitmapEffect.cs
- FastPropertyAccessor.cs
- ExpressionNormalizer.cs
- SelectionWordBreaker.cs
- SurrogateSelector.cs
- ModelService.cs
- TraversalRequest.cs
- Int32Collection.cs
- SafeSystemMetrics.cs
- SpeakInfo.cs
- CompressedStack.cs
- Matrix3D.cs
- ListViewGroupItemCollection.cs
- Html32TextWriter.cs
- Cell.cs
- CollectionBase.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- SpellCheck.cs
- StringExpressionSet.cs
- XmlJsonWriter.cs
- X509Extension.cs
- wgx_exports.cs
- DefaultObjectMappingItemCollection.cs
- CapabilitiesState.cs
- Assembly.cs
- ObjectHelper.cs
- ReliabilityContractAttribute.cs
- FunctionImportElement.cs
- ParameterEditorUserControl.cs
- DataControlFieldsEditor.cs
- FontInfo.cs
- DiscoveryClientDuplexChannel.cs
- TextDecorationCollection.cs
- ChameleonKey.cs
- DataShape.cs
- DataGridViewCellStyleBuilderDialog.cs
- ScriptMethodAttribute.cs
- ConfigurationLoaderException.cs
- StylusTip.cs
- UndirectedGraph.cs
- DrawItemEvent.cs
- AttachedPropertyMethodSelector.cs
- TextElementCollectionHelper.cs
- WindowsFormsSynchronizationContext.cs
- EventlogProvider.cs
- WpfPayload.cs
- GZipDecoder.cs
- NativeWindow.cs
- PeerContact.cs
- PagesSection.cs
- Debug.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- DesignerTransactionCloseEvent.cs
- objectquery_tresulttype.cs
- MDIWindowDialog.cs
- XmlSchemaComplexContentExtension.cs
- PEFileEvidenceFactory.cs
- Positioning.cs
- XPathDocumentNavigator.cs
- RegexWriter.cs
- ObjectConverter.cs
- DeflateEmulationStream.cs
- RSACryptoServiceProvider.cs
- Operators.cs
- MarkupCompiler.cs
- BamlBinaryWriter.cs
- GenericEnumConverter.cs