private void btnFlexTest2_Click(object sender, EventArgs e) { ExportThroughPathway dlg = new ExportThroughPathway(); dlg.InputType = "Dictionary"; dlg.ShowDialog(); string target = dlg.Format; //"OpenOffice"; var tpe = new PsExport {Destination = target, DataType = dlg.InputType}; tpe.Export(txtInputPath.Text); }
private static void Main(string[] args) { InputFormat inFormat = InputFormat.XHTML; var projectInfo = new PublicationInformation { ProjectInputType = "Dictionary", DefaultXhtmlFileWithPath = null, DefaultCssFileWithPath = null, IsOpenOutput = false, ProjectName = "main", }; var backendPath = Common.ProgInstall; var exportType = "OpenOffice/LibreOffice"; bool bOutputSpecified = false; var files = new List<string>(); bool bShowDialog = false; try { int i = 0; if (args.Length == 0) { Usage(); Environment.Exit(0); } while (i < args.Length) { i = ProcessExportType(args, i, projectInfo, files, ref inFormat, ref bShowDialog, ref exportType, ref bOutputSpecified); } SettingProcessExportFile(projectInfo, files); Common.ProgBase = Common.GetPSApplicationPath(); // load settings from the settings file Param.LoadSettings(); Param.Value[Param.InputType] = projectInfo.ProjectInputType; Param.LoadSettings(); if (bOutputSpecified) { // the user has specified an output -- update the settings so we export to that output Param.SetValue(Param.PrintVia, exportType); Param.Write(); } // if the caller wants to display the Export Through Pathway dialog, do it now. if (bShowDialog) { var dlg = new ExportThroughPathway(); dlg.InputType = projectInfo.ProjectInputType; dlg.DatabaseName = projectInfo.ProjectName; if (dlg.ShowDialog() == DialogResult.Yes) { exportType = dlg.Format; } else { // cancel export and exit out of PathwayB Environment.Exit(0); } } // run headless from the command line Common.Testing = true; ProcessInputFormat(inFormat, files, projectInfo); if (projectInfo.DefaultXhtmlFileWithPath == null) { Usage(); throw new ArgumentException("Missing required option: (DefaultXhtmlFileWithPath)."); } if (projectInfo.DefaultCssFileWithPath == null) { Usage(); throw new ArgumentException("Missing required option: (DefaultCssFileWithPath)."); } if (!File.Exists(projectInfo.DefaultXhtmlFileWithPath)) throw new ArgumentException(string.Format("Missing {0}", projectInfo.DefaultXhtmlFileWithPath)); if (!File.Exists(projectInfo.DefaultCssFileWithPath)) throw new ArgumentException(string.Format("Missing {0}", projectInfo.DefaultCssFileWithPath)); projectInfo.DictionaryPath = Path.GetDirectoryName(projectInfo.DefaultXhtmlFileWithPath); if (projectInfo.ProjectInputType.ToLower() == "dictionary") { Param.SetValue(Param.ReversalIndex, projectInfo.IsReversalExist ? "True" : "False"); Param.SetValue(Param.InputType, projectInfo.ProjectInputType); Param.Write(); } var tpe = new PsExport { Destination = Param.PrintVia, DataType = projectInfo.ProjectInputType }; tpe.ProgressBar = null; tpe.Export(projectInfo.DefaultXhtmlFileWithPath); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } catch (Exception err) { Console.WriteLine("PathwayB encountered an error while processing: " + err.Message); if (err.StackTrace != null) { Console.WriteLine(err.StackTrace); } Environment.Exit(-1); } Environment.Exit(0); }
public void tsDefault_ClickBL() { try { string formText = LocalizationManager.GetString("ExportThroughPathway.Dialog", "Set Defaults", ""); // EDB (2 May 2011): TD-2344 / replace with Export Through Pathway dlg var dlg = new ExportThroughPathway(formText); dlg.InputType = inputTypeBL; dlg.DatabaseName = "{Project_Name}"; dlg.Media = MediaType; dlg.ShowDialog(); } catch { } }