MeasureFile.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. public const string UNTITLED_FILE_NAME = "Untitled";
  16. #region 内容
  17. //文件名
  18. private string m_fileName;
  19. public string FileName
  20. {
  21. get { return this.m_fileName; }
  22. set { this.m_fileName = value; }
  23. }
  24. //文件路径
  25. private string m_filepath;
  26. public string FilePath
  27. {
  28. get { return this.m_filepath; }
  29. set { this.m_filepath = value; }
  30. }
  31. //切孔链表
  32. private List<CutHole> m_listCutHole;
  33. public List<CutHole> ListCutHole
  34. {
  35. get { return this.m_listCutHole; }
  36. set { this.m_listCutHole = value; }
  37. }
  38. //XML文件保存
  39. //样品孔存储xml文档
  40. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  41. {
  42. Slo<MeasureFile> slo = new Slo<MeasureFile>();
  43. xString FileName = new xString();
  44. xString FilePath = new xString();
  45. FileName.AssignValue(this.FileName);
  46. FilePath.AssignValue(this.FilePath);
  47. slo.Register("FileName", FileName);
  48. slo.Register("FilePath", FilePath);
  49. Collection<CutHole> ctch = new Collection<CutHole>();
  50. ctch.addItem(this.ListCutHole[0]);
  51. if (isStoring)
  52. {
  53. slo.Serialize(true, xml, rootNode);
  54. }
  55. else
  56. {
  57. slo.Serialize(false, xml, rootNode);
  58. this.FileName = FileName.value();
  59. this.FilePath = FilePath.value();
  60. }
  61. }
  62. #endregion
  63. //构造函数
  64. public MeasureFile()
  65. {
  66. Init();
  67. }
  68. public void Init()
  69. {
  70. this.ListCutHole = new List<CutHole>();
  71. }
  72. #region 操作
  73. //新建
  74. public void New()
  75. {
  76. }
  77. //打开
  78. public void Open()
  79. {
  80. }
  81. //保存
  82. public void Save()
  83. {
  84. //Serialize();
  85. }
  86. //另存为
  87. public void SaveAs()
  88. {
  89. }
  90. #endregion
  91. }
  92. }