/// <summary> /// The on message bus sent. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="args"> /// The eventArgs. /// </param> private void OnMessageBusSent(object sender, MessageBusSentEventArgs args) { if (this.MessageBusSent != null) { this.MessageBusSent(sender, args); } }
/// <summary> /// The message bus send. /// </summary> /// <param name="messageBus"> /// The message bus. /// </param> /// <param name="message"> /// The message. /// </param> /// <param name="entity"> /// The entity. /// </param> /// <returns> /// The <see cref="IDisposable"/>. /// </returns> public IDisposable MessageBusSend(IMessageBus messageBus, IMessage message, string entity) { return (GetActivityTracker( () => { var args = new MessageBusSendingEventArgs { Message = message, Entity = entity }; this.OnMessageBusSending(messageBus, args); }, t => { var args = new MessageBusSentEventArgs { Elapsed = t, Message = message, Entity = entity }; this.OnMessageBusSent(messageBus, args); })); }
/// <summary> /// The message bus send. /// </summary> /// <param name="messageBus"> /// The message bus. /// </param> /// <param name="message"> /// The message. /// </param> /// <param name="entity"> /// The entity. /// </param> /// <returns> /// The <see cref="IDisposable"/>. /// </returns> public IDisposable MessageBusSend(IMessageBus messageBus, IMessage message, string entity) { return GetActivityTracker( () => { var args = new MessageBusSendingEventArgs { Message = message, Entity = entity }; this.OnMessageBusSending(messageBus, args); }, t => { var args = new MessageBusSentEventArgs { Elapsed = t, Message = message, Entity = entity }; this.OnMessageBusSent(messageBus, args); }); }