Guest User

Untitled

a guest
Oct 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public void ToXml(string xmlFile)
  2. {
  3. //Dictionary used: Values
  4. XDocument doc = new XDocument(
  5. new XDeclaration("1.0", "utf-8", null));
  6. XElement xRoot = new XElement("RootElement");
  7. doc.Add(xRoot);
  8. Dictionary<double, double[]>.KeyCollection keys = Values.Keys;
  9.  
  10. foreach(double key in keys)
  11. {
  12. XElement inner = new XElement("InnerElement",
  13. new XAttribute("value", key),
  14. new XElement("TestValue1", Values[key][0]),
  15. new XElement("Testvalue2", Values[key][1]),
  16. new XElement("TestValue3", Values[key][2]),
  17. new XElement("TestValue4", Values[key][3]),
  18. new XElement("TestValue5", Values[key][4]),
  19. new XElement("TestValue6", Values[key][5]));
  20.  
  21. xRoot.Add(inner);
  22. }
  23. doc.Save(xmlFile);
  24. }
Add Comment
Please, Sign In to add comment