CancellationChangeToken.RegisterChangeCallback 方法

定义

注册将在项更改时调用的回叫。 调用回调之前,必须设置 HasChanged

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

参数

callback
Action<Object>

要调用的 Action<T>

state
Object

要传递给该回叫的状态。

返回

IDisposable

可用于注销回叫的 IDisposable

实现

适用于