private void Network_ChatEventHandler(object sender, ChatEvent e) { ChatBox.BeginInvoke((MethodInvoker) delegate { int st = ChatBox.TextLength; ChatBox.SelectionFont = BoldFont; ChatBox.SelectionBackColor = Color.DarkCyan; ChatBox.AppendText(e.message.OwnerName + ":"); ChatBox.Select(st, ChatBox.TextLength - st); ChatBox.SelectionFont = StdFont; ChatBox.DeselectAll(); st = ChatBox.TextLength; ChatBox.AppendText(e.message.Message + "\r\n"); ChatBox.Select(st, ChatBox.TextLength - st); ChatBox.SelectionBackColor = Color.Black; ChatBox.DeselectAll(); ChatBox.ScrollToCaret(); AddMessage(e.message); }); if (e.message.MessageID == IncrementID) { ChatBoxMessage.Invoke((MethodInvoker) delegate { ChatBoxMessage.Text = ""; IncrementID++; ChatBoxMessage.Focus(); }); } }
public static void HandleChatBoxMessage(ChatBoxMessage message, LoLClient client) { if (message.content.StartsWith(CommandsProvider.COMMANDS_PREFIX)) { CommandsProvider.Instance.Handle(client, message.content); } else { switch (message.channel) { case ChatChannelType.ALL: client.Hero.Game.Send(message, Channel.CHL_COMMUNICATION); break; case ChatChannelType.TEAM: client.Hero.Team.Send(message, Channel.CHL_COMMUNICATION); break; } } }
private ChatBoxMessageViewModel CreateChatBoxMessageViewModel(ChatBoxMessage chatBoxMessage) { return(new ChatBoxMessageViewModel(chatBoxMessage)); }
private void AddChatMessageViewModel(ChatBox chatBox, ChatBoxMessage chatBoxMessage) { _chatBoxViewModelList.Where(x => x.Chatbox == chatBox).ToList() .ForEach(y => y.MessageList.Add(CreateChatBoxMessageViewModel(chatBoxMessage))); }
public ChatBoxMessageViewModel(ChatBoxMessage chatboxMessage) { _chatboxMessage = chatboxMessage; }
private void CChatControl_Load(object sender, EventArgs e) { ChatBoxMessage.Focus(); ChatBoxMessage.SelectedText = ""; }
public void Setup() { ChatBoxMessage.Focus(); ChatBoxMessage.SelectedText = ""; }