Beispiel #1
0
        public void JoinMessageParses()
        {
            var message = ":Banane9 JOIN #banane9";

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

            var joinMessage = new JoinMessage(message);

            Assert.AreEqual<string>("Banane9", joinMessage.User);
            Assert.AreEqual<string>("#banane9", joinMessage.Channel);
        }
Beispiel #2
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);
         }
     }
 }
Beispiel #3
0
 /// <summary>
 /// Fires the JoinMessage event.
 /// </summary>
 /// <param name="joinMessage">The join message.</param>
 protected void onJoinMessage(JoinMessage joinMessage)
 {
     if (JoinMessage != null)
         JoinMessage(this, joinMessage);
 }
Beispiel #4
0
 private void client_JoinMessage(Client sender, JoinMessage joinMessage)
 {
 }