| | |
| | | /// </summary> |
| | | public string ResidenceAddressName = string.Empty; |
| | | /// <summary> |
| | | /// 房间列表(房间的ID) |
| | | /// </summary> |
| | | public List<string> ListRooms = new List<string>(); |
| | | /// <summary> |
| | | /// 楼层字典 |
| | | /// key:FloorId |
| | | /// value:FloorName |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 添加房间路径_________________________ |
| | | |
| | | /// <summary> |
| | | /// 添加房间ID |
| | | /// </summary> |
| | | /// <returns><c>true</c>, if room list file path was added, <c>false</c> otherwise.</returns> |
| | | /// <param name="roomFilePath">Room file path.</param> |
| | | public void AddRoomId(string roomId) |
| | | { |
| | | if (ListRooms.Contains(roomId) == false) |
| | | {
|
| | | ListRooms.Add(roomId);
|
| | | this.Save(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 删除房间路径_________________________ |
| | | |
| | | /// <summary> |
| | | /// 移除房间Id |
| | | /// </summary> |
| | | /// <returns><c>true</c>, if room list file path was added, <c>false</c> otherwise.</returns> |
| | | /// <param name="roomFilePath">Room file path.</param> |
| | | public void RemoveRoomId(string roomId) |
| | | { |
| | | if (ListRooms.Contains(roomId)==true) |
| | | {
|
| | | ListRooms.Remove(roomId);
|
| | | Save(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 保存____________________________ |
| | | |
| | | /// <summary> |
| | |
| | | System.IO.Directory.CreateDirectory(path); |
| | | } |
| | | path = System.IO.Path.Combine(path, FileName); |
| | | Shared.IO.FileUtils.WriteFileByBytes(path, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this))); |
| | | HdlFileLogic.Current.SaveFileContent(path, this); |
| | | |
| | | if (autoBackup == true && Id == Config.Instance.HomeId) |
| | | { |
| | | HdlAutoBackupLogic.AddOrEditorFile(FileName); |