about summary refs log tree commit diff
path: root/Sample/Program.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-04-22 11:42:09 -0400
committerBen Harris <ben@tilde.team>2020-04-22 11:42:09 -0400
commitca1518a9705ac289875c65c396a2ef7d219492d5 (patch)
tree1970852a07d58ae7c73fe869e91a425f265c641a /Sample/Program.cs
parent06a9882f65a6c2f7e72cc30340c28cf6bb76bcd1 (diff)
Add sample project
Diffstat (limited to 'Sample/Program.cs')
-rw-r--r--Sample/Program.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Sample/Program.cs b/Sample/Program.cs
new file mode 100644
index 0000000..6800179
--- /dev/null
+++ b/Sample/Program.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using IrcTokens;
+
+namespace Sample
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            // tokenization
+            var line = new Line("@id=123 :ben!~ben@hostname PRIVMSG #channel :hello there!");
+            Console.WriteLine(line);
+            Console.WriteLine(line.Format());
+
+            // formatting
+            var line2 = new Line
+            {
+                Command = "USER",
+                Params = new List<string> {"user", "0", "*", "real name"}
+            };
+            Console.WriteLine(line2);
+            Console.WriteLine(line2.Format());
+
+            // stateful example
+            var client = new Client();
+            client.Start();
+        }
+    }
+}