OnChangedCallback 委托

定义

定义对某个方法的引用,该方法用于处理对被监视项的更改。Defines a reference to a method that handles changes to monitored items.

public delegate void OnChangedCallback(System::Object ^ state);
public delegate void OnChangedCallback(object state);
type OnChangedCallback = delegate of obj -> unit
Public Delegate Sub OnChangedCallback(state As Object)

参数

state
Object

已更改的依赖对象的状态。The state of the dependent object that was changed.

继承
OnChangedCallback

注解

更改监视器使用委托来向缓存实现发出信号, 指示在缓存其内容的对象中发生了更改。 OnChangedCallbackThe OnChangedCallback delegate is used by a change monitor to signal to a cache implementation that a change has occurred in an object whose contents are cached. 任何ChangeMonitor类型实现的任务都是监视缓存对象中的更改。The task of any implementation of the ChangeMonitor type is to monitor for changes in objects that are cached. 例如, 如果某个文件的内容包含在缓存条目中, 并且如果该文件已更新, 则也必须更改其相关的缓存条目。For example, if the contents of a file are contained in a cache entry, and if the file is updated, its related cache entry must be changed also. 在典型的缓存实现中, 派生ChangeMonitor实例OnChangedCallback使用委托通知缓存发生了更改。In a typical cache implementation, a derived ChangeMonitor instance uses a OnChangedCallback delegate to notify the cache about a change.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅