示例#1
0
 private void client_UserSpoke(object sender, ChatMessageEventArgs e)
 {
     Match m = m_speakingTest.Match(e.Text);
     if (m.Success)
     {
         string contents = m.Groups["commandText"].Value;
         ProcessCommand(e, contents);
     }
 }
示例#2
0
文件: Program.cs 项目: Mofsy/jinxbot
 static void client_MessageSent(object sender, ChatMessageEventArgs e)
 {
     if (e.EventType == ChatEventType.Emote)
     {
         Console.WriteLine("<{0} {1}>", e.Username, e.Text);
     }
     else
     {
         Console.WriteLine("[{0}]: {1}", e.Username, e.Text);
     }
 }
示例#3
0
 public void AddSent(ChatMessageEventArgs e)
 {
     if (ready)
     {
         this.chatBox1.AddChat(
             new ChatNode(MyUsername + ": ", Color.Lime),
             new ChatNode(e.Text, Color.LightSlateGray)
             );
     }
     else
     {
         outstanding.Enqueue(new Message { Direction = Direction.Sent, Args = e });
     }
 }
示例#4
0
 public void AddReceived(ChatMessageEventArgs e)
 {
     if (ready)
     {
         this.chatBox1.AddChat(
             new ChatNode(e.Username, Color.SteelBlue),
             new ChatNode(": ", Color.SteelBlue),
             new ChatNode(e.Text, Color.LightSteelBlue)
             );
     }
     else
     {
         outstanding.Enqueue(new Message { Args = e, Direction = Direction.Recv });
     }
 }
示例#5
0
 private void ProcessCommand(ChatMessageEventArgs e, string contents)
 {
     string[] commandParts = contents.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     string command = null;
     string[] parameters = new string[commandParts.Length - 1];
     if (commandParts.Length > 0)
         command = commandParts[0];
     if (commandParts.Length > 1)
     {
         Array.Copy(commandParts, 1, parameters, 0, parameters.Length);
     }
     IJinxBotPrincipal commander = m_client.Database.FindUsers(e.Username).FirstOrDefault();
     if (commander != null)
     {
         foreach (ICommandHandler handler in m_client.CommandHandlers)
         {
             if (handler.HandleCommand(commander, command, parameters))
                 break;
         }
     }
 }
示例#6
0
 void WhisperSent(object sender, ChatMessageEventArgs e)
 {
     chat.AddChat(new ChatNode("You whisper to ", CssClasses.WhisperHeader), new ChatNode(e.Username, CssClasses.WhisperOtherUser), new ChatNode(": ", CssClasses.WhisperHeader), new ChatNode(e.Text, CssClasses.WhisperText));
 }
示例#7
0
 void Client_MessageSent(object sender, ChatMessageEventArgs e)
 {
     if (__messageSent != null)
         __messageSent.Call(_host.ClientHost, ConvObj(e));
 }
示例#8
0
 void Client_UserEmoted(object sender, ChatMessageEventArgs e)
 {
     if (__userEmoted != null)
         __userEmoted.Call(_host.ClientHost, ConvObj(e));
 }
示例#9
0
 void Client_UserSpoke(object sender, ChatMessageEventArgs e)
 {
     if (__userSpoke != null)
         __userSpoke.Call(_host.ClientHost, ConvObj(e));
 }
示例#10
0
 void Client_WhisperReceived(object sender, ChatMessageEventArgs e)
 {
     if (__whisperReceived != null)
         __whisperReceived.Call(_host.ClientHost, ConvObj(e));
 }
示例#11
0
 void UserEmoted(object sender, ChatMessageEventArgs e)
 {
     PostEvent(new ClientEvent { EventType = ClientEventType.UserEmoted, EventData = e });
 }
示例#12
0
文件: Program.cs 项目: Mofsy/jinxbot
 static void client_UserSpoke(object sender, ChatMessageEventArgs e)
 {
     Console.WriteLine("{0}: {1}", e.Username, e.Text);
 }
示例#13
0
 void UserSpoke(object sender, ChatMessageEventArgs e)
 {
     PostEvent(new ClientEvent { EventData = e, EventType = ClientEventType.UserSpoke });
 }
示例#14
0
 void UserEmoted(object sender, ChatMessageEventArgs e)
 {
     chat.AddChat(new ChatNode("<", CssClasses.EmoteText), new ChatNode(e.Username, CssClasses.EmoteOtherUsername), new ChatNode(string.Concat(" ", e.Text, ">"), CssClasses.EmoteText));
 }
示例#15
0
 void WhisperReceived(object sender, ChatMessageEventArgs e)
 {
     chat.AddChat(new ChatNode(e.Username, CssClasses.WhisperOtherUser), 
         new ChatNode(" whispers: ", CssClasses.WhisperHeader), 
         new ChatNode(e.Text, CssClasses.WhisperText));
 }
示例#16
0
 private void client_WhisperReceived(object sender, ChatMessageEventArgs e)
 {
     ProcessCommand(e, e.Text);
 }
示例#17
0
 void MessageSent(object sender, ChatMessageEventArgs e)
 {
     PostEvent(new ClientEvent { EventData = e, EventType = ClientEventType.MessageSent });
 }
示例#18
0
 private void HandleChat(object sender, ChatMessageEventArgs e)
 {
     Match m = ClanSearch.Match(e.Text);
     if (m.Success)
     {
         string tag = m.Groups["tag"].Value;
         NoteTag(tag, e.Username, m_client.Client.ChannelName, e.Text);
     }
 }
        private void client_WhisperReceived(object sender, ChatMessageEventArgs e)
        {
            Invokee del = delegate
            {
                lock (m_forms)
                {
                    WhisperTab tab = null;
                    if (!m_forms.ContainsKey(e.Username))
                    {
                        tab = new WhisperTab(m_client);
                        tab.OtherPerson = e.Username;
                        tab.MyUsername = m_client.Client.UniqueUsername;
                        m_profileDoc.AddDocument(tab);
                        tab.TabText = tab.Text = e.Username;
                        tab.Disposed += tab_Disposed;

                        m_forms.Add(e.Username, tab);
                    }
                    else
                    {
                        tab = m_forms[e.Username];
                    }

                    tab.AddReceived(e);
                }
            };
            ISynchronizeInvoke sync = m_profileDoc as ISynchronizeInvoke;
            if (sync.InvokeRequired)
                sync.BeginInvoke(del, new object[0]);
            else
                del();
        }
示例#20
0
 void UserSpoke(object sender, ChatMessageEventArgs e)
 {
     chat.AddChat(new ChatNode("[", CssClasses.SpeakBracketsOtherUsers), 
         new ChatNode(e.Username, CssClasses.SpeakOtherUsername), 
         new ChatNode("]: ", CssClasses.SpeakBracketsOtherUsers), 
         new ChatNode(e.Text, CssClasses.SpeakText));
 }
示例#21
0
文件: Program.cs 项目: Mofsy/jinxbot
 static void client_UserEmoted(object sender, ChatMessageEventArgs e)
 {
     Console.WriteLine("<{0} {1}>", e.Username, e.Text);
 }
示例#22
0
 void MessageSent(object sender, ChatMessageEventArgs e)
 {
     if (m_inChat)
     {
         chat.AddChat(new ChatNode("[", CssClasses.SpeakBracketsOtherUsers), new ChatNode(m_userName, CssClasses.SpeakOtherUsername), new ChatNode("]: ", CssClasses.SpeakBracketsOtherUsers), new ChatNode(e.Text, CssClasses.SpeakText));
     }
 }
示例#23
0
 void WhisperReceived(object sender, ChatMessageEventArgs e)
 {
     PostEvent(new ClientEvent { EventType = ClientEventType.WhisperReceived, EventData = e });
 }