| | |
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | };
|
| | | //如果当前是展示模板,则不能编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnFinish.CanClick = false;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | 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);
|
| | |
| | | private void InitTopRightMenu()
|
| | | {
|
| | | //检测此回路是否拥有定位功能
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false
|
| | | || Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | return;
|
| | | }
|