| | |
| | | /// <summary>
|
| | | /// 界面关闭事件(该事件目前给分类界面的自定义行控件使用)
|
| | | /// </summary>
|
| | | public Action<CommonDevice, Room> FormCloseEvent = null;
|
| | | public Action FormCloseEvent = null;
|
| | | /// <summary>
|
| | | /// 设备对象
|
| | | /// </summary>
|
| | | private CommonDevice device;
|
| | | /// <summary>
|
| | | /// 房间对象(这个房间有可能是喜爱)
|
| | | /// 房间对象(这个房间有可能是喜爱,有可能是null)
|
| | | /// </summary>
|
| | | private Room room = null;
|
| | | /// <summary>
|
| | |
| | | var btnBelongType = new NormalViewControl(700, 62, true);
|
| | | btnBelongType.Y = btnPic.Bottom + Application.GetRealHeight(35);
|
| | | btnBelongType.Gravity = Gravity.CenterHorizontal;
|
| | | btnBelongType.TextID = infoType.BeloneTextId;
|
| | | btnBelongType.Text = infoType.BeloneText;
|
| | | btnBelongType.TextSize = 15;
|
| | | btnBelongType.TextAlignment = TextAlignment.Center;
|
| | | listBackControl.frameTable.AddChidren(btnBelongType);
|
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.FunctionName);
|
| | | string deviceName = LocalDevice.Current.GetDeviceEpointName(device);
|
| | | var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
|
| | | btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnNote);
|
| | | btnNote.InitControl();
|
| | | //划线
|
| | |
| | | };
|
| | |
|
| | | //喜爱房间不允许变更区域
|
| | | if (this.room.IsLove == false)
|
| | | if (this.room == null || this.room.IsLove == false)
|
| | | {
|
| | | //所属区域
|
| | | var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
|
| | |
| | | var btnBelongType = new NormalViewControl(700, 62, true);
|
| | | btnBelongType.Y = btnPic.Bottom + Application.GetRealHeight(35);
|
| | | btnBelongType.Gravity = Gravity.CenterHorizontal;
|
| | | btnBelongType.TextID = infoType.BeloneTextId;
|
| | | btnBelongType.Text = infoType.BeloneText;
|
| | | btnBelongType.TextSize = 15;
|
| | | btnBelongType.TextAlignment = TextAlignment.Center;
|
| | | listBackControl.frameTable.AddChidren(btnBelongType);
|
| | |
| | | btnNote.AddBottomLine();
|
| | |
|
| | | //喜爱房间不允许出现区域
|
| | | if (this.room.IsLove == false)
|
| | | if (this.room == null || this.room.IsLove == false)
|
| | | {
|
| | | //所属区域
|
| | | caption = Language.StringByID(R.MyInternationalizationString.uBelongArea);
|
| | |
| | | /// 设备重命名
|
| | | /// </summary>
|
| | | /// <param name="i_deviceName">deviceName.</param>
|
| | | private async void DeviceReName(string i_deviceName, bool closeForm)
|
| | | private void DeviceReName(string i_deviceName, bool closeForm)
|
| | | {
|
| | | //修改MAC名
|
| | | string deviceName = i_deviceName.Trim();
|
| | | var result = await LocalDevice.Current.ReName(this.device, deviceName);
|
| | | var result = LocalDevice.Current.ReName(this.device, deviceName);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | this.FormCloseEvent?.Invoke(this.device, this.room);
|
| | | this.FormCloseEvent?.Invoke();
|
| | | this.FormCloseEvent = null;
|
| | |
|
| | | base.CloseFormBefore();
|