XmlData.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using HistoryDLL.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. namespace HistoryDLL
  9. {
  10. public class WholeDataBuffer
  11. {
  12. public string year = "1";
  13. public MonthClass monthclassList = new MonthClass();
  14. public WholeDataBuffer(string Year, string Month, List<string> DataList)
  15. {
  16. // TODO: Complete member initialization
  17. year = Year;
  18. try
  19. {
  20. monthclassList.month = Month;
  21. monthclassList.titleLan1 = DataList[0];
  22. monthclassList.titleLan2 = DataList[1];
  23. monthclassList.Language1 = DataList[2];
  24. monthclassList.Language2 = DataList[3];
  25. monthclassList.imagepath = DataList[4];
  26. }
  27. catch (Exception)
  28. {
  29. MessageBox.Show("Loading xml file Failure.");
  30. }
  31. }
  32. }
  33. public class XmlData
  34. {
  35. public string yearlan1 = "1";
  36. public string yearlan2 = "1";
  37. public string yearlan3 = "1";
  38. public string yearlan4 = "1";
  39. public List<MonthClass> monthclassList = new List<MonthClass>();
  40. public XmlData()
  41. { }
  42. public XmlData(EventGroup eventGroup)
  43. {
  44. yearlan1 = eventGroup.YearLan1;
  45. yearlan2 = eventGroup.YearLan2;
  46. yearlan3 = eventGroup.YearLan3;
  47. yearlan4 = eventGroup.YearLan4;
  48. for (int index = 0; index < eventGroup.ListDates.Count; index++)
  49. {
  50. MonthClass monthclass = new MonthClass(eventGroup.ListDates[index]);
  51. monthclassList.Add(monthclass);
  52. }
  53. }
  54. }
  55. public class MonthClass
  56. {
  57. public string month = "0";
  58. public string titleLan1 = "";
  59. public string titleLan2 = "";
  60. public string titleLan3 = "";
  61. public string titleLan4 = "";
  62. public string Language1 = "";
  63. public string Language2 = "";
  64. public string Language3 = "";
  65. public string Language4 = "";
  66. public string imagepath = "";
  67. public MonthClass()
  68. { }
  69. public MonthClass(ListDate listDate)
  70. {
  71. month = listDate.Month;
  72. titleLan1 = listDate.TitleLan1;
  73. titleLan2 = listDate.TitleLan2;
  74. titleLan3 = listDate.TitleLan3;
  75. titleLan4 = listDate.TitleLan4;
  76. Language1 = listDate.Script1;
  77. Language2 = listDate.Script2;
  78. Language3 = listDate.Script3;
  79. Language4 = listDate.Script4;
  80. imagepath = listDate.ImagePath;
  81. }
  82. }
  83. //儲存被點擊的資料
  84. public class TouchInfo
  85. {
  86. public int TouchIndex;
  87. public int IndexofEvent;
  88. public int IndexofPic;
  89. public TouchInfo(int index, int indexofevent, int indexofpic)
  90. {
  91. TouchIndex = index;
  92. IndexofEvent = indexofevent;
  93. IndexofPic = indexofpic;
  94. }
  95. }
  96. }