Beispiel #1
0
 public void AppendTextBox(string value)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <string>(AppendTextBox), new object[] { value });
         return;
     }
     ChatBox.AppendText(value + System.Environment.NewLine);
 }
Beispiel #2
0
 // Print a string to the ChatBox and add the message to the list.
 public void AppendTextBox(List <string> L, string value)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <List <string>, string>(AppendTextBox), new object[] { L, value });
         return;
     }
     ChatBox.AppendText(value);
 }
Beispiel #3
0
 private void PrintMessage(string message)
 {
     if (InvokeRequired)
     {
         Invoke(_addMessage, message);
         return;
     }
     ChatBox.SelectionStart  = ChatBox.TextLength;
     ChatBox.SelectionLength = message.Length;
     ChatBox.AppendText(message + Environment.NewLine);
 }
 protected override void Initialize()
 {
     Network.Config = new NetPeerConfiguration("game");
     Network.Client = new NetClient(Network.Config);
     loginForm      = new Login();
     Window.Title   = "Smash Bros 6.0";
     chatBox        = new ChatBox();
     base.Initialize();
     playButton = new Rectangle(this.Window.ClientBounds.Width / 2 - 90, this.Window.ClientBounds.Height / 2 - 70, 180, 70);
     exitButton = new Rectangle(this.Window.ClientBounds.Width / 2 - 90, this.Window.ClientBounds.Height / 2, 180, 70);
 }
Beispiel #5
0
 public bool AddChat(string number, ChatBox chat)
 {
     try
     {
         _chat.Add(number, chat);
         return(_chatIds.Add(number));
     }
     catch (ArgumentException e)
     {
         return(false);
     }
 }
        public void UpdateChatWindow(string message, Color color)
        {
            ChatBox.Dispatcher.Invoke(() =>
            {
                Run run             = new Run(message);
                run.Foreground      = new SolidColorBrush(color);
                Paragraph paragraph = new Paragraph(run);

                ChatBox.Document.Blocks.Add(paragraph);

                ChatBox.ScrollToEnd();
            });
        }
Beispiel #7
0
        public void StartChatBox(ActiveUser user, string chatName, RemoteChat chat, string number)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate { StartChatBox(user, chatName, chat, number); });
            }
            else
            {
                ChatBox box = new ChatBox(user, chatName, chat, number);

                ClientApp.GetInstance().AddChat(number, box);
                box.Show();
            }
        }
        public PictionaryForm(ClientManager client)
        {
            InitializeComponent();
            ColorComboBox.SelectedIndex = 7;

            linePointsX               = new List <double>();
            linePointsY               = new List <double>();
            clientManager             = client;
            newLine                   = true;
            paintTool                 = PaintTool.Pen;
            penColor                  = Colors.Black;
            ColorComboBox.ItemsSource = typeof(Colors).GetProperties();
            ChatBox.Foreground        = new SolidColorBrush(Colors.Gray);
            PaintCanvas.DefaultDrawingAttributes.Width = 2;
            ChatBox.AppendText("Welcome to Pictionary!");
        }