陈嘉乐
2020-09-02 652243206427f35a256400a149a1734085824cb9
ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -225,6 +225,7 @@
            //场景名称
            var rowScene = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.SceneName), this.cloneScene.Name);
            rowScene.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputSceneName);
            rowScene.txtInput.MaxByte = 32;//限制只能输入32个字节
            rowScene.Y = btnTitle.Bottom + Application.GetRealHeight(23);
            frameBack.AddChidren(rowScene);
            rowScene.InitControl();
@@ -291,10 +292,10 @@
                this.ShowAddTargetMenu();
            };
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //从网关获取场景的执行目标
                var result = await this.GetSceneTargetList();
                var result = this.GetSceneTargetList();
                if (result == true)
                {
                    //添加【执行目标行】
@@ -633,7 +634,7 @@
        /// 从网关获取场景的执行目标
        /// </summary>
        /// <returns></returns>
        private async System.Threading.Tasks.Task<bool> GetSceneTargetList()
        private bool GetSceneTargetList()
        {
            if (this.editorScene == null || this.listAdjustTarget != null)
            {
@@ -643,7 +644,7 @@
            //打开进度条
            this.ShowProgressBar();
            //获取执行目标列表
            var listData = await HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene);
            var listData = HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene);
            if (listData == null)
            {
                this.CloseProgressBar(ShowReLoadMode.YES);
@@ -676,7 +677,7 @@
            //那个特殊的控件
            this.frameBottomTemp = new FrameLayout();
            frameBottomTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(23);
            this.listBodyControl.AddChidrenFrame(frameBottomTemp);
            this.listBodyControl.AddChidren(frameBottomTemp);
        }
        #endregion
@@ -789,10 +790,10 @@
        /// <summary>
        /// 保存新建的场景
        /// </summary>
        private async void SaveSceneDataByNewMode()
        private void SaveSceneDataByNewMode()
        {
            //添加场景
            this.editorScene = await HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget);
            this.editorScene = HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget);
            //关闭进度条
            this.CloseProgressBar();
@@ -822,6 +823,9 @@
            this.editorScene.IconPath = this.cloneScene.IconPath;
            this.editorScene.Save();
            //新建场景,主页需要重新刷新
            UserView.UserPage.Instance.RefreshAllForm = true;
            HdlThreadLogic.Current.RunMain(() =>
            {
                //调用回调函数
@@ -841,6 +845,8 @@
                var result = await HdlSceneLogic.Current.EditorSceneNameFromGateway(this.editorScene, this.cloneScene.Name);
                if (result == false)
                {
                    //关闭进度条
                    this.CloseProgressBar();
                    return;
                }
            }
@@ -848,10 +854,10 @@
            {
                //修改场景
                var result = await HdlSceneLogic.Current.EditorSceneFromGateway(this.editorScene, this.listAdjustTarget);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
                {
                    //关闭进度条
                    this.CloseProgressBar();
                    return;
                }
            }
@@ -861,6 +867,15 @@
                //变更房间
                HdlSceneLogic.Current.ChangedSceneRoom(this.editorScene, this.nowRoomId);
            }
            else
            {
                //移除出房间
                var room = HdlRoomLogic.Current.GetRoomBySceneId(this.editorScene.Id);
                if (room != null)
                {
                    HdlSceneLogic.Current.DeleteSceneFromRoom(room, this.editorScene);
                }
            }
            //图片改变了
            if (isScenePictrueChanged == true)
@@ -868,7 +883,7 @@
                if (this.editorScene.IconPathType != 0)
                {
                    //删除自定义图片
                    Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath));
                    HdlFileLogic.Current.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath));
                    HdlAutoBackupLogic.DeleteFile(this.editorScene.IconPath);
                }
                if (this.cloneScene.IconPathType != 0)
@@ -889,6 +904,12 @@
            this.editorScene.IconPath = this.cloneScene.IconPath;
            this.editorScene.Save();
            //编辑场景,主页需要重新刷新
            UserView.UserPage.Instance.RefreshAllForm = true;
            //关闭进度条
            this.CloseProgressBar();
            HdlThreadLogic.Current.RunMain(() =>
            {
                //调用回调函数