ChangeToken.OnChange Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OnChange(Func<IChangeToken>, Action) |
Registers the |
OnChange<TState>(Func<IChangeToken>, Action<TState>, TState) |
Registers the |
OnChange(Func<IChangeToken>, Action)
- Source:
- ChangeToken.cs
- 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);
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
- 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);
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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應