The following token will be published with a parameter that is the actual token that was registered.
PortableMediator.MediatorTokens.StandardMediatorTokens.TokenRegistered
the following example will write the registered token to the console whenever a new sink is registered:
await mediator.RegisterSubscriber(PortableMediator.MediatorTokens.StandardMediatorTokens.TokenRegistered,
(object token) =>
{
Console.WriteLine("Token Registered: {0}", token);
});
The following token will be published whenever a message is published. The parameter will be of type MessagePublishedArgs
PortableMediator.MediatorTokens.StandardMediatorTokens.MessagePublished
the following will write the token, parameter, and the number of subscribers who received the message to the console whenever a mediator message is published:
await mediator.RegisterSubscriber(PortableMediator.MediatorTokens.StandardMediatorTokens.MessagePublished,
(MessagePublishedArgs args) =>
{
Console.WriteLine("Published Token {0}, with Parameter {1}, {2} times", args.Token, args.Parameter, args.SubscriberCount);
});