IRC parsing, tokenization, and state handling in C#
1using System;
2using System.Collections.Generic;
3using IrcTokens;
4
5namespace TokensSample
6{
7 public class Program
8 {
9 public static void Main(string[] args)
10 {
11 // tokenization
12 var line = new Line("@id=123 :ben!~ben@hostname PRIVMSG #channel :hello there!");
13 Console.WriteLine(line);
14 Console.WriteLine(line.Format());
15
16 // formatting
17 var line2 = new Line {Command = "USER", Params = new List<string> {"user", "0", "*", "real name"}};
18 Console.WriteLine(line2);
19 Console.WriteLine(line2.Format());
20
21 // stateful example
22 var client = new Client();
23 client.Start();
24 }
25 }
26}