コード例 #1
0
        static void Main(string[] args)
        {
            manager = new ZebraDBManager(ZebraConfig.FromXML(@".\"));
            var parser = new ZebraCommandParser(cmdlist2);

            Console.WriteLine("Zebra Console");
            Console.WriteLine("Type help for a list of all commands");
            Console.WriteLine("Parameters have to be seperated by a semicolon (;)");
            Console.WriteLine();

            while (true)
            {
                Console.Write("zebra>");
                var input = Console.ReadLine();

                if (parser.Parse(input, out ZebraCommand cmd, out string[] cmdargs))
                {
                    if (cmdargs == null)
                    {
                        cmd.Execute();
                    }
                    else
                    {
                        cmd.Execute(cmdargs);
                    }
                }
            }
        }
コード例 #2
0
 private void LoadConfiguration(FileInfo file)
 {
     try
     {
         SelectedConfiguration = ZebraConfig.FromXML((lvConfigs.SelectedItem as FileInfo).FullName);
         this.DialogResult     = true;
         this.Close();
         return;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Fehler beim Laden der Konfiguration");
     }
 }