Partilhar via


StreamStorageMonitor<TKey> Constructor

Definition

Creates a StreamStorageMonitor

public StreamStorageMonitor (Microsoft.VisualStudio.Utilities.IStreamStorage<TKey> storage, int maxStreamCount, long maxStorageSize, bool enable = true, System.Collections.Generic.IEqualityComparer<TKey> keyComparer = default);
new Microsoft.VisualStudio.Utilities.StreamStorageMonitor<'Key> : Microsoft.VisualStudio.Utilities.IStreamStorage<'Key> * int * int64 * bool * System.Collections.Generic.IEqualityComparer<'Key> -> Microsoft.VisualStudio.Utilities.StreamStorageMonitor<'Key>
Public Sub New (storage As IStreamStorage(Of TKey), maxStreamCount As Integer, maxStorageSize As Long, Optional enable As Boolean = true, Optional keyComparer As IEqualityComparer(Of TKey) = Nothing)

Parameters

storage
IStreamStorage<TKey>

The stream storage object to monitor. The storage object must implement IStreamStorageEvents<TKey>.

maxStreamCount
Int32

The maximum number of streams permitted in the storage. If the number of streams exceeds maxStreamCount, streams are deleted in least-recently-accessed order. If maxStreamCount is -1, there is no limit on the number of streams.

maxStorageSize
Int64

The maximum cumulative size of the streams permitted in the storage. If cumulative size of the streams exceeds maxStorageSize, streams are deleted in least-recently-accessed order. If maxStorageSize is -1, there is no limit on the cumulative size of the streams.

enable
Boolean

Indicates whether the monitor will be initially enabled.

keyComparer
IEqualityComparer<TKey>

The equality comparer used to compare the keys in the storage. If this value is null, the default equality comparer for TKey is used.

Applies to