Code:
/ DotNET / DotNET / 8.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
- UxThemeWrapper.cs
- NameValuePair.cs
- ThicknessAnimationBase.cs
- VolatileEnlistmentMultiplexing.cs
- ModelVisual3D.cs
- ChannelSinkStacks.cs
- ModifyActivitiesPropertyDescriptor.cs
- Subset.cs
- ContourSegment.cs
- Blend.cs
- SoapMessage.cs
- Directory.cs
- MasterPageCodeDomTreeGenerator.cs
- BufferedWebEventProvider.cs
- WebEvents.cs
- VariableQuery.cs
- XmlSchemaInclude.cs
- PathData.cs
- DispatcherTimer.cs
- XmlProcessingInstruction.cs
- CheckBox.cs
- TreeNodeStyle.cs
- CaseStatement.cs
- WebPartDeleteVerb.cs
- Attributes.cs
- SQLDecimalStorage.cs
- HostingEnvironmentException.cs
- ServiceDiscoveryElement.cs
- Comparer.cs
- DataKey.cs
- LineSegment.cs
- SqlDataSourceCommandParser.cs
- ProcessHostConfigUtils.cs
- SoapFaultCodes.cs
- CompositeControlDesigner.cs
- ConfigXmlText.cs
- metadatamappinghashervisitor.cs
- HttpWebRequestElement.cs
- SynchronizationContextHelper.cs
- DataGridViewRowPrePaintEventArgs.cs
- ObjectDisposedException.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- FileAuthorizationModule.cs
- DefaultTypeArgumentAttribute.cs
- PersistNameAttribute.cs
- ColumnTypeConverter.cs
- CompiledQuery.cs
- PolicyVersionConverter.cs
- ImageMapEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- SelectionUIHandler.cs
- StatusCommandUI.cs
- IncrementalCompileAnalyzer.cs
- QilDataSource.cs
- JavaScriptString.cs
- StringDictionaryEditor.cs
- DataSourceControl.cs
- ObjectDataSourceSelectingEventArgs.cs
- login.cs
- ExeContext.cs
- RoleBoolean.cs
- SiteMapHierarchicalDataSourceView.cs
- PersonalizationProvider.cs
- RelationshipFixer.cs
- PictureBoxDesigner.cs
- MinimizableAttributeTypeConverter.cs
- RenderOptions.cs
- UIElement3DAutomationPeer.cs
- messageonlyhwndwrapper.cs
- DescendantBaseQuery.cs
- InfoCardTraceRecord.cs
- TypedServiceChannelBuilder.cs
- X509SubjectKeyIdentifierClause.cs
- ColumnCollection.cs
- X509Certificate.cs
- BoundingRectTracker.cs
- NavigationPropertyEmitter.cs
- ModuleBuilderData.cs
- PageAsyncTask.cs
- ConfigurationValidatorAttribute.cs
- MultiBindingExpression.cs
- ToolTip.cs
- AssemblyName.cs
- SecurityRuntime.cs
- MimeMapping.cs
- LayoutInformation.cs
- XmlSchemaInfo.cs
- TextRangeProviderWrapper.cs
- WebPartConnectionsDisconnectVerb.cs
- EditCommandColumn.cs
- TextBoxBase.cs
- CodeExporter.cs
- Facet.cs
- SemanticResolver.cs
- MethodExpr.cs
- CodeBinaryOperatorExpression.cs
- DataSysAttribute.cs
- Oci.cs
- SettingsContext.cs
- OleDbPermission.cs