| | |
| | | var btnDel = rowLayout.AddDeleteControl(); |
| | | btnDel.ButtonClickEvent += (sender, e) => |
| | | { |
| | | RemoveTargets(bindObj, btnDel); |
| | | ClearTargets(bindObj); |
| | | }; |
| | | #endregion |
| | | } |
| | |
| | | /// <param name="bindDevice"></param> |
| | | /// <param name="btnDel"></param> |
| | | /// <returns></returns> |
| | | private void RemoveTargets(BindListAllInfo bindDevice, Button btnDel) |
| | | private void RemoveTargets(BindListAllInfo bindDevice) |
| | | { |
| | | var delDevice = new DelDeviceBindData(); |
| | | delDevice.DeviceAddr = bindDevice.KeyMacAddr; |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 清除多功能面板的目标 |
| | | /// </summary> |
| | | /// <param name="bindDevice"></param> |
| | | /// <param name="btnDel"></param> |
| | | /// <returns></returns> |
| | | private void ClearTargets(BindListAllInfo bindDevice) |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | var currentKey = new Panel(); |
| | | currentKey.DeviceAddr = bindDevice.KeyMacAddr; |
| | | currentKey.DeviceEpoint = bindDevice.KeyEpoint; |
| | | currentKey.CurrentGateWayId = curControlDev.CurrentGateWayId; |
| | | var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey); |
| | | if (bindResult != null && bindResult.clearBindInfoResponseData != null) |
| | | { |
| | | if (bindResult.clearBindInfoResponseData.Result != 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.ContainsKey(bindDevice.KeyMacAddr + bindDevice.KeyEpoint)) |
| | | { |
| | | MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.Remove(bindDevice.KeyMacAddr + bindDevice.KeyEpoint); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | RefreshBindListUI(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5006" + ")", Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 匹配的类型列表 |