private void BtnCfgGen_Click(object sender, RoutedEventArgs e) { string cfgPath = TxtPathCfgSrcCfg.Text; string destScript = TxtPathCfgDestScript.Text; string destData = TxtPathCfgData.Text; if (string.IsNullOrEmpty(cfgPath) || string.IsNullOrEmpty(destScript) || string.IsNullOrEmpty(destData)) { System.Windows.Forms.MessageBox.Show("输入目录和输出目录不能为空", "提示"); } else { ZLogger logger = new ZLogger(); logger.Setup((str) => { TxtCfgConsole.Text = str; }); Modules.CfgData.CfgDataGenerate oGen = new Modules.CfgData.CfgDataGenerate(); oGen.SetLogger(logger); bool isSucess = oGen.ToGen(cfgPath, destScript, destData); if (isSucess) { System.Windows.Forms.MessageBox.Show("生成成功!", "提示"); } else { System.Windows.Forms.MessageBox.Show("生成失败, 请查看控制台记录!", "提示"); } } }