| | |
| | | //超时时间
|
| | | int TimeOut = 0;
|
| | | bool receiptAll = false;
|
| | | bool canReceve = false;
|
| | |
|
| | | var listScene = new List<Scene.GetSceneAllInfo>();
|
| | | Action<string, string> action = (topic, message) =>
|
| | |
| | | var sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene.GetSceneAllInfo>(jobject["Data"].ToString());
|
| | | listScene.Add(sceneGetAllInfo);
|
| | |
|
| | | //更够接收得到场景
|
| | | canReceve = true;
|
| | | if (sceneGetAllInfo.ScenesNum == sceneGetAllInfo.ScenesSum)
|
| | | {
|
| | | //接收完成
|
| | |
| | | }
|
| | | mainGateway.Actions -= action;
|
| | | action = null;
|
| | | if (receiptAll == false)
|
| | | if (canReceve == false)
|
| | | {
|
| | | //获取场景列表失败,网关回复超时
|
| | | this.ShowTipMsg(Language.StringByID(R.MyInternationalizationString.uGetSceneListFailAndTimeOut));
|
| | | return null;
|
| | | }
|
| | | else if (receiptAll == false)
|
| | | {
|
| | | //网络不稳定,场景列表信息缺损
|
| | | this.ShowTipMsg(Language.StringByID(R.MyInternationalizationString.uNetworkUnStableAndSceneInfoIsNotFull));
|
| | |
| | | {
|
| | | nowRoom.ListSceneId.Add(scene.Id);
|
| | | nowRoom.Save();
|
| | | //添加收藏场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | HdlAutoBackupLogic.DeleteFile(sceneUI.IconPath);
|
| | | }
|
| | | }
|
| | | //删除场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 清空本地全部的场景数据
|
| | | /// </summary>
|
| | | public void DeleteAllLocalScene()
|
| | | {
|
| | | var listScene = new List<SceneUI>();
|
| | | foreach (var scene in this.dicScenes.Values)
|
| | | {
|
| | | listScene.Add(scene);
|
| | | }
|
| | | foreach (var scene in listScene)
|
| | | {
|
| | | this.DeleteLocalScene(scene);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | nowRoom.ListSceneId.Remove(scene.Id);
|
| | | nowRoom.Save();
|
| | | //取消收藏场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 获取场景___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取本地全部的场景(包含未分配)
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<SceneUI> GetAllLocalScene()
|
| | | {
|
| | | //房间的场景放在前面
|
| | | var listScene = this.GetAllRoomSceneList();
|
| | | //未分配的场景
|
| | | var listUnalloctScene = this.GetUnalloctedScenes();
|
| | | listScene.AddRange(listUnalloctScene);
|
| | | return listScene;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 通过场景id获取场景
|
| | |
| | | public List<string> GetAllSceneFile()
|
| | | {
|
| | | List<string> listSceneFile = new List<string>();
|
| | | List<string> listAllFile = Global.FileListByHomeId();
|
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | |
|
| | | foreach (string file in listAllFile)
|
| | | {
|