Ejemplo n.º 1
0
 /// <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);
         }
     }
 }
Ejemplo n.º 2
0
        public void PartMessageParses()
        {
            var message = ":Banane9 PART #banane9";

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

            var partMessage = new PartMessage(message);

            Assert.AreEqual<string>("Banane9", partMessage.User);
            Assert.AreEqual<string>("#banane9", partMessage.Channel);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Fires the PartMessage event.
 /// </summary>
 /// <param name="partMessage">The part message.</param>
 protected void onPartMessage(PartMessage partMessage)
 {
     if (PartMessage != null)
         PartMessage(this, partMessage);
 }
Ejemplo n.º 4
0
 private void client_PartMessage(Client sender, PartMessage partMessage)
 {
 }