コード例 #1
0
ファイル: MultiplayerHandler.cs プロジェクト: Jecral/Football
        private void AddChat(int chatId, List<User> users)
        {
            CurrentChats.Invoke((MethodInvoker)(() =>
            {
                ChatTabPage chat = new ChatTabPage(chatId, users, CurrentClient.ClientName);
                chat.MessageCreated += chat_MessageCreated;
                chat.ChatRequestCreated += chat_ChatRequestCreated;
                chat.UserNameChanged += UsernameChangeRequest;
                chat.BackColor = ColorTranslator.FromHtml("#6B260B");

                CurrentChats.TabPages.Add(chat);
                chat.UserList.Columns[0].Width = chat.UserList.ClientRectangle.Width;
                if (chatId == 1)
                {
                    //CurrentLobby.AcceptButton = chat.SendButton;
                    chat.IsVisible = true;
                }
                if (users == null)
                {
                    CurrentClient.Send("userlist<" + chatId + ">:");
                }
                else
                {
                    chat.RefreshUserList();
                }
            }));
        }