| | |
| | | |
| | | #endregion |
| | | |
| | | #region 检测更新 |
| | | #region ■ 检测更新_______________________ |
| | | /// <summary> |
| | | /// 检测更新线程 |
| | | /// </summary> |
| | |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 恢复住宅 |
| | | /// 2020-12-03 待测试未检测 |
| | | /// </summary> |
| | | public void RestoreHomeBackup(string RegionID) |
| | | { |
| | | var isExist = FileUtils.ExistRegion(RegionID); |
| | | if (isExist) |
| | | { |
| | | //存在则恢复 |
| | | string newRegionRootPath = FileUtils.CreateRegionBackup(RegionID); |
| | | FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 恢复住宅 |
| | | ///// 2020-12-03 待测试未检测 |
| | | ///// </summary> |
| | | //public void RestoreHomeBackup(string RegionID) |
| | | //{ |
| | | // var isExist = FileUtils.ExistRegion(RegionID); |
| | | // if (isExist) |
| | | // { |
| | | // //存在则恢复 |
| | | // string newRegionRootPath = FileUtils.CreateRegionBackup(RegionID); |
| | | // FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | | // } |
| | | //} |
| | | |
| | | #region 推送处理 |
| | | #region ■ 推送处理_______________________ |
| | | /// <summary> |
| | | /// 推送消息处理 |
| | | /// </summary> |
| | |
| | | try |
| | | { |
| | | #region 保存本地数据至文件夹 |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | //清空之前的住宅文件 |
| | | FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | var backuplist = FileUtils.ReadFiles(); |
| | | //移动文件 |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | if (fileInfo.Exists) |
| | | { |
| | | fileInfo.MoveTo(oldRegionRootPath + fileName); |
| | | MainPage.Log("move file : " + fileName); |
| | | } |
| | | } |
| | | //string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | ////清空之前的住宅文件 |
| | | //FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | //var backuplist = FileUtils.ReadFiles(); |
| | | ////移动文件 |
| | | //foreach (var fileName in backuplist) |
| | | //{ |
| | | // System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | // if (fileInfo.Exists) |
| | | // { |
| | | // fileInfo.MoveTo(oldRegionRootPath + fileName); |
| | | // MainPage.Log("move file : " + fileName); |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | finally |
| | | { |
| | | FileUtils.DeleteAllFile(); |
| | | //FileUtils.DeleteAllFile(); |
| | | //2.注销推送 |
| | | new HttpServerRequest().SignOutPush(); |
| | | //3.跳转登录页面 |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 常用方法_______________________ |
| | | /// <summary> |
| | | /// 设置下划线按钮状态 |
| | | /// 统一封装设置方法 |
| | | /// </summary> |
| | | /// <param name="button">下划线按钮</param> |
| | | /// <param name="bottomLineType">状态</param> |
| | | public void BottomLineShowType(Button button, BottomLineType bottomLineType) |
| | | { |
| | | switch (bottomLineType) |
| | | { |
| | | case BottomLineType.GotFocus: |
| | | button.BackgroundColor = CSS_Color.MainColor; |
| | | button.Height = Application.GetRealHeight(2); |
| | | break; |
| | | case BottomLineType.Error: |
| | | button.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | button.Height = Application.GetRealHeight(2); |
| | | break; |
| | | case BottomLineType.Normal: |
| | | button.BackgroundColor = CSS_Color.DividingLineColor; |
| | | button.Height = Application.GetRealHeight(1); |
| | | break; |
| | | default: |
| | | button.BackgroundColor = CSS_Color.DividingLineColor; |
| | | button.Height = Application.GetRealHeight(1); |
| | | break; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |