about summary refs log blame commit diff
path: root/Sample/Program.cs
blob: eda312f792f0867b2c19267a96b78a9b2b06197c (plain) (tree)
1
2
3
4
5

                   
                                 
 
                      













                                                                                             
                                                                           









                                              
using IrcTokens;
using System;
using System.Collections.Generic;

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();
        }
    }
}