| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; |
| | | using Shared; |
| | |
| | | //进来不允许左滑 |
| | | MainPage.BasePageView.ScrollEnabled = false; |
| | | View.Buttons buttons = new View.Buttons(); |
| | | buttons.AddFrameLayout(this, (if_value, view) => |
| | | buttons.AddFrameLayout(this, (if_value, view) => |
| | | { |
| | | //关闭允许左滑 |
| | | MainPage.BasePageView.ScrollEnabled = true; |
| | |
| | | Method method = new Method(); |
| | | method.AddControl(this, (control) => |
| | | { |
| | | //成功后移除; |
| | | view.RemoveFromParent(); |
| | | //成功后移除; |
| | | view.RemoveFromParent(); |
| | | AddButton addButton = new AddButton(); |
| | | MainPage.BasePageView.AddChidren(addButton); |
| | | addButton.Show(control); |
| | |
| | | GetDeviceTypeList(true, () => |
| | | { |
| | | DeviceTypeViewClick(if_value); |
| | | //获取成功之后移除 |
| | | view.RemoveFromParent(); |
| | | //获取成功之后移除 |
| | | view.RemoveFromParent(); |
| | | |
| | | }); |
| | | } |
| | |
| | | DeviceTypeViewClick(if_value); |
| | | view.RemoveFromParent(); |
| | | } |
| | | |
| | | } |
| | | }, 7); |
| | | }; |
| | | #endregion |
| | | ///初始化界面 |
| | | UIView(vv); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载UI界面 |
| | | /// </summary> |
| | |
| | | /// <param name="if_value">控件索引值</param> |
| | | private void DeviceTypeViewClick(int if_value) |
| | | { |
| | | |
| | | var strings = View.Buttons.GetTypeString(if_value).Split('-'); |
| | | var jobDeviceType = DeviceTypeList.Find((c) => c.deviceType == strings[0]); |
| | | if (jobDeviceType == null) |
| | |
| | | }); |
| | | |
| | | }); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 读取红外设备类型列表 |
| | |
| | | { |
| | | PirSend.GetDeviceTypesList(this, (responsePackNew) => |
| | | { |
| | | |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | //清空之前数据 |
| | | DeviceTypeList.Clear(); |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | try |
| | | { |
| | | var jay = jArray[a]; |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); |
| | | if (objDeviceType != null) |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | { |
| | | if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) |
| | | var jay = jArray[a]; |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var objDeviceType = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceType>(str); |
| | | if (objDeviceType != null) |
| | | { |
| | | DeviceTypeList.Add(objDeviceType); |
| | | if (null == DeviceTypeList.Find((c) => c.id == objDeviceType.id)) |
| | | { |
| | | DeviceTypeList.Add(objDeviceType); |
| | | } |
| | | } |
| | | } |
| | | action(); |
| | | } |
| | | action(); |
| | | catch |
| | | { |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | //清空之前数据 |
| | | brandList.Clear(); |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | try |
| | | { |
| | | var jay = jArray[a]; |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str); |
| | | if (brand != null) |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | { |
| | | if (null == brandList.Find((c) => c.id == brand.id)) |
| | | var jay = jArray[a]; |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var brand = Newtonsoft.Json.JsonConvert.DeserializeObject<Brand>(str); |
| | | if (brand != null) |
| | | { |
| | | brandList.Add(brand); |
| | | if (null == brandList.Find((c) => c.id == brand.id)) |
| | | { |
| | | brandList.Add(brand); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | actionBrand(brandList); |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | actionBrand(brandList); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |