view FrmXmlExport.cs @ 209:f57957fe9009

UI Dialog for XML output
author Dan.Kulinski@dank-laptop.Global.Local
date Sun, 14 Aug 2011 23:04:42 -0600
parents
children a6ce13e4ae89
line source
1 ´╗┐using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using IBBoard.WarFoundry.API.Objects;
10 using IBBoard.WarFoundry.API.Exporters;
12 namespace IBBoard.WarFoundry.GUI.WinForms
13 {
14 public partial class FrmXmlExport : Form
15 {
16 Army myArmy = null;
17 public FrmXmlExport(Army army)
18 {
19 InitializeComponent();
20 myArmy = army;
21 }
23 private void ibbLabel1_Click(object sender, EventArgs e)
24 {
26 }
28 private void FrmXmlExport_Load(object sender, EventArgs e)
29 {
31 }
33 private void checkBox1_CheckedChanged(object sender, EventArgs e)
34 {
36 }
38 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
39 {
41 }
43 private void bttnOutputSelect_Click(object sender, EventArgs e)
44 {
45 SaveFileDialog sfd = new SaveFileDialog();
46 sfd.Filter = "XML File|*.xml|HTML File|*.html|XHTML File|*.xhtml";
47 sfd.Title = "Save XML output";
48 sfd.ShowDialog();
50 if (sfd.FileName != "")
51 {
52 tbOutputFile.Text = sfd.FileName;
53 }
54 }
56 private void bttnCancel_Click(object sender, EventArgs e)
57 {
58 this.DialogResult = DialogResult.Cancel;
59 this.Hide();
60 }
62 private void bttnExport_Click(object sender, EventArgs e)
63 {
64 if (cbApplyTransform.Checked)
65 {
66 }
67 else
68 {
69 WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(myArmy, tbOutputFile.Text);
70 }
72 this.DialogResult = DialogResult.OK;
73 }
75 private void tbOutputFile_Change(object sender, EventArgs e)
76 {
77 if (tbOutputFile.Text != "")
78 {
79 bttnExport.Enabled = true;
80 }
81 else
82 {
83 bttnExport.Enabled = false;
84 }
85 }
86 }
87 }