annotate FrmXmlExport.cs @ 213:f57957fe9009 xml-export-ui

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