| | |
| | | { |
| | | |
| | | #region View布局代码 |
| | | UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑 |
| | | TopView view = new TopView(); |
| | | this.AddChidren(view.TopRowView()); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | } |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | // UserView.HomePage.Instance.ScrollEnabled = true;//恢复左滑 |
| | | action(); |
| | | RemoveFromParent(); |
| | | }; |
| | | var middle = new VerticalScrolViewLayout |
| | | { |
| | | Y = view.topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(1920 - 184-180), |
| | | Height = Application.GetRealHeight(Method.H - 184-180), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | |
| | | { |
| | | SelectedDeviceView selecteddevice = new SelectedDeviceView(); |
| | | selecteddevice.Show(middle); |
| | | selecteddevice.stateRow.AddRightView(selecteddevice.edit); |
| | | selecteddevice.stateRow.AddRightView(selecteddevice.del); |
| | | |
| | | var Type = int.Parse(ListConditions[i]["Type"]); |
| | | var conditions = ListConditions[i]; |
| | | string name = ""; |
| | |
| | | case 1: |
| | | { |
| | | var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]); |
| | | name = deviceinof.DeviceEpointName; |
| | | name = LocalDevice.Current.GetDeviceEpointName(deviceinof); |
| | | selecteddevice.regionNameBtn.Visible = true; |
| | | Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof); |
| | | |
| | |
| | | { |
| | | if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"]) |
| | | { |
| | | state = Common.Logic.CurrentLogic.Accounts[a]["Account"]; |
| | | state = Common.Logic.CurrentLogic.Accounts[a]["AccountName"]; |
| | | break; |
| | | |
| | | } |
| | |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | selecteddevice.selecetdFrameLayout.RemoveFromParent(); |
| | | //var logicCommunalPage = new LogicCommunalPage(); |
| | | //UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | //UserView.HomePage.Instance.PageIndex += 1; |
| | | //logicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | }; |
| | |
| | | addactionview.clickBtn.MouseUpEventHandler+= (sender, e) => |
| | | { |
| | | Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim(); |
| | | var deviceTarget = new DeviceTarget(); |
| | | UserView.HomePage.Instance.AddChidren(deviceTarget); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceTarget.Show(); |
| | | Method.View(IfString.Action_Logic,IfString.Action_LogicScene); |
| | | }; |
| | | |
| | | List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>(); |
| | |
| | | addflview.clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim(); |
| | | var deviceTarget = new DeviceTarget(); |
| | | UserView.HomePage.Instance.AddChidren(deviceTarget); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | deviceTarget.Show(); |
| | | Method.View(IfString.Action_Logic, IfString.Action_LogicScene); |
| | | }; |
| | | } |
| | | else |
| | |
| | | switch (linkType) |
| | | { |
| | | case 0: |
| | | case 8: |
| | | { |
| | | |
| | | var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); |
| | | name = deviceinof.DeviceEpointName; |
| | | name = LocalDevice.Current.GetDeviceEpointName(deviceinof); |
| | | actiondevice.regionNameBtn.Visible = true; |
| | | Method.RoomNmae(actiondevice.regionNameBtn, deviceinof); |
| | | |
| | | switch (deviceinof.Type) |
| | | { |
| | | case DeviceType.OnOffOutput: |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case DeviceType.DoorLock: |
| | | { |
| | | //门锁特殊 |
| | | icon = "ZigeeLogic/doorlock.png"; |
| | | if (actions["PassData"].ToString() == "055704010112") |
| | | { |
| | | state = Language.StringByID(MyInternationalizationString.logicopen); |
| | | } |
| | | else |
| | | { |
| | | state = Language.StringByID(MyInternationalizationString.logicclose); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | //在本地查找该场景; |
| | | var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString())); |
| | | //在本地查找该场景; |
| | | var sceneinof = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(Convert.ToInt32(actions["DeviceAddr"].ToString())); |
| | | //本地没有存在; |
| | | if (sceneinof == null) |
| | | { |
| | |
| | | var seconds = delaytimevalue % 60; |
| | | |
| | | icon = "ZigeeLogic/delay.png"; |
| | | |
| | | |
| | | if (Minutes != 0) |
| | | { |
| | | if (seconds == 0) |
| | |
| | | }; |
| | | break; |
| | | } |
| | | |
| | | if (linkType != 2) |
| | | { |
| | | actiondevice.stateRow.AddRightView(actiondevice.edit); |
| | | } |
| | | actiondevice.stateRow.AddRightView(actiondevice.del); |
| | | |
| | | if (linkType == 6 || linkType == 7) |
| | | { |
| | | actiondevice.ordinaryBtn.Visible = true; |
| | |
| | | { |
| | | switch (linkType) |
| | | { |
| | | |
| | | case 8: |
| | | case 0: |
| | | { |
| | | var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString()); |
| | |
| | | delayTime.Show(int.Parse(actiondevice.edit.Tag.ToString()), true); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }; |
| | | ///删除控件 |
| | |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | actiondevice.selecetdFrameLayout.RemoveFromParent(); |
| | | // devicesFrameLayout.RemoveFromParent(); |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | //var logicCommunalPage = new LogicCommunalPage(); |
| | | //UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | //UserView.HomePage.Instance.PageIndex += 1; |
| | | //logicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | }; |
| | |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 闪现式提示框的方法 |
| | | /// </summary> |
| | | /// <param name="tipText">提示内容</param> |
| | | /// <param name="second">停留时间单位为s</param> |
| | | public void TipView(string tipText, int second = 1) |
| | | { |
| | | |
| | | var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 }; |
| | | this.AddChidren(frameLayout); |
| | | |
| | | var btn = new Button |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Text = tipText, |
| | | BackgroundColor = 0xff1f1f1f, |
| | | Width = Application.GetRealWidth(500), |
| | | Height = Application.GetRealHeight(100), |
| | | Radius = (uint)Application.GetRealHeight(50), |
| | | }; |
| | | frameLayout.AddChidren(btn); |
| | | |
| | | var dateTime1 = DateTime.Now; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | while (true) |
| | | { |
| | | if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000) |
| | | { |
| | | //默认一秒关闭 |
| | | frameLayout.RemoveFromParent(); |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |