| | |
| | | //超时时间
|
| | | 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));
|
| | |
| | | }
|
| | |
|
| | | /// <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>
|
| | | /// 删除场景(这个只移除内存)
|
| | | /// </summary>
|
| | | /// <param name="scene"></param>
|
| | |
| | | #region ■ 获取场景___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取本地全部的场景(包含未分配)
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<SceneUI> GetAllLocalScene()
|
| | | {
|
| | | //房间的场景放在前面
|
| | | var listScene = this.GetAllRoomSceneList();
|
| | | //未分配的场景
|
| | | var listUnalloctScene = this.GetUnalloctedScenes();
|
| | | listScene.AddRange(listUnalloctScene);
|
| | | return listScene;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 通过场景id获取场景
|
| | | /// </summary>
|
| | | /// <returns>The scene UIB y scene identifier.</returns>
|