public EyesTestService(App app) { this.app = app; this.app.Exit += app_Exit; statisticList = new EyesTestListModel(); statisticList.Data = new List <EyesTestModel>(); xmlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, dir, "eyestest.xml"); xml = new XmlExtensions(xmlPath); }
/// <summary> /// 加载统计数据 /// </summary> public void LoadStatisticData() { if (File.Exists(xmlPath)) { var data = xml.ToModel(typeof(EyesTestListModel)); if (data != null) { statisticList = data as EyesTestListModel; } else { xml.Save(statisticList); } } else { xml.Save(statisticList); } }