黄学彪
2020-09-01 dee21bf452a8979d0515d13e534fbb69ed9715dd
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
@@ -113,6 +113,11 @@
                //关闭自身
                this.CloseForm();
            };
            //如果当前是展示模板,则不能编辑
            if (Common.Config.Instance.Home.IsShowTemplate == true)
            {
                btnFinish.CanClick = false;
            }
        }
        /// <summary>
@@ -134,27 +139,31 @@
            listview.AddChidren(btnDeviceName);
            btnDeviceName.InitControl();
            btnDeviceName.AddBottomLine();
            btnDeviceName.txtInput.FinishInputEvent += () =>
            //如果当前是展示模板,则不能编辑
            if (Common.Config.Instance.Home.IsShowTemplate == false)
            {
                string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
                if (btnDeviceName.Text.Trim() == string.Empty)
                btnDeviceName.txtInput.FinishInputEvent += () =>
                {
                    //将名字还原
                    btnDeviceName.Text = oldName;
                }
                if (oldName != btnDeviceName.Text.Trim())
                {
                    //设备名称修改
                    var result = Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
                    if (result == false)
                    string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
                    if (btnDeviceName.Text.Trim() == string.Empty)
                    {
                        return;
                        //将名字还原
                        btnDeviceName.Text = oldName;
                    }
                    //回路备注修改成功!
                    string msg = Language.StringByID(R.MyInternationalizationString.uDeviceEpointReNoteSuccess);
                    this.ShowMassage(ShowMsgType.Tip, msg);
                }
            };
                    if (oldName != btnDeviceName.Text.Trim())
                    {
                        //设备名称修改
                        var result = Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
                        if (result == false)
                        {
                            return;
                        }
                        //回路备注修改成功!
                        string msg = Language.StringByID(R.MyInternationalizationString.uDeviceEpointReNoteSuccess);
                        this.ShowMassage(ShowMsgType.Tip, msg);
                    }
                };
            }
            //所属区域
            var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
@@ -184,7 +193,8 @@
        private void InitTopRightMenu()
        {
            //检测此回路是否拥有定位功能
            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false
                || Common.Config.Instance.Home.IsShowTemplate == true)
            {
                return;
            }