From 4c40f503acf2bcf90d294cc439ef46ba259b9c60 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 02 十二月 2019 09:27:46 +0800 Subject: [PATCH] 新版本,如果 IOS 编译报错,先注释掉 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 72 ++++++++++++++++++++++++++++------- 1 files changed, 57 insertions(+), 15 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs index c2a79dc..a804ced 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs @@ -20,6 +20,52 @@ /// </summary> public static List<CommonDevice> oldTargetList = new List<CommonDevice>(); + //public static async System.Threading.Tasks.Task<int> RemoveTargets(BindObj.BindListResponseObj bindDevice, Panel currentKey) + //{ + // var delDevice = new BindObj.DelDeviceBindData(); + // delDevice.DeviceAddr = currentKey.DeviceAddr; + // delDevice.Epoint = currentKey.DeviceEpoint; + + // if (bindDevice.BindType == 0 || bindDevice.BindType == 1) + // { + // var removeDevice = new BindObj.RemoveBindListObj(); + // removeDevice.BindCluster = bindDevice.BindCluster; + // removeDevice.BindType = 0; + // removeDevice.BindMacAddr = bindDevice.BindMacAddr; + // removeDevice.BindEpoint = bindDevice.BindEpoint; + // delDevice.RemoveBindList.Add(removeDevice); + // } + // else if (bindDevice.BindType == 2) + // { + // var removeDevice = new BindObj.RemoveBindListObj(); + // removeDevice.BindCluster = bindDevice.BindCluster; + // removeDevice.BindType = 1; + // removeDevice.BindScenesId = bindDevice.BindScenesId; + // delDevice.RemoveBindList.Add(removeDevice); + // } + // var delResult = await currentKey.DelDeviceBindAsync(delDevice); + // foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList) + // { + // switch (re.Result) + // { + // case 0: + // return 0; + // break; + // case 4: + + // if (delResult.removeBindResultResponseData != null) + // { + // if (delResult.removeBindResultResponseData.Result == 0) + // { + // return 0; + // } + // } + // break; + // } + // } + // return -1; + //} + public static async System.Threading.Tasks.Task<int> RemoveTargets(BindObj.BindListResponseObj bindDevice, Panel currentKey) { var delDevice = new BindObj.DelDeviceBindData(); @@ -44,24 +90,20 @@ delDevice.RemoveBindList.Add(removeDevice); } var delResult = await currentKey.DelDeviceBindAsync(delDevice); - foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList) + if (delResult != null && delResult.removeBindResultResponseData != null) { - switch (re.Result) + if (delResult.removeBindResultResponseData.Result == 0) { - case 0: - return 0; - break; - case 4: - - if (delResult.removeBindResultResponseData != null) - { - if (delResult.removeBindResultResponseData.Result == 0) - { - return 0; - } - } - break; + return 0; } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); + } + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); } return -1; } -- Gitblit v1.8.0