Adjusted the exporter to match the imported file better
This commit is contained in:
parent
e7ca08c65d
commit
ec81631bd8
@ -21,6 +21,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace ENI2.Controls
|
namespace ENI2.Controls
|
||||||
@ -68,12 +69,26 @@ namespace ENI2.Controls
|
|||||||
if (dlg.ShowDialog() == true)
|
if (dlg.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
|
||||||
using (var fs = File.Create(dlg.FileName))
|
|
||||||
{
|
{
|
||||||
var ser = new XmlSerializer(typeof(ProofRequest));
|
var ser = new XmlSerializer(typeof(ProofRequest));
|
||||||
ser.Serialize(fs, _vm);
|
|
||||||
|
// 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
|
||||||
|
{
|
||||||
|
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);
|
MessageBox.Show("Exported successfully.", "easy-peasy", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user