diff FrmXmlExport.cs @ 214:a6ce13e4ae89 xml-export-ui

Near Final XSL output
author Dan.Kulinski@dank-laptop.Global.Local
date Thu, 18 Aug 2011 11:15:51 -0600
parents f57957fe9009
children a0df71b24972
line wrap: on
line diff
--- a/FrmXmlExport.cs	Sun Aug 14 23:04:42 2011 -0600
+++ b/FrmXmlExport.cs	Thu Aug 18 11:15:51 2011 -0600
@@ -5,6 +5,7 @@
 using System.Drawing;
 using System.Linq;
 using System.Text;
+using System.IO;
 using System.Windows.Forms;
 using IBBoard.WarFoundry.API.Objects;
 using IBBoard.WarFoundry.API.Exporters;
@@ -20,19 +21,9 @@
             myArmy = army;
         }
 
-        private void ibbLabel1_Click(object sender, EventArgs e)
-        {
-
-        }
-
         private void FrmXmlExport_Load(object sender, EventArgs e)
         {
-
-        }
-
-        private void checkBox1_CheckedChanged(object sender, EventArgs e)
-        {
-
+            tbXslPath.Text = Directory.GetCurrentDirectory() + "\\xsl\\default_html.xsl";
         }
 
         private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
@@ -63,6 +54,7 @@
         {
             if (cbApplyTransform.Checked)
             {
+                WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
             }
             else
             {
@@ -70,6 +62,7 @@
             }
             
             this.DialogResult = DialogResult.OK;
+            this.Hide();
         }
 
         private void tbOutputFile_Change(object sender, EventArgs e)
@@ -83,5 +76,34 @@
                 bttnExport.Enabled = false;
             }
         }
+
+        private void cbApplyTransform_CheckedChanged(object sender, EventArgs e)
+        {
+            if (cbApplyTransform.Checked)
+            {
+                tbXslPath.Enabled = true;
+                bttnXslSelect.Enabled = true;
+            }
+            else
+            {
+                tbXslPath.Enabled = false;
+                bttnXslSelect.Enabled = false;
+            }
+        }
+
+        private void bttnXslSelect_Click(object sender, EventArgs e)
+        {
+            OpenFileDialog ofd = new OpenFileDialog();
+            
+            ofd.InitialDirectory = Directory.GetCurrentDirectory() + "\\xsl";
+            ofd.Filter = "XSL Files|*.xsl";
+            DialogResult result = ofd.ShowDialog();
+
+            if (result == DialogResult.OK)
+            {
+                tbXslPath.Text = ofd.FileName;
+            }
+          
+        }
     }
 }