Пример #1
0
 /// <summary>
 /// Sends a message to all clients except the client that sent the message.
 /// Mostly used when a message is received
 /// </summary>
 /// <param name="sender">Object that sent the message</param>
 /// <param name="e">Arguments associated with a message event</param>
 protected virtual void _forwardMessage(object sender, MsgEventArgs e)
 {
     foreach (var _client in _clients)
     {
         if (_client != sender)
         {
             _client.SendAsync(e.Message);
         }
     }
 }
Пример #2
0
 protected void _invokeMessageSent(MsgEventArgs e)
 {
     MessageSent?.Invoke(this, e);
 }
Пример #3
0
 protected void _invokeMessageReceived(MsgEventArgs e)
 {
     MessageReceived?.Invoke(this, e);
 }