From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 11 九月 2020 09:16:59 +0800 Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs index 18d80cf..c4dfa2e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/ResidenceOption.cs @@ -55,18 +55,8 @@ /// </summary> public void Save() { - try - { - var data = Newtonsoft.Json.JsonConvert.SerializeObject(this); - var byteData = System.Text.Encoding.UTF8.GetBytes(data); - string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ResidenceOptionFile); - //鍐欏叆鍐呭 - Shared.IO.FileUtils.WriteFileByBytes(fullName, byteData); - } - catch (Exception ex) - { - HdlLogLogic.Current.WriteLog(ex); - } + //鍐欏叆鍐呭 + HdlFileLogic.Current.SaveFileContent(DirNameResourse.ResidenceOptionFile, this); } /// <summary> @@ -75,14 +65,14 @@ /// <returns></returns> public ResidenceOptionClass Load() { - string fileName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ResidenceOptionFile); + string fileName = DirNameResourse.ResidenceOptionFile; if (System.IO.File.Exists(fileName) == false) { return new ResidenceOptionClass(); } try { - var varByte = Shared.IO.FileUtils.ReadFile(fileName); + var varByte = HdlFileLogic.Current.ReadFileByteContent(fileName); string strValue = System.Text.Encoding.UTF8.GetString(varByte); var info = Newtonsoft.Json.JsonConvert.DeserializeObject<ResidenceOptionClass>(strValue); -- Gitblit v1.8.0