private void ChatRoom_NewMessage(object sender, MessageEventArgs e) { if (sender is IUser) { DisplayMessage((IUser)sender, e.Message); } else { DisplayMessage(e.Message); } }
private void OnMessageReceived(object sender, MessageEventArgs args) { RemoteUser user = sender as RemoteUser; DisplayMessage(user, args.Message); if (args.Message.Length > 0 && args.Message[0] == '/') { string message = args.Message.Remove(0, 1); string command = message.Split(' ')[0]; message = message.Remove(0, command.Length).Trim(); string[] commandArgs = message.Split(' '); UserCommand(user, command.ToLower(), commandArgs); } else if (!user.IsMuted) { Broadcast(String.Format("{0}: {1}", user.Name, args.Message), user); } if (StatusChanged != null) StatusChanged(sender, new StatusChangedEventArgs()); }
void Omegle_MessageReceived(object sender, MessageEventArgs e) { IsTyping = false; if (this.MessageReceived != null) this.MessageReceived(this, e); }