示例#1
0
 private void OnParticipantMessageReceived(Participant participant, string message)
 {
     var data = new Message { Name = participant.Name, Body = message };
     foreach (var otherParticipant in this.participants.Except(new[] { participant }))
     {
         otherParticipant.SendMessage(data);
     }
 }
示例#2
0
 private void OnParticipantDisconnected(Participant participant)
 {
     var message = new Message { Name = participant.Name, Body = "So long and thanks for all of the shoes!" };
     foreach (var otherParticipant in this.participants.Except(new[] { participant }))
     {
         otherParticipant.SendMessage(message);
     }
 }