about summary refs log tree commit diff
path: root/Examples/Tokens/Program.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-05 21:32:08 -0400
committerBen Harris <ben@tilde.team>2020-05-05 21:32:08 -0400
commitb3c1a9a929d5f57e3c760087ec9e9950bd1e7aff (patch)
treea5fc840eeaca66fe9adb1604072bc01b6caa554b /Examples/Tokens/Program.cs
parent2c4e412c189ef54c181ffad96667232eaf80fcef (diff)
move example projects into a subfolder
Diffstat (limited to 'Examples/Tokens/Program.cs')
-rw-r--r--Examples/Tokens/Program.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/Examples/Tokens/Program.cs b/Examples/Tokens/Program.cs
new file mode 100644
index 0000000..c3a0885
--- /dev/null
+++ b/Examples/Tokens/Program.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using IrcTokens;
+
+namespace TokensSample
+{
+    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();
+        }
+    }
+}