changeset 211:a0df71b24972 xml-export-ui

Added basic exception handling (a one case fits all)
author Dan.Kulinski@dank-laptop.Global.Local
date Thu, 18 Aug 2011 21:59:19 -0600
parents a6ce13e4ae89
children 74e030bbf3f7
files FrmXmlExport.cs
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/FrmXmlExport.cs	Thu Aug 18 11:15:51 2011 -0600
+++ b/FrmXmlExport.cs	Thu Aug 18 21:59:19 2011 -0600
@@ -7,6 +7,7 @@
 using System.Text;
 using System.IO;
 using System.Windows.Forms;
+using System.Xml.Xsl;
 using IBBoard.WarFoundry.API.Objects;
 using IBBoard.WarFoundry.API.Exporters;
 
@@ -54,7 +55,14 @@
         {
             if (cbApplyTransform.Checked)
             {
-                WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
+                try
+                {
+                    WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
+                }
+                catch (Exception ex)
+                {
+                    MessageBox.Show(this, "Sorry, but an error occurred during export.", "Error on export", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+                }
             }
             else
             {