Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Configuration / HttpCachePolicyElement.cs / 1 / HttpCachePolicyElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Net.Cache; using System.Xml; using System.Security.Permissions; public sealed class HttpCachePolicyElement : ConfigurationElement { public HttpCachePolicyElement() { this.properties.Add(this.maximumAge); this.properties.Add(this.maximumStale); this.properties.Add(this.minimumFresh); this.properties.Add(this.policyLevel); } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ConfigurationStrings.MaximumAge, DefaultValue = TimeSpanValidatorAttribute.TimeSpanMaxValue)] public TimeSpan MaximumAge { get { return (TimeSpan)this[this.maximumAge]; } set { this[this.maximumAge] = value; } } [ConfigurationProperty(ConfigurationStrings.MaximumStale, DefaultValue = TimeSpanValidatorAttribute.TimeSpanMinValue)] public TimeSpan MaximumStale { get { return (TimeSpan)this[this.maximumStale]; } set { this[this.maximumStale] = value; } } [ConfigurationProperty(ConfigurationStrings.MinimumFresh, DefaultValue = TimeSpanValidatorAttribute.TimeSpanMinValue)] public TimeSpan MinimumFresh { get { return (TimeSpan)this[this.minimumFresh]; } set { this[this.minimumFresh] = value; } } [ConfigurationProperty(ConfigurationStrings.PolicyLevel, IsRequired = true, DefaultValue = (HttpRequestCacheLevel) HttpRequestCacheLevel.Default)] public HttpRequestCacheLevel PolicyLevel { get { return (HttpRequestCacheLevel)this[this.policyLevel]; } set { this[this.policyLevel] = value; } } protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey) { wasReadFromConfig = true; base.DeserializeElement(reader, serializeCollectionKey); } protected override void Reset(ConfigurationElement parentElement ) { if (parentElement != null) { HttpCachePolicyElement http = (HttpCachePolicyElement)parentElement; this.wasReadFromConfig = http.wasReadFromConfig; } base.Reset(parentElement ); } internal bool WasReadFromConfig { get { return this.wasReadFromConfig; } } bool wasReadFromConfig = false; ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty maximumAge = new ConfigurationProperty(ConfigurationStrings.MaximumAge, typeof(TimeSpan), TimeSpan.MaxValue, ConfigurationPropertyOptions.None); readonly ConfigurationProperty maximumStale = new ConfigurationProperty(ConfigurationStrings.MaximumStale, typeof(TimeSpan), TimeSpan.MinValue, ConfigurationPropertyOptions.None); readonly ConfigurationProperty minimumFresh = new ConfigurationProperty(ConfigurationStrings.MinimumFresh, typeof(TimeSpan), TimeSpan.MinValue, ConfigurationPropertyOptions.None); readonly ConfigurationProperty policyLevel = new ConfigurationProperty(ConfigurationStrings.PolicyLevel, typeof(HttpRequestCacheLevel), HttpRequestCacheLevel.Default, ConfigurationPropertyOptions.None); } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SortQuery.cs
- ContractListAdapter.cs
- GradientStop.cs
- LinkLabelLinkClickedEvent.cs
- DependencyPropertyDescriptor.cs
- ConfigDefinitionUpdates.cs
- WebPartVerb.cs
- EntityParameterCollection.cs
- TdsEnums.cs
- Filter.cs
- SqlFlattener.cs
- SafeCoTaskMem.cs
- AssertValidation.cs
- ProxyWebPartConnectionCollection.cs
- Attributes.cs
- MessageHeaders.cs
- IPEndPointCollection.cs
- IndexerNameAttribute.cs
- DbDataSourceEnumerator.cs
- PagerSettings.cs
- _RequestCacheProtocol.cs
- PackWebRequest.cs
- StaticTextPointer.cs
- WindowsEditBoxRange.cs
- RoleManagerEventArgs.cs
- DynamicUpdateCommand.cs
- Point4D.cs
- ScriptManager.cs
- ActiveXSerializer.cs
- SQLString.cs
- DirtyTextRange.cs
- TextLineResult.cs
- DataRowChangeEvent.cs
- HashJoinQueryOperatorEnumerator.cs
- SelectionGlyphBase.cs
- ToolBarPanel.cs
- ThicknessAnimationBase.cs
- DataGridRelationshipRow.cs
- Tokenizer.cs
- FirstMatchCodeGroup.cs
- AdornerPresentationContext.cs
- MsmqBindingFilter.cs
- SqlBulkCopy.cs
- Dynamic.cs
- FixedHighlight.cs
- RuleEngine.cs
- Query.cs
- BaseParagraph.cs
- SecureStringHasher.cs
- ConstructorBuilder.cs
- XmlAttributeAttribute.cs
- ColumnCollection.cs
- FileReader.cs
- XmlAnyElementAttributes.cs
- RuntimeEnvironment.cs
- unitconverter.cs
- DbUpdateCommandTree.cs
- LogPolicy.cs
- KnownTypesProvider.cs
- NumericUpDownAcceleration.cs
- XmlBindingWorker.cs
- SqlGenericUtil.cs
- GenericPrincipal.cs
- DescendentsWalker.cs
- uribuilder.cs
- SpecialFolderEnumConverter.cs
- PixelFormats.cs
- ToolStripTextBox.cs
- CorrelationKeyCalculator.cs
- Int16AnimationUsingKeyFrames.cs
- DbParameterCollectionHelper.cs
- OpenTypeLayout.cs
- TraceContext.cs
- XmlUTF8TextReader.cs
- DiscreteKeyFrames.cs
- EntityProxyFactory.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ImageField.cs
- Instrumentation.cs
- TypeReference.cs
- DelegatedStream.cs
- ReadOnlyDataSourceView.cs
- ConfigurationValidatorAttribute.cs
- ExpressionParser.cs
- FullTrustAssembliesSection.cs
- StructuredProperty.cs
- PointUtil.cs
- TextBoxAutomationPeer.cs
- CustomExpressionEventArgs.cs
- shaper.cs
- SafeRegistryKey.cs
- MaskedTextProvider.cs
- TableCellCollection.cs
- BindingsCollection.cs
- dsa.cs
- _LocalDataStoreMgr.cs
- NativeRightsManagementAPIsStructures.cs
- ExpressionValueEditor.cs
- XmlNamespaceDeclarationsAttribute.cs
- LifetimeServices.cs