about summary refs log tree commit diff
path: root/Examples/Tokens
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/Tokens')
-rw-r--r--Examples/Tokens/Client.cs14
-rw-r--r--Examples/Tokens/Program.cs3
2 files changed, 6 insertions, 11 deletions
diff --git a/Examples/Tokens/Client.cs b/Examples/Tokens/Client.cs
index 1061986..3dd3933 100644
--- a/Examples/Tokens/Client.cs
+++ b/Examples/Tokens/Client.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.Net.Sockets;
 using System.Threading;
 using IrcTokens;
@@ -26,8 +25,8 @@ namespace TokensSample
             _socket.Connect("127.0.0.1", 6667);
             while (!_socket.Connected) Thread.Sleep(1000);
 
-            Send(new Line {Command = "NICK", Params = new List<string> {"tokensbot"}});
-            Send(new Line {Command = "USER", Params = new List<string> {"tokensbot", "0", "*", "real name"}});
+            Send(new Line("NICK", "tokensbot"));
+            Send(new Line("USER", "tokensbot", "0", "*", "real name"));
 
             while (true)
             {
@@ -50,16 +49,13 @@ namespace TokensSample
                     switch (line.Command)
                     {
                         case "PING":
-                            Send(new Line {Command = "PONG", Params = line.Params});
+                            Send(new Line("PONG", line.Params[0]));
                             break;
                         case "001":
-                            Send(new Line {Command = "JOIN", Params = new List<string> {"#test"}});
+                            Send(new Line("JOIN", "#test"));
                             break;
                         case "PRIVMSG":
-                            Send(new Line
-                            {
-                                Command = "PRIVMSG", Params = new List<string> {line.Params[0], "hello there"}
-                            });
+                            Send(new Line("PRIVMSG", line.Params[0], "hello there"));
                             break;
                     }
                 }
diff --git a/Examples/Tokens/Program.cs b/Examples/Tokens/Program.cs
index c3a0885..ba57836 100644
--- a/Examples/Tokens/Program.cs
+++ b/Examples/Tokens/Program.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using IrcTokens;
 
 namespace TokensSample
@@ -14,7 +13,7 @@ namespace TokensSample
             Console.WriteLine(line.Format());
 
             // formatting
-            var line2 = new Line {Command = "USER", Params = new List<string> {"user", "0", "*", "real name"}};
+            var line2 = new Line("USER", "user", "0", "*", "real name");
             Console.WriteLine(line2);
             Console.WriteLine(line2.Format());