コード例 #1
0
        private void OnExportToXmlForInDesign(object sender, EventArgs e)
        {
            using (var d = new InDesignXmlInformationDialog())
            {
                d.ShowDialog();
            }
            using (var dlg = new SaveFileDialog())
            {
                dlg.FileName         = Path.GetFileNameWithoutExtension(SelectedBook.GetPathHtmlFile()) + ".xml";
                dlg.InitialDirectory = SelectedBook.FolderPath;
                if (DialogResult.OK == dlg.ShowDialog())
                {
                    try
                    {
                        _model.ExportInDesignXml(dlg.FileName);
#if !MONO
                        Process.Start("explorer.exe", "/select, \"" + dlg.FileName + "\"");
#endif
                        Analytics.Track("Exported XML For InDesign");
                    }
                    catch (Exception error)
                    {
                        Palaso.Reporting.ErrorReport.NotifyUserOfProblem(error, "Could not export the book to XML");
                        Analytics.ReportException(error);
                    }
                }
            }
        }
コード例 #2
0
 private void OnExportToXmlForInDesign(object sender, EventArgs e)
 {
     using(var d = new InDesignXmlInformationDialog())
     {
         d.ShowDialog();
     }
     using (var dlg = new SaveFileDialog())
     {
         dlg.FileName = Path.GetFileNameWithoutExtension(SelectedBook.GetPathHtmlFile())+".xml";
         dlg.InitialDirectory = SelectedBook.FolderPath;
         if(DialogResult.OK == dlg.ShowDialog())
         {
             try
             {
                 _model.ExportInDesignXml(dlg.FileName);
                 PathUtilities.SelectFileInExplorer(dlg.FileName);
                 Analytics.Track("Exported XML For InDesign");
             }
             catch (Exception error)
             {
                 SIL.Reporting.ErrorReport.NotifyUserOfProblem(error, "Could not export the book to XML");
                 Analytics.ReportException(error);
             }
         }
     }
 }