Interface IActivityMonitorOutput
Offers IActivityMonitorClient registration/unregistration and exposes a BridgeTarget (an ActivityMonitorBridgeTarget) that can be used to accept logs from other monitors.
Namespace: CK.Core
Assembly: CK.ActivityMonitor.dll
Syntax
public interface IActivityMonitorOutput
Properties
| Improve this Doc View SourceBridgeTarget
Gets an entry point for other monitors: by registering ActivityMonitorBridge in other Output bound to this ActivityMonitorBridgeTarget, log streams can easily be merged.
Declaration
ActivityMonitorBridgeTarget BridgeTarget { get; }
Property Value
| Type | Description |
|---|---|
| ActivityMonitorBridgeTarget |
Clients
Gets the list of registered IActivityMonitorClient.
Declaration
IReadOnlyList<IActivityMonitorClient> Clients { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IActivityMonitorClient> |
Methods
| Improve this Doc View SourceRegisterClient(IActivityMonitorClient, out Boolean)
Registers an IActivityMonitorClient to the Clients list. Duplicate IActivityMonitorClient instances are ignored.
Declaration
IActivityMonitorClient RegisterClient(IActivityMonitorClient client, out bool added)
Parameters
| Type | Name | Description |
|---|---|---|
| IActivityMonitorClient | client | An IActivityMonitorClient implementation. |
| Boolean | added | True if the client has been added, false if it was already registered. |
Returns
| Type | Description |
|---|---|
| IActivityMonitorClient | The registered client. |
RegisterClient<T>(T, out Boolean)
Registers a typed IActivityMonitorClient. Duplicate IActivityMonitorClient instances are ignored.
Declaration
T RegisterClient<T>(T client, out bool added)where T : IActivityMonitorClient
Parameters
| Type | Name | Description |
|---|---|---|
| T | client | Client to register. |
| Boolean | added | True if the client has been added, false if it was already registered. |
Returns
| Type | Description |
|---|---|
| T | The registered client. |
Type Parameters
| Name | Description |
|---|---|
| T | Any type that specializes IActivityMonitorClient. |
RegisterUniqueClient<T>(Func<T, Boolean>, Func<T>)
Registers a IActivityMonitorClient that must be unique in a sense.
Declaration
T RegisterUniqueClient<T>(Func<T, bool> tester, Func<T> factory)where T : IActivityMonitorClient
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, Boolean> | tester | Predicate that must be satisfied for at least one registered client. |
| Func<T> | factory | Factory that will be called if no existing client satisfies tester. |
Returns
| Type | Description |
|---|---|
| T | The found or newly created client. |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The factory function MUST return a client that satisfies the tester function otherwise a InvalidOperationException is thrown. The factory is called only when the no client satisfies the tester function: this makes the 'added' out parameter useless.
UnregisterClient(IActivityMonitorClient)
Unregisters the given IActivityMonitorClient from the Clients list. Silently ignores an unregistered client.
Declaration
IActivityMonitorClient UnregisterClient(IActivityMonitorClient client)
Parameters
| Type | Name | Description |
|---|---|---|
| IActivityMonitorClient | client | An IActivityMonitorClient implementation. |
Returns
| Type | Description |
|---|---|
| IActivityMonitorClient | The unregistered client or null if it has not been found. |