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 diff
     1.1 --- a/FrmXmlExport.cs	Thu Aug 18 11:15:51 2011 -0600
     1.2 +++ b/FrmXmlExport.cs	Thu Aug 18 21:59:19 2011 -0600
     1.3 @@ -7,6 +7,7 @@
     1.4  using System.Text;
     1.5  using System.IO;
     1.6  using System.Windows.Forms;
     1.7 +using System.Xml.Xsl;
     1.8  using IBBoard.WarFoundry.API.Objects;
     1.9  using IBBoard.WarFoundry.API.Exporters;
    1.10  
    1.11 @@ -54,7 +55,14 @@
    1.12          {
    1.13              if (cbApplyTransform.Checked)
    1.14              {
    1.15 -                WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
    1.16 +                try
    1.17 +                {
    1.18 +                    WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
    1.19 +                }
    1.20 +                catch (Exception ex)
    1.21 +                {
    1.22 +                    MessageBox.Show(this, "Sorry, but an error occurred during export.", "Error on export", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    1.23 +                }
    1.24              }
    1.25              else
    1.26              {