共用方式為


LRUCache<TKey,TValue> 類別

定義

實作最近使用最少的快取

public class LRUCache<TKey,TValue> where TValue : class, IDisposable
type LRUCache<'Key, 'Value (requires 'Value : null and 'Value :> IDisposable)> = class

類型參數

TKey

LRU 快取的索引鍵類型。

TValue

LRU 快取值的型別。

繼承
LRUCache<TKey,TValue>

建構函式

LRUCache<TKey,TValue>(Int32)

根據快取中的位置數目限制,建構 LRU 快取的新實例。

LRUCache<TKey,TValue>(Int32, Int32, Func<TValue,Int32>)

根據位置數目和記憶體大小限制,建構具有限制的 LRU 快取新實例。

屬性

Item[TKey]

擷取或設定 LRU 快取中的值

方法

Purge()

清除快取,並在快取的所有專案上呼叫 Dispose。

ToString()

適用於