Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.AppendText("导表进程:\n");
            FilePath filePath = PathManager.filePath;

            if (Directory.Exists(filePath.OutputPath))
            {
                //导出cs文件
                ExportUtil.ExportCSAccordingMultipleTxt(sheetDic, Path.Combine(filePath.OutputPath, "CSFile"));
                //拷贝依赖文件
                string[] fileInfo = Directory.GetFiles(filePath.DependentFilePath);
                foreach (var path in fileInfo)
                {
                    File.Copy(path, Path.Combine(filePath.OutputPath, "CSFile", Path.GetFileName(path)), true);
                }
                //导出dll文件
                string dllPath = ExportUtil.ExportDllAccordingTxt(Path.Combine(filePath.OutputPath, "CSFile"), Path.Combine(filePath.OutputPath, "DLL"));
                //拷贝dll到项目文件夹
                foreach (var path in filePath.OutPutDll)
                {
                    File.Copy(dllPath, Path.Combine(path, Path.GetFileName(dllPath)));
                }
                //导出配置文件
                ExportUtil.ExportTxt(sheetDic, Path.Combine(filePath.OutputPath, "Config"));
                //拷贝txt配置问价到项目文件夹
                foreach (var path in filePath.OutPutBin)
                {
                    DirectoryHelper.CopyContent(Path.Combine(filePath.OutputPath, "Config"), path);
                }
            }
            else
            {
                Log(false, "请配置文件输出目录");
            }

            richTextBox1.AppendText("<-----------------------------完成---------------------------->\n");
            MessageBox.Show("导表完成");
        }