示例#1
0
 private void PrintOutput(string msg)
 {
     if (OutputTb.InvokeRequired)
     {
         PrintOutputDelegate d = new PrintOutputDelegate(PrintOutput);
         Invoke(d, new object[] { msg });
     }
     else
     {
         OutputTb.Text += string.Format("{0}\r\n", msg);
     }
 }
示例#2
0
        private void PlayersChanged()
        {
            if (outputTextBox.InvokeRequired)
            {
                ResetOutputDelegate d = ResetOutput;
                Invoke(d);
            }

            foreach (var player in _discoveryService.Players)
            {
                if (outputTextBox.InvokeRequired)
                {
                    PrintOutputDelegate d = PrintOutput;
                    Invoke(d, player.FriendlyName);
                }
            }
        }