MeasureFile.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. //时间:20200610
  2. //作者:郝爽
  3. //功能:测量文件
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using FileManager;
  10. using System.Xml;
  11. namespace MeasureData
  12. {
  13. public class MeasureFile:ISlo
  14. {
  15. #region 内容
  16. //文件名
  17. private string m_fileName;
  18. public string FileName
  19. {
  20. get { return this.m_fileName; }
  21. set { this.m_fileName = value; }
  22. }
  23. //文件路径
  24. private string m_filepath;
  25. public string FilePath
  26. {
  27. get { return this.m_filepath; }
  28. set { this.m_filepath = value; }
  29. }
  30. //切孔链表
  31. private List<CutHole> m_listCutHole;
  32. public List<CutHole> ListCutHole
  33. {
  34. get { return this.m_listCutHole; }
  35. set { this.m_listCutHole = value; }
  36. }
  37. //XML文件保存
  38. //样品孔存储xml文档
  39. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  40. {
  41. Slo<MeasureFile> slo = new Slo<MeasureFile>();
  42. xString FileName = new xString();
  43. xString FilePath = new xString();
  44. FileName.AssignValue(this.FileName);
  45. FilePath.AssignValue(this.FilePath);
  46. slo.Register("FileName", FileName);
  47. slo.Register("FilePath", FilePath);
  48. Collection<CutHole> ctch = new Collection<CutHole>();
  49. ctch.addItem(this.ListCutHole[0]);
  50. if (isStoring)
  51. {
  52. slo.Serialize(true, xml, rootNode);
  53. }
  54. else
  55. {
  56. slo.Serialize(false, xml, rootNode);
  57. this.FileName = FileName.value();
  58. this.FilePath = FilePath.value();
  59. }
  60. }
  61. #endregion
  62. //构造函数
  63. public MeasureFile()
  64. {
  65. Init();
  66. }
  67. public void Init()
  68. {
  69. this.ListCutHole = new List<CutHole>();
  70. }
  71. #region 操作
  72. //新建
  73. public void New()
  74. {
  75. }
  76. //打开
  77. public void Open()
  78. {
  79. }
  80. //保存
  81. public void Save()
  82. {
  83. //Serialize();
  84. }
  85. //另存为
  86. public void SaveAs()
  87. {
  88. }
  89. #endregion
  90. }
  91. }