Example #1
0
        static void Main(string[] args)
        {
            _reader = new StatusReader(
                @"B:\\code.base\\CSharp\\AutosysStatusTranslator\\autosys.txt");

            var tree = new AutosysTree();

            Parse(tree);

            var json = TreeSerializer.SerializeToXml <TreeNode>(tree.Root);

            Console.ReadKey();
        }
Example #2
0
        public static void Parse(AutosysTree tree)
        {
            foreach (var line in _reader.Lines)
            {
                var index = line.IndexOf("c_", StringComparison.InvariantCulture);

                if (index < 0)
                {
                    continue;
                }

                var content = new NodeData
                {
                    Name = line.Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries).First()
                };

                tree.Add(new TreeNode {
                    Data = content, Level = index
                });

                Console.WriteLine(index);
            }
        }