/// <summary> /// http://www.jonasjohn.de/snippets/csharp/xmlserializer-example.htm /// </summary> /// <param name="data"></param> /// <param name="outFileName"></param> public static void Export(IExportableToXml data, string outFileName) { XmlSerializer xmlSerializer = new XmlSerializer(data.GetType()); TextWriter tw = new StreamWriter(@"out.xml"); xmlSerializer.Serialize(tw, data); tw.Close(); }
public void ExportToXml(IExportableToXml data, string outFilePath) { XMLExporter.Export(data, outFilePath); }