Condividi tramite


ChangeToken.OnChange Method

Definition

Overloads

OnChange(Func<IChangeToken>, Action)

Registers the changeTokenConsumer action to be called whenever the token produced changes.

OnChange<TState>(Func<IChangeToken>, Action<TState>, TState)

Registers the changeTokenConsumer action to be called whenever the token produced changes.

OnChange(Func<IChangeToken>, Action)

Source:
ChangeToken.cs
Source:
ChangeToken.cs
Source:
ChangeToken.cs

Registers the changeTokenConsumer action to be called whenever the token produced changes.

public:
 static IDisposable ^ OnChange(Func<Microsoft::Extensions::Primitives::IChangeToken ^> ^ changeTokenProducer, Action ^ changeTokenConsumer);
public static IDisposable OnChange (Func<Microsoft.Extensions.Primitives.IChangeToken?> changeTokenProducer, Action changeTokenConsumer);
static member OnChange : Func<Microsoft.Extensions.Primitives.IChangeToken> * Action -> IDisposable
Public Shared Function OnChange (changeTokenProducer As Func(Of IChangeToken), changeTokenConsumer As Action) As IDisposable

Parameters

changeTokenProducer
Func<IChangeToken>

Produces the change token.

changeTokenConsumer
Action

Action called when the token changes.

Returns

Applies to

OnChange<TState>(Func<IChangeToken>, Action<TState>, TState)

Source:
ChangeToken.cs
Source:
ChangeToken.cs
Source:
ChangeToken.cs

Registers the changeTokenConsumer action to be called whenever the token produced changes.

public:
generic <typename TState>
 static IDisposable ^ OnChange(Func<Microsoft::Extensions::Primitives::IChangeToken ^> ^ changeTokenProducer, Action<TState> ^ changeTokenConsumer, TState state);
public static IDisposable OnChange<TState> (Func<Microsoft.Extensions.Primitives.IChangeToken?> changeTokenProducer, Action<TState> changeTokenConsumer, TState state);
static member OnChange : Func<Microsoft.Extensions.Primitives.IChangeToken> * Action<'State> * 'State -> IDisposable
Public Shared Function OnChange(Of TState) (changeTokenProducer As Func(Of IChangeToken), changeTokenConsumer As Action(Of TState), state As TState) As IDisposable

Type Parameters

TState

The type of the state for the changeTokenConsumer action.

Parameters

changeTokenProducer
Func<IChangeToken>

Produces the change token.

changeTokenConsumer
Action<TState>

Action called when the token changes.

state
TState

state for the consumer.

Returns

Applies to