Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / HttpCachePolicyElement.cs / 1305376 / 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); } } // 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
- JapaneseCalendar.cs
- XpsStructure.cs
- PopupControlService.cs
- DifferencingCollection.cs
- FixedStringLookup.cs
- LoginStatusDesigner.cs
- DrawingGroup.cs
- CodeMemberEvent.cs
- JavaScriptSerializer.cs
- CompositeDataBoundControl.cs
- XmlNotation.cs
- MD5Cng.cs
- CacheOutputQuery.cs
- StatusBarPanelClickEvent.cs
- SqlDataSourceStatusEventArgs.cs
- XmlLanguage.cs
- UIInitializationException.cs
- DataPagerFieldCommandEventArgs.cs
- ToolboxItemAttribute.cs
- FrameworkContextData.cs
- Walker.cs
- SafeViewOfFileHandle.cs
- SmtpTransport.cs
- FilterElement.cs
- RegexCode.cs
- HtmlElement.cs
- HitTestParameters.cs
- ToolStripLocationCancelEventArgs.cs
- XmlSchemaSimpleType.cs
- WindowVisualStateTracker.cs
- SchemaTypeEmitter.cs
- SqlDataSourceDesigner.cs
- TimeZoneNotFoundException.cs
- FunctionUpdateCommand.cs
- OutputCacheProfileCollection.cs
- DbConnectionHelper.cs
- SynchronizedDispatch.cs
- SizeChangedEventArgs.cs
- CompiledQueryCacheEntry.cs
- HuffModule.cs
- ProfileParameter.cs
- ExpressionPrefixAttribute.cs
- TextPointerBase.cs
- XamlValidatingReader.cs
- Pair.cs
- AssemblyBuilder.cs
- XamlGridLengthSerializer.cs
- MtomMessageEncodingBindingElement.cs
- SqlUtils.cs
- ConfigurationManagerHelperFactory.cs
- GlobalId.cs
- input.cs
- MethodBody.cs
- SchemaConstraints.cs
- Automation.cs
- UriTemplateVariablePathSegment.cs
- WebOperationContext.cs
- GeneralTransform3DGroup.cs
- Color.cs
- FrameworkElement.cs
- EventLogPermissionEntryCollection.cs
- securitycriticaldata.cs
- SuppressMergeCheckAttribute.cs
- OracleTimeSpan.cs
- GraphicsPath.cs
- ContentElement.cs
- DataControlImageButton.cs
- ExpressionBindingCollection.cs
- SafeFileMapViewHandle.cs
- StorageConditionPropertyMapping.cs
- GeneralTransform3DCollection.cs
- PageThemeParser.cs
- _WebProxyDataBuilder.cs
- XmlBoundElement.cs
- XmlSerializationGeneratedCode.cs
- PropertyStore.cs
- IisTraceWebEventProvider.cs
- ReflectPropertyDescriptor.cs
- mediapermission.cs
- CapacityStreamGeometryContext.cs
- SafeCloseHandleCritical.cs
- CurrentChangingEventManager.cs
- CaretElement.cs
- DynamicILGenerator.cs
- TextTreeExtractElementUndoUnit.cs
- DbException.cs
- UnregisterInfo.cs
- RuntimeConfigLKG.cs
- HelpKeywordAttribute.cs
- ClientBuildManagerCallback.cs
- SafeFileMapViewHandle.cs
- SspiNegotiationTokenProviderState.cs
- MailDefinition.cs
- GZipStream.cs
- HostingPreferredMapPath.cs
- RootAction.cs
- Stacktrace.cs
- ProtocolViolationException.cs
- InternalSafeNativeMethods.cs
- LoadWorkflowCommand.cs