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); } } } }
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"); } }
private void ExecuteSaveNewConfigCommand(object obj) { ZebraConfig conf = new ZebraConfig() { ConfigName = this.ConfigName, ArchiveType = this.ArchiveType.Value, DatabaseProvider = this.DBProvider.Value, TempDir = this.TempDirPath }; switch (this.DBProvider.Value) { case DatabaseProvider.MySQL: conf.DatabaseCredentials = MySQLCredentials; break; case DatabaseProvider.Acces: break; case DatabaseProvider.SQLite: conf.DatabaseCredentials = SQLiteCredentials; break; } switch (this.ArchiveType.Value) { case Zebra.Library.ArchiveType.FTP: conf.ArchiveCredentials = FTPCredentials; break; case Zebra.Library.ArchiveType.SFTP: break; case Zebra.Library.ArchiveType.Local: conf.ArchiveCredentials = LocalArchiveCredentials; break; } try { conf.Serialize(@"F:\GitHub\Zebra2\ZebraDesktop\bin\Debug\netcoreapp3.1\configs"); (obj as Window).Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public frmConfigSelector() { InitializeComponent(); SelectedConfiguration = null; }