diff --git a/ENI2/Controls/EasyPeasyControl.xaml.cs b/ENI2/Controls/EasyPeasyControl.xaml.cs index f3964a8e..0d1cbabf 100644 --- a/ENI2/Controls/EasyPeasyControl.xaml.cs +++ b/ENI2/Controls/EasyPeasyControl.xaml.cs @@ -21,6 +21,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using System.Xml; using System.Xml.Serialization; namespace ENI2.Controls @@ -69,11 +70,25 @@ namespace ENI2.Controls { try { - using (var fs = File.Create(dlg.FileName)) + var ser = new XmlSerializer(typeof(ProofRequest)); + + // Namespaces (if needed) + // var ns = new XmlSerializerNamespaces(); + // ns.Add("xsd", "http://www.w3.org/2001/XMLSchema"); + // ns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance"); + + var settings = new XmlWriterSettings { - var ser = new XmlSerializer(typeof(ProofRequest)); - ser.Serialize(fs, _vm); + Indent = true, + OmitXmlDeclaration = true + }; + + using (var fs = File.Create(dlg.FileName)) + using (var xw = XmlWriter.Create(fs, settings)) + { + ser.Serialize(xw, _vm); //, ns); } + MessageBox.Show("Exported successfully.", "easy-peasy", MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex)