private void btnRefreshPackages_Click(object sender, EventArgs e) { comboBoxExpPackage.Items.Clear(); UCRepoClassLibrary.EAExporter theEAExporter; UCRepoClassLibrary.EAExporter.LogMsgCallbackType myLogMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(this.FormLogMsg); UCRepoClassLibrary.EAExporter.LogMsgCallbackType myErrorMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(this.FormLogError); theEAExporter = new UCRepoClassLibrary.EAExporter(myLogMsgCallback, myErrorMsgCallback); string strRepositoryFullPath = textBoxEAFile.Text; if (theEAExporter.Open(strRepositoryFullPath) != 0) { // failed return; } List <string> strListOfPackages = theEAExporter.GetListOfUseCases(); if (strListOfPackages != null) { foreach (string strPackage in strListOfPackages) { comboBoxExpPackage.Items.Add(strPackage); } } theEAExporter.Close(); }
static internal void Export(string strRepositoryFullPath, string strXSLTFullPath, string strOutputFileName, string strUseCasePackage) { UCRepoClassLibrary.EAExporter theEAExporter; UCRepoClassLibrary.EAExporter.LogMsgCallbackType myLogMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(Program.FormLogMsg); UCRepoClassLibrary.EAExporter.LogMsgCallbackType myErrorMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(Program.FormLogError); theEAExporter = new UCRepoClassLibrary.EAExporter(myLogMsgCallback, myErrorMsgCallback); Console.WriteLine("."); if (theEAExporter.Open(strRepositoryFullPath) != 0) { Console.WriteLine("Export failed."); return; } int iErrorCount = theEAExporter.Export(strUseCasePackage, strXSLTFullPath, strOutputFileName); if (iErrorCount == 0) { Console.WriteLine("Export completed successfully."); } else { Console.WriteLine("Export failed."); } theEAExporter.Close(); }
private void Export_Click(object sender, EventArgs e) { if (comboBoxExpPackage.Text == "") { return; } UCRepoClassLibrary.EAExporter theEAExporter; richTextBox1.Clear(); richTextBoxErrors.Clear(); UCRepoClassLibrary.EAExporter.LogMsgCallbackType myLogMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(this.FormLogMsg); UCRepoClassLibrary.EAExporter.LogMsgCallbackType myErrorMsgCallback = new UCRepoClassLibrary.EAExporter.LogMsgCallbackType(this.FormLogError); theEAExporter = new UCRepoClassLibrary.EAExporter(myLogMsgCallback, myErrorMsgCallback); string strRepositoryFullPath = textBoxEAFile.Text; string strUseCasePackage = comboBoxExpPackage.Text; string strOutputFileName = textBoxExportToFile.Text; theEAExporter.Open(strRepositoryFullPath); string strXSLTFullPath = _strBaseRsourcesFolder + @"\Translators\IntermediateToXHTML.xslt"; theEAExporter.Export(strUseCasePackage, strXSLTFullPath, strOutputFileName); UCRepoClassLibrary.EAExporter.LogMsg(UCRepoClassLibrary.EAExporter.LogMsgType.Info, "Export complete"); theEAExporter.Close(); Form1_Load(sender, e); // refresh screen }