Exemplo n.º 1
0
        /// <summary>
        /// Messages the received.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="Mrwesb.Core.Monitoring.MonitorEventArgs"/> instance containing the event data.</param>
        private void MessageReceived(object sender, MonitorEventArgs args)
        {
            if (Status != MonitorStatus.Started)
            {
                return;
            }

            CountMessages++;
            if (CountMessages % 10 == 0)
            {
                MonitoringSender.Send(new MonitoringMessageFake { Count = CountMessages });
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Invokes the on message sended.
 /// </summary>
 /// <param name="monitorEventArgs"></param>
 private void InvokeOnMessageSent(MonitorEventArgs monitorEventArgs)
 {
     MonitorEventHandler handler = OnMessageSent;
     if (handler != null)
     {
         var thread = new Thread(() => handler(this, new MonitorEventArgs()));
         thread.Start();
     }
 }