summaryrefslogtreecommitdiff
path: root/Native/EmuKeyboardDesigner
diff options
context:
space:
mode:
Diffstat (limited to 'Native/EmuKeyboardDesigner')
-rw-r--r--Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suobin50176 -> 50176 bytes
-rw-r--r--Native/EmuKeyboardDesigner/MainForm.cs21
2 files changed, 13 insertions, 8 deletions
diff --git a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
index aa47a7d..db01de5 100644
--- a/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
+++ b/Native/EmuKeyboardDesigner/EmuKeyboardDesigner.suo
Binary files differ
diff --git a/Native/EmuKeyboardDesigner/MainForm.cs b/Native/EmuKeyboardDesigner/MainForm.cs
index 36144b9..33ebd22 100644
--- a/Native/EmuKeyboardDesigner/MainForm.cs
+++ b/Native/EmuKeyboardDesigner/MainForm.cs
@@ -86,17 +86,15 @@ namespace EmuKeyboardDesigner
{
OpenFileDialog fsel = new OpenFileDialog();
- fsel.Filter = "XML Files(*.XML)|*.XML";
+ fsel.Filter = "Keyboard Files (*.keyboard)|*.keyboard";
if (fsel.ShowDialog() == DialogResult.OK)
{
try
{
- XmlDocument xml = new XmlDocument();
+ BinaryReader stream = new BinaryReader(File.OpenRead(fsel.FileName), Encoding.UTF8);
- xml.Load(fsel.FileName);
-
- KeyboardDefinition def = KeyboardDefinition.CreateFromXML(xml);
+ KeyboardDefinition def = KeyboardDefinition.Load(stream);
keyList.Items.Clear();
@@ -109,6 +107,9 @@ namespace EmuKeyboardDesigner
{
keyList.SelectedIndex = 0;
}
+
+ stream.Close();
+ stream.Dispose();
}
catch (Exception ex)
{
@@ -121,7 +122,8 @@ namespace EmuKeyboardDesigner
{
SaveFileDialog fsel = new SaveFileDialog();
- fsel.Filter = "XML Files(*.XML)|*.XML";
+ fsel.Filter = "Keyboard Files (*.keyboard)|*.keyboard";
+ fsel.AddExtension = true;
if (fsel.ShowDialog() == DialogResult.OK)
{
@@ -134,9 +136,12 @@ namespace EmuKeyboardDesigner
def.Definitions.Add(k);
}
- XmlDocument doc = def.CreateXML();
+ BinaryWriter stream = new BinaryWriter(File.Create(fsel.FileName), Encoding.UTF8);
+
+ def.Save(stream);
- doc.Save(fsel.FileName);
+ stream.Close();
+ stream.Dispose();
}
catch (Exception ex)
{