Exemplo n.º 1
0
        static void Main(string[] args)
        {
            using (var sw = new StreamWriter("NezarkaTest.html"))
            {
                TextReader textReader = Console.In;
                TextWriter textWriter = Console.Out;

                //textWriter = sw; //for debug

                //load store data
                ModelStore store = ModelStore.LoadFrom(textReader);
                if (store == null)
                {
                    Console.WriteLine("Data error.");
                    Environment.Exit(0);
                    return;
                }
                HTMLBuilder htmlBuilder = new HTMLBuilder(textWriter);
                GetParser   getParser   = new GetParser(htmlBuilder, store);

                //commands execution
                while (true)
                {
                    string getCommand = textReader.ReadLine();
                    if (getCommand == null)
                    {
                        break;
                    }
                    getParser.parse(getCommand);
                }
            }
        }
Exemplo n.º 2
0
 public GetParser(HTMLBuilder htmlBuilder, ModelStore store)
 {
     this.htmlBuilder = htmlBuilder;
     this.store       = store;
 }