Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / System.Runtime.DurableInstancing / System / Runtime / Collections / ObjectCacheSettings.cs / 1305376 / ObjectCacheSettings.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.Runtime.Collections
{
class ObjectCacheSettings
{
int cacheLimit;
TimeSpan idleTimeout;
TimeSpan leaseTimeout;
int purgeFrequency;
const int DefaultCacheLimit = 64;
const int DefaultPurgeFrequency = 32;
static TimeSpan DefaultIdleTimeout = TimeSpan.FromMinutes(2);
static TimeSpan DefaultLeaseTimeout = TimeSpan.FromMinutes(5);
public ObjectCacheSettings()
{
this.CacheLimit = DefaultCacheLimit;
this.IdleTimeout = DefaultIdleTimeout;
this.LeaseTimeout = DefaultLeaseTimeout;
this.PurgeFrequency = DefaultPurgeFrequency;
}
ObjectCacheSettings(ObjectCacheSettings other)
{
this.CacheLimit = other.CacheLimit;
this.IdleTimeout = other.IdleTimeout;
this.LeaseTimeout = other.LeaseTimeout;
this.PurgeFrequency = other.PurgeFrequency;
}
internal ObjectCacheSettings Clone()
{
return new ObjectCacheSettings(this);
}
public int CacheLimit
{
get
{
return this.cacheLimit;
}
set
{
Fx.Assert(value >= 0, "caller should validate cache limit is non-negative");
this.cacheLimit = value;
}
}
public TimeSpan IdleTimeout
{
get
{
return this.idleTimeout;
}
set
{
Fx.Assert(value >= TimeSpan.Zero, "caller should validate cache limit is non-negative");
this.idleTimeout = value;
}
}
public TimeSpan LeaseTimeout
{
get
{
return this.leaseTimeout;
}
set
{
Fx.Assert(value >= TimeSpan.Zero, "caller should validate cache limit is non-negative");
this.leaseTimeout = value;
}
}
public int PurgeFrequency
{
get
{
return this.purgeFrequency;
}
set
{
Fx.Assert(value >= 0, "caller should validate purge frequency is non-negative");
this.purgeFrequency = value;
}
}
}
}
// 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
- EndEvent.cs
- DataGridViewButtonCell.cs
- DocumentAutomationPeer.cs
- WebPartVerbsEventArgs.cs
- AssemblyCollection.cs
- PropertyGeneratedEventArgs.cs
- Typeface.cs
- RegionInfo.cs
- TreeView.cs
- RubberbandSelector.cs
- StorageComplexPropertyMapping.cs
- CopyAction.cs
- CLSCompliantAttribute.cs
- AdornerHitTestResult.cs
- RegexCaptureCollection.cs
- DnsEndPoint.cs
- WebPartDisplayModeCancelEventArgs.cs
- NetDispatcherFaultException.cs
- SpellerError.cs
- DataServicePagingProviderWrapper.cs
- EncodingInfo.cs
- XamlVector3DCollectionSerializer.cs
- PrintPreviewGraphics.cs
- MsmqIntegrationProcessProtocolHandler.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- TdsValueSetter.cs
- XamlDesignerSerializationManager.cs
- SEHException.cs
- RtfControls.cs
- StackBuilderSink.cs
- ErrorsHelper.cs
- DataRowExtensions.cs
- UnauthorizedAccessException.cs
- WindowsFormsLinkLabel.cs
- AnnotationHelper.cs
- ResXFileRef.cs
- XmlQueryCardinality.cs
- StaticExtension.cs
- DefaultPrintController.cs
- BoundPropertyEntry.cs
- MetadataItemEmitter.cs
- AspNetHostingPermission.cs
- RowSpanVector.cs
- XmlSchemaSimpleTypeList.cs
- TimeManager.cs
- SHA256.cs
- UnionExpr.cs
- TypeDelegator.cs
- UIServiceHelper.cs
- ButtonBase.cs
- RequiredFieldValidator.cs
- HtmlSelect.cs
- UidPropertyAttribute.cs
- WebServicesDescriptionAttribute.cs
- ChildrenQuery.cs
- DataGridViewAccessibleObject.cs
- SBCSCodePageEncoding.cs
- EDesignUtil.cs
- TreeNodeStyleCollection.cs
- DebugTrace.cs
- SqlInternalConnection.cs
- WebServiceTypeData.cs
- HttpProfileBase.cs
- ParamArrayAttribute.cs
- TrackingCondition.cs
- BezierSegment.cs
- StrokeFIndices.cs
- MultiTrigger.cs
- HostingEnvironmentSection.cs
- TextServicesManager.cs
- NetworkAddressChange.cs
- TriggerAction.cs
- WebPartCollection.cs
- DataRecordInfo.cs
- X509CertificateValidator.cs
- Matrix3DValueSerializer.cs
- Metafile.cs
- StylusEditingBehavior.cs
- Baml2006ReaderFrame.cs
- Aes.cs
- DecimalAnimationUsingKeyFrames.cs
- ImpersonationContext.cs
- XmlNodeReader.cs
- Rotation3DAnimationUsingKeyFrames.cs
- QuaternionKeyFrameCollection.cs
- TextTreeNode.cs
- StringPropertyBuilder.cs
- FrameworkElementFactoryMarkupObject.cs
- SEHException.cs
- CompiledRegexRunnerFactory.cs
- TextTreeDeleteContentUndoUnit.cs
- ToolStripContentPanelRenderEventArgs.cs
- BypassElement.cs
- FloaterBaseParagraph.cs
- Timeline.cs
- bidPrivateBase.cs
- TextCharacters.cs
- ConfigXmlWhitespace.cs
- PTProvider.cs
- DataGridViewRowPrePaintEventArgs.cs