IChangeToken.RegisterChangeCallback(Action<Object>, Object) 方法

定义

注册将在项更改时调用的回叫。Registers for a callback that will be invoked when the entry has changed. 调用回叫之前,必须设置 HasChangedHasChanged MUST be set before the callback is invoked.

public:
 IDisposable ^ RegisterChangeCallback(Action<System::Object ^> ^ callback, System::Object ^ state);
public IDisposable RegisterChangeCallback (Action<object> callback, object state);
abstract member RegisterChangeCallback : Action<obj> * obj -> IDisposable
Public Function RegisterChangeCallback (callback As Action(Of Object), state As Object) As IDisposable

参数

callback
Action<Object>

要调用的 Action<T>The Action<T> to invoke.

state
Object

要传递给该回叫的状态。State to be passed into the callback.

返回

IDisposable

可用于注销回叫的 IDisposableAn IDisposable that is used to unregister the callback.

适用于