Guest User

Untitled

a guest
Jul 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Configuration version="1.2" createDate="2018-07-17T10:00:00">
  3. <AutoScale>1</Autoscale>
  4. <Threshold>2142</Threshold>
  5. <MinAuto>14</MinAuto>
  6. <MinMan>1</MinMan>
  7. <MaxMan>1</MaxMan>
  8. <BlueBackground>1</BlueBackground>
  9. <Contour>1</Contour>
  10. <Rotate>180</Rotate>
  11. <Flip>Vertical</Flip>
  12. </Configuration>
  13.  
  14. using (var openFileDialogXML = new OpenFileDialog()){
  15. System.IO.Stream myStream = null;
  16. openFileDialogXML.InitialDirectory = @System.Environment.CurrentDirectory;
  17. openFileDialogXML.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
  18. openFileDialogXML.FilterIndex = 1;
  19. openFileDialogXML.RestoreDirectory = true;
  20.  
  21. DialogResult dr = openFileDialogXML.ShowDialog();
  22.  
  23. if (dr == System.Windows.Forms.DialogResult.OK)
  24. {
  25. using (XmlReader reader = XmlReader.Create(openFileDialogXML.FileName))
  26. {
  27. reader.MoveToContent();
  28. var version = reader.GetAttribute("version");
  29. while (reader.Read())
  30. {
  31. if (reader.NodeType == XmlNodeType.Element)
  32. {
  33. switch (reader.Name)
  34. {
  35. case "AutoScale":
  36. //Get AutoScale value
  37. break;
  38. case "Threshold":
  39. break;
  40. case "MinAuto":
  41. break;
  42. case "MinMan":
  43. break;
  44. case "MaxMan":
  45. break;
  46. }
  47.  
  48. }
  49. }
  50. }
Add Comment
Please, Sign In to add comment