예제 #1
0
 void shard_ReceivedLobbyChatMessage(object sender, LobbyChatEventArgs args)
 {
     string newLine;
     if (args.Sender == null)
     {
         newLine ="You: " + args.Message;
     }
     else
     {
         newLine = args.Sender + ": " + args.Message;
     }
     this.BeginInvoke(new ParameterizedThreadStart(AddMessage), (object)newLine);
 }
예제 #2
0
 void shard_ReceivedGameChatMessage(object sender, LobbyChatEventArgs args)
 {
     if (this.InvokeRequired)
     {
         BeginInvoke(new LobbyChatEventHandler(shard_ReceivedGameChatMessage), sender, args);
         return;
     }
     string newLine;
     if (args.Sender == null)
     {
         newLine = "You: " + args.Message;
     }
     else
     {
         newLine = args.Sender + ": " + args.Message;
     }
     textGameMessages.Text = textGameMessages.Text + Environment.NewLine + (string)newLine;
     textGameMessages.SelectionStart = textGameMessages.Text.Length;
     textGameMessages.ScrollToCaret();
 }