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
- PropertyGroupDescription.cs
- CreateParams.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- PointKeyFrameCollection.cs
- TextWriterTraceListener.cs
- ImmutableObjectAttribute.cs
- ContentPathSegment.cs
- ComponentChangingEvent.cs
- ApplicationServiceManager.cs
- ProcessHostMapPath.cs
- RepeaterItemCollection.cs
- PropertyMetadata.cs
- TimelineCollection.cs
- DebugInfoGenerator.cs
- TabControlCancelEvent.cs
- Attributes.cs
- CodePrimitiveExpression.cs
- ExceptionTranslationTable.cs
- XmlSchemaComplexContentExtension.cs
- InheritedPropertyDescriptor.cs
- TextPointer.cs
- FtpWebRequest.cs
- MonitorWrapper.cs
- EntityContainerEmitter.cs
- TreeViewItemAutomationPeer.cs
- WindowsListBox.cs
- CompilationLock.cs
- LinqDataView.cs
- AutoGeneratedField.cs
- RNGCryptoServiceProvider.cs
- ZoneLinkButton.cs
- IERequestCache.cs
- DPAPIProtectedConfigurationProvider.cs
- CompositeDuplexBindingElement.cs
- CreateParams.cs
- KeyManager.cs
- HtmlControlPersistable.cs
- KeyGestureValueSerializer.cs
- AnnotationResource.cs
- WebConfigurationManager.cs
- SparseMemoryStream.cs
- Recipient.cs
- EventLogInternal.cs
- DataGridViewAdvancedBorderStyle.cs
- Compiler.cs
- BindingSource.cs
- GeometryModel3D.cs
- SQLConvert.cs
- PeerDuplexChannel.cs
- wmiutil.cs
- MetadataItem.cs
- SqlTriggerContext.cs
- Accessors.cs
- CompareValidator.cs
- BitmapCacheBrush.cs
- odbcmetadatacolumnnames.cs
- Scalars.cs
- PropertyEntry.cs
- ExpressionBuilder.cs
- Scalars.cs
- UrlMappingCollection.cs
- Rfc2898DeriveBytes.cs
- httpapplicationstate.cs
- DesignTimeParseData.cs
- XmlSchemaAnnotated.cs
- BamlBinaryReader.cs
- EntityDataSourceMemberPath.cs
- NativeMethods.cs
- RadialGradientBrush.cs
- streamingZipPartStream.cs
- BinaryMessageEncodingElement.cs
- FileUpload.cs
- PropertyDescriptorComparer.cs
- basevalidator.cs
- PointF.cs
- DesignerProperties.cs
- DefaultProxySection.cs
- BitArray.cs
- StylusDownEventArgs.cs
- AssemblyName.cs
- ConfigXmlAttribute.cs
- FormsAuthenticationUserCollection.cs
- ImportCatalogPart.cs
- InvokerUtil.cs
- DispatchWrapper.cs
- EntityDataSourceDesignerHelper.cs
- ErrorFormatter.cs
- SQLUtility.cs
- Literal.cs
- ExplicitDiscriminatorMap.cs
- GridViewEditEventArgs.cs
- ThreadPoolTaskScheduler.cs
- DtrList.cs
- AnnotationResourceChangedEventArgs.cs
- Grammar.cs
- DataObjectEventArgs.cs
- EventItfInfo.cs
- Quaternion.cs
- ZoomPercentageConverter.cs
- ControlBuilder.cs