ObjectCache.CreateCacheEntryChangeMonitor(IEnumerable<String>, String) ObjectCache.CreateCacheEntryChangeMonitor(IEnumerable<String>, String) ObjectCache.CreateCacheEntryChangeMonitor(IEnumerable<String>, String) Method

定义

在派生类中重写时,创建一个 CacheEntryChangeMonitor 对象,该对象可触发事件以响应对指定缓存项的更改。When overridden in a derived class, creates a CacheEntryChangeMonitor object that can trigger events in response to changes to specified cache entries.

public abstract System.Runtime.Caching.CacheEntryChangeMonitor CreateCacheEntryChangeMonitor (System.Collections.Generic.IEnumerable<string> keys, string regionName = null);
abstract member CreateCacheEntryChangeMonitor : seq<string> * string -> System.Runtime.Caching.CacheEntryChangeMonitor
Public MustOverride Function CreateCacheEntryChangeMonitor (keys As IEnumerable(Of String), Optional regionName As String = null) As CacheEntryChangeMonitor

参数

keys
IEnumerable<String>

要监视的缓存项的唯一标识符。The unique identifiers for cache entries to monitor.

regionName
String String String

可选。Optional. 缓存中包含 keys 参数中的缓存键的命名区域(如果实现了区域)。A named region in the cache where the cache keys in the keys parameter exist, if regions are implemented. 可选参数的默认值为 nullThe default value for the optional parameter is null.

返回

用于监视缓存中的缓存项的更改监视器。A change monitor that monitors cache entries in the cache.

注解

当派生ObjectCache类重写基CreateCacheEntryChangeMonitor方法时, CacheEntryChangeMonitor缓存实现必须创建对象。When a derived ObjectCache class overrides the base CreateCacheEntryChangeMonitor method, the cache implementation must create a CacheEntryChangeMonitor object. keys参数中指定的缓存项发生更改时, 此专用更改监视器会通知调用方。This specialized change monitor notifies callers when there are changes to the cache entries that are specified in the keys parameter. 例如, 如果从缓存中更新或删除keys了参数中的监视项, 则此方法创建的更改监视器会触发一个事件。For example, if a monitored item in the keys parameter is updated or removed from the cache, the change monitor created by this method triggers an event.

如果缓存实现支持命名缓存区域, 则可以将字符串值指定为regionName参数。If a cache implementation supports named cache regions, a string value can be specified as the regionName parameter. 否则, 参数默认为nullOtherwise, the parameter defaults to null.

备注

并非所有缓存实现都支持缓存输入更改监视器。Not all cache implementations support cache-entry change monitors. 若要确定缓存实现是否支持CacheEntryChangeMonitor对象, 请参阅特定缓存实现的文档。To determine whether your cache implementation supports CacheEntryChangeMonitor objects, see the documentation for the specific cache implementation.

适用于