Example #1
0
        static void Main(string[] args)
        {
            bool successfulParse         = false;
            CommandParameters parameters = new CommandParameters(args);

            if (!parameters.Valid())
            {
                Console.WriteLine("Please provide a menu file path and optionally an active menu path.");
                //Console.ReadKey ();
                return;
            }

            parameters.DumpToConsole();

            List <MenuNode> menuItems = new List <MenuNode> ();

            try
            {
                MenuParser menu = ParseXmlMenuFile(parameters.InputFilePath, parameters.ActivePath);
                menuItems       = menu.Items;
                successfulParse = true;
            }
            catch (Exception)
            {
                Console.WriteLine("A problem accessing or parsing \"{0}\" occured.", parameters.InputFilePath);
            }

            if (successfulParse)
            {
                if (menuItems.Count > 0)
                {
                    DumpMenuToConsole(menuItems);
                }
                else
                {
                    Console.WriteLine("No Menu Items were found in \"{0}\".", parameters.InputFilePath);
                }
            }

            //Console.ReadKey ();
        }