old mode 100644
new mode 100755
| | |
| | | //清空本地缓存
|
| | | this.dicRooms.Clear();
|
| | | //检测我的喜爱这个房间对象
|
| | | this.CheckLoveRoom(); |
| | | |
| | | this.CheckLoveRoom();
|
| | | |
| | | foreach (var roomId in Config.Instance.Home.ListRooms)
|
| | | {
|
| | | //从文件里面获取房间对象
|
| | |
| | | /// 增加房间
|
| | | /// </summary>
|
| | | /// <param name="room">Room.</param>
|
| | | public void AddRoom(Room room)
|
| | | /// <param name="rorefreshRoomViewom">是否刷新房间视图列表界面</param>
|
| | | public void AddRoom(Room room, bool refreshRoomView = true)
|
| | | {
|
| | | if (Global.IsExistsByHomeId(room.FileName) == true
|
| | | || Config.Instance.Home.ListRooms.Contains(room.Id) == true)
|
| | |
| | | room.Save();
|
| | | //备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(room.FileName);
|
| | | //刷新房间视图列表
|
| | | this.RefreshRoomListView();
|
| | | if (refreshRoomView == true)
|
| | | {
|
| | | //刷新房间视图列表
|
| | | this.RefreshRoomListView();
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <returns></returns>
|
| | | public List<Room> GetFloorSortRoom(string i_floorKeys, bool getShard = true)
|
| | | {
|
| | | if (i_floorKeys == null)
|
| | | {
|
| | | i_floorKeys = string.Empty;
|
| | | }
|
| | | Dictionary<string, List<string>> dicAllSort = new Dictionary<string, List<string>>();
|
| | | //读取房间顺序
|
| | | string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.RoomSortFile);
|
| | |
| | | if (strData != null)
|
| | | {
|
| | | listFloorSort = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(strData);
|
| | | } |
| | | |
| | | |
| | | foreach (string keys in Common.Config.Instance.Home.FloorDics.Keys) |
| | | { |
| | | if (listFloorSort != null) |
| | | { |
| | | if (listFloorSort.Contains(keys) == false) |
| | | { |
| | | //新添加的楼层 |
| | | listFloorSort.Add(keys); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | var dic = new Dictionary<string, string>(); |
| | | if (listFloorSort != null) |
| | | { |
| | | for (int i = 0; i < listFloorSort.Count; i++) |
| | | { |
| | | if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true) |
| | | { |
| | | dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]]; |
| | | } |
| | | } |
| | | } |
| | | //保存顺序 |
| | | }
|
| | | foreach (string keys in Common.Config.Instance.Home.FloorDics.Keys)
|
| | | {
|
| | | if (listFloorSort.Contains(keys) == false)
|
| | | {
|
| | | //新添加的楼层
|
| | | listFloorSort.Add(keys);
|
| | | }
|
| | | }
|
| | |
|
| | | var dic = new Dictionary<string, string>();
|
| | | for (int i = 0; i < listFloorSort.Count; i++)
|
| | | {
|
| | | if (Config.Instance.Home.FloorDics.ContainsKey(listFloorSort[i]) == true)
|
| | | {
|
| | | dic[listFloorSort[i]] = Config.Instance.Home.FloorDics[listFloorSort[i]];
|
| | | }
|
| | | }
|
| | |
|
| | | //保存顺序
|
| | | UserCenterLogic.SaveFileContent(fullName, listFloorSort);
|
| | | return dic;
|
| | | }
|