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
- ListItemCollection.cs
- HostedHttpRequestAsyncResult.cs
- TextServicesDisplayAttribute.cs
- ActivitiesCollection.cs
- SqlColumnizer.cs
- ReaderWriterLock.cs
- StreamGeometryContext.cs
- DataGridViewRowCancelEventArgs.cs
- Command.cs
- SafeFileHandle.cs
- ButtonFieldBase.cs
- SystemWebExtensionsSectionGroup.cs
- LayoutDump.cs
- HwndMouseInputProvider.cs
- WebPartActionVerb.cs
- PackagingUtilities.cs
- AspNetSynchronizationContext.cs
- FileChangesMonitor.cs
- RemotingAttributes.cs
- PhysicalFontFamily.cs
- LinearKeyFrames.cs
- TabControlCancelEvent.cs
- OracleString.cs
- IOThreadScheduler.cs
- SimpleRecyclingCache.cs
- SoapReflectionImporter.cs
- SerializerDescriptor.cs
- IRCollection.cs
- HelloOperationAsyncResult.cs
- ApplicationActivator.cs
- ToolBarTray.cs
- Token.cs
- DependentList.cs
- Utils.cs
- UIAgentRequest.cs
- QueryCacheManager.cs
- RecipientInfo.cs
- DesignerHelpers.cs
- TextBoxRenderer.cs
- FlatButtonAppearance.cs
- ListViewItemCollectionEditor.cs
- BinaryFormatterWriter.cs
- MetadataItem_Static.cs
- BamlBinaryReader.cs
- XmlNamedNodeMap.cs
- DockPanel.cs
- X509Certificate.cs
- SafeViewOfFileHandle.cs
- __ConsoleStream.cs
- ISSmlParser.cs
- GroupJoinQueryOperator.cs
- WindowsStatic.cs
- EventHandlerList.cs
- DbInsertCommandTree.cs
- XmlSerializerSection.cs
- Coordinator.cs
- SQLCharsStorage.cs
- HierarchicalDataBoundControl.cs
- SqlSupersetValidator.cs
- SpotLight.cs
- Activator.cs
- RequestQueryParser.cs
- CultureTable.cs
- CodeVariableReferenceExpression.cs
- SchemaNames.cs
- IPPacketInformation.cs
- TemplatedWizardStep.cs
- UniqueIdentifierService.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- FrameworkElementFactory.cs
- SequenceDesignerAccessibleObject.cs
- EnumBuilder.cs
- StreamInfo.cs
- Win32.cs
- LiteralText.cs
- DropShadowBitmapEffect.cs
- PageContentCollection.cs
- StringBuilder.cs
- KnownBoxes.cs
- FtpRequestCacheValidator.cs
- TraceProvider.cs
- ConfigurationProperty.cs
- EditorPartChrome.cs
- UniqueConstraint.cs
- OSFeature.cs
- HttpCacheVary.cs
- UrlPath.cs
- XmlCDATASection.cs
- HttpWebResponse.cs
- ScrollableControl.cs
- XmlDataCollection.cs
- Rect3DValueSerializer.cs
- WebPartMovingEventArgs.cs
- DefaultBindingPropertyAttribute.cs
- DocumentViewer.cs
- TypeConstant.cs
- ProviderCommandInfoUtils.cs
- EmissiveMaterial.cs
- ObjectParameterCollection.cs
- StrongNameSignatureInformation.cs