Struct ActivityMonitorExtension.DependentSender
Offers dependent token creation and launching.
Inherited Members
Namespace: CK.Core
Assembly: CK.ActivityMonitor.dll
Syntax
public struct DependentSender
Methods
| Improve this Doc View SourceCreateToken(Boolean)
Creates a token for a dependent activity that will use the current monitor's topic.
By default (when delayedLaunch is false), a line with CreateDependentActivity is logged that describes the creation of the token.
If delayedLaunch is true, the actual launch of the dependent activity must be signaled thanks to Launch(ActivityMonitor.DependentToken) (otherwise there will be no way to bind the two activities).
Declaration
public ActivityMonitor.DependentToken CreateToken(bool delayedLaunch = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | delayedLaunch | True to use Launch(ActivityMonitor.DependentToken) later to indicate the actual launch of the dependent activity. |
Returns
| Type | Description |
|---|---|
| ActivityMonitor.DependentToken | A dependent token. |
CreateTokenWithTopic(String, Boolean)
Creates a token for a dependent activity that will be bound to a specified topic (or that will not change the dependent monitor's topic if null is specified).
By default (when delayedLaunch is false), a line with CreateDependentActivity is logged that describes the creation of the token.
If delayedLaunch is true, the actual launch of the dependent activity must be signaled thanks to Launch(ActivityMonitor.DependentToken) (otherwise there will be no way to bind the two activities).
Declaration
public ActivityMonitor.DependentToken CreateTokenWithTopic(string dependentTopic, bool delayedLaunch = false)
Parameters
| Type | Name | Description |
|---|---|---|
| String | dependentTopic | Topic for the dependent activity. Use null to not change the dependent monitor's topic. |
| Boolean | delayedLaunch | True to use Launch(ActivityMonitor.DependentToken) later to indicate the actual launch of the dependent activity. |
Returns
| Type | Description |
|---|---|
| ActivityMonitor.DependentToken | A dependent token. |
Launch(ActivityMonitor.DependentToken)
Signals the launch of one or more dependent activities by emitting a log line that describes the token. The token must have been created by CreateToken(Boolean) or CreateTokenWithTopic(String, Boolean) with a true delayedLaunch parameter otherwise an InvalidOperationException is thrown.
Declaration
public void Launch(ActivityMonitor.DependentToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| ActivityMonitor.DependentToken | token | Dependent token. |
Launch(Action<ActivityMonitor.DependentToken>)
Launches one or more dependent activities (thanks to a delegate) that will use the current monitor's topic. This creates a new ActivityMonitor.DependentToken and opens a group that wraps the execution of the dependentLauncher.
Declaration
public void Launch(Action<ActivityMonitor.DependentToken> dependentLauncher)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<ActivityMonitor.DependentToken> | dependentLauncher | Must create and launch dependent activities that should use the created token. |
LaunchWithTopic(Action<ActivityMonitor.DependentToken>, String)
Launches one or more dependent activities (thanks to a delegate) that will be bound to a specified topic (or that will not change the dependent monitor's topic if null is specified). This creates a new ActivityMonitor.DependentToken and opens a group that wraps the execution of the dependentLauncher.
Declaration
public void LaunchWithTopic(Action<ActivityMonitor.DependentToken> dependentLauncher, string dependentTopic)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<ActivityMonitor.DependentToken> | dependentLauncher | Must create and launch dependent activities that should use the created token. |
| String | dependentTopic | Topic for the dependent activity. When null, the dependent monitor's topic is not changed. |