New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Shared.Phone.UserCenter |
| | | { |
| | | /// <summary> |
| | | /// 住宅的配置 |
| | | /// </summary> |
| | | public class ResidenceOptionClass |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | |
| | | /// <summary> |
| | | /// 是否使用安防快捷方式 |
| | | /// </summary> |
| | | public bool SafetyShortcut = false; |
| | | /// <summary> |
| | | /// 安防报警信息记录一天内最大的报警数 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int SafetyOnedayMaxAlarmMsgCount = 50; |
| | | /// <summary> |
| | | /// 安防报警信息记录最大天数 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int SafetyMaxAlarmMsgDay = 5; |
| | | /// <summary> |
| | | /// 门锁报警信息记录一天内最大的报警数 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int DoorLockOnedayMaxAlarmMsgCount = 200; |
| | | /// <summary> |
| | | /// 门锁报警信息记录最大天数 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int DoorLockMaxAlarmMsgDay = 5; |
| | | /// <summary> |
| | | /// 当前主页,场景和功能所选择的分支 1:场景 2:功能 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int HomeMainPageSwitchIndex = 1; |
| | | /// <summary> |
| | | /// 当前分类,场景和功能所选择的分支 0:场景 1:功能 2:自动化 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public int CategoryPageSwitchIndex = 0; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 一般方法___________________________ |
| | | |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | public void Save() |
| | | { |
| | | //写入内容 |
| | | HdlFileLogic.Current.SaveFileContent(DirNameResourse.ResidenceOptionFile, this); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResidenceOptionClass Load() |
| | | { |
| | | string fileName = DirNameResourse.ResidenceOptionFile; |
| | | if (System.IO.File.Exists(fileName) == false) |
| | | { |
| | | return new ResidenceOptionClass(); |
| | | } |
| | | try |
| | | { |
| | | var varByte = HdlFileLogic.Current.ReadFileByteContent(fileName); |
| | | string strValue = System.Text.Encoding.UTF8.GetString(varByte); |
| | | var info = Newtonsoft.Json.JsonConvert.DeserializeObject<ResidenceOptionClass>(strValue); |
| | | |
| | | return info; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HdlLogLogic.Current.WriteLog(ex); |
| | | return new ResidenceOptionClass(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |