Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------ // 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
- TargetConverter.cs
- EntityDataSourceState.cs
- XPathCompileException.cs
- TogglePattern.cs
- StringComparer.cs
- HMACMD5.cs
- PickBranchDesigner.xaml.cs
- ConnectionManagementSection.cs
- DynamicActivityTypeDescriptor.cs
- RangeValidator.cs
- ToolStripDropTargetManager.cs
- Util.cs
- MultiAsyncResult.cs
- SelectorItemAutomationPeer.cs
- DelayDesigner.cs
- VisualBasicSettingsConverter.cs
- ExpressionsCollectionEditor.cs
- GridView.cs
- New.cs
- User.cs
- ValueExpressions.cs
- BooleanKeyFrameCollection.cs
- NameSpaceExtractor.cs
- BoundColumn.cs
- ParameterCollection.cs
- ItemContainerProviderWrapper.cs
- DrawingVisual.cs
- PowerStatus.cs
- ExtensibleSyndicationObject.cs
- DataServiceProviderWrapper.cs
- ClientRuntimeConfig.cs
- SecurityIdentifierElement.cs
- Visual.cs
- ValidationErrorCollection.cs
- HttpException.cs
- ScrollBarRenderer.cs
- SerializationAttributes.cs
- XmlReaderSettings.cs
- AspCompat.cs
- TextDecorationCollection.cs
- MenuEventArgs.cs
- SyndicationSerializer.cs
- XmlAtomicValue.cs
- DbFunctionCommandTree.cs
- InternalResources.cs
- SectionRecord.cs
- DataTableReaderListener.cs
- DateTimeOffset.cs
- AttachmentCollection.cs
- MyContact.cs
- OdbcEnvironment.cs
- TreeViewAutomationPeer.cs
- BoolLiteral.cs
- MenuBindingsEditor.cs
- NetNamedPipeSecurityMode.cs
- TextTreeFixupNode.cs
- XmlBufferReader.cs
- Expression.cs
- TaskHelper.cs
- ExtractorMetadata.cs
- WithStatement.cs
- VectorCollection.cs
- OracleConnection.cs
- MetaModel.cs
- EntityClassGenerator.cs
- HttpPostClientProtocol.cs
- ContextBase.cs
- TimeoutException.cs
- Int16KeyFrameCollection.cs
- ReplacementText.cs
- LineSegment.cs
- StylusPointPropertyInfo.cs
- MenuItemStyleCollection.cs
- XamlTreeBuilderBamlRecordWriter.cs
- ChannelProtectionRequirements.cs
- DllNotFoundException.cs
- FixedLineResult.cs
- DataGridViewRowsAddedEventArgs.cs
- SessionEndedEventArgs.cs
- UnsafeNativeMethods.cs
- MemoryMappedViewStream.cs
- OledbConnectionStringbuilder.cs
- EventLogTraceListener.cs
- CodeCatchClauseCollection.cs
- MessageUtil.cs
- UnsafeNativeMethods.cs
- ButtonAutomationPeer.cs
- UnauthorizedAccessException.cs
- SqlCrossApplyToCrossJoin.cs
- DependencySource.cs
- messageonlyhwndwrapper.cs
- OAVariantLib.cs
- Process.cs
- ParserContext.cs
- Byte.cs
- _Rfc2616CacheValidators.cs
- StyleTypedPropertyAttribute.cs
- WebPartMovingEventArgs.cs
- PartialCachingAttribute.cs
- DetailsViewPagerRow.cs