示例#1
0
        public void NickMessageParses()
        {
            var message = ":Banane9Derp NICK Banane9";

            Assert.IsTrue(NickMessage.IsCorrectFormat(message));

            var nickMessage = new NickMessage(message);

            Assert.AreEqual<string>("Banane9Derp", nickMessage.OldNick);
            Assert.AreEqual<string>("Banane9", nickMessage.NewNick);
        }
示例#2
0
文件: Client.cs 项目: Banane9/Iris
 /// <summary>
 /// Dispatches the right events for the line.
 /// </summary>
 /// <param name="line">The line.</param>
 private void dispatchEventsFor(string line)
 {
     if (Messages.Message.IsCorrectFormat(line))
     {
         //Tryed to order them by how often they appear.
         if (Messages.Server.PrivateMessage.IsCorrectFormat(line))
         {
             var privateMessage = new Messages.Server.PrivateMessage(line);
             onPrivateMessage(privateMessage);
             onMessage(privateMessage);
         }
         else if (Messages.Server.NumericalMessage.IsCorrectFormat(line))
         {
             var numericalMessage = new Messages.Server.NumericalMessage(line);
             onNumericalMessage(numericalMessage);
             onMessage(numericalMessage);
         }
         else if (Messages.Server.Notice.IsCorrectFormat(line))
         {
             var notice = new Messages.Server.Notice(line);
             onNotice(notice);
             onMessage(notice);
         }
         else if (Messages.Server.NickMessage.IsCorrectFormat(line))
         {
             var nickMessage = new Messages.Server.NickMessage(line);
             onNickMessage(nickMessage);
             onMessage(nickMessage);
         }
         else if (Messages.Server.JoinMessage.IsCorrectFormat(line))
         {
             var joinMessage = new Messages.Server.JoinMessage(line);
             onJoinMessage(joinMessage);
             onMessage(joinMessage);
         }
         else if (Messages.Server.PartMessage.IsCorrectFormat(line))
         {
             var partMessage = new Messages.Server.PartMessage(line);
             onPartMessage(partMessage);
             onMessage(partMessage);
         }
         else if (Messages.Server.QuitMessage.IsCorrectFormat(line))
         {
             var quitMessage = new Messages.Server.QuitMessage(line);
             onQuitMessage(quitMessage);
             onMessage(quitMessage);
         }
     }
 }
示例#3
0
文件: Client.cs 项目: Banane9/Iris
 /// <summary>
 /// Fires the NickMessage event.
 /// </summary>
 /// <param name="nickMessage">The nick message.</param>
 protected void onNickMessage(NickMessage nickMessage)
 {
     if (NickMessage != null)
         NickMessage(this, nickMessage);
 }
示例#4
0
 private void client_NickMessage(Client sender, NickMessage nickMessage)
 {
 }