From f1e8c2cde53050ffe78ef3b13346ba77ca65110c Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 03 十二月 2020 17:55:52 +0800 Subject: [PATCH] 2020-12-03-2 --- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 53 +++++++++++------------------------------------------ 1 files changed, 11 insertions(+), 42 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 909a6ba..1db4522 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -77,11 +77,11 @@ } break; - - - - - + + + + + } #region 淇濆瓨 ///淇濆瓨View @@ -262,43 +262,12 @@ LogicView.SwitchView switchView = new LogicView.SwitchView(); switchView.FLayoutView(frame, len); - - Button btnOn = new Button - { - TextAlignment = TextAlignment.Center, - TextSize = LogicView.TextSize.text16, - TextColor = CSS.CSS_Color.textCancelColor, - TextID = StringId.onLogic, - Height = Application.GetRealHeight(44), - Width = Application.GetRealWidth(343), - - }; - switchView.frameLayout.AddChidren(btnOn); - Button btnLine = new Button - { - Height = 1, - BackgroundColor = CSS.CSS_Color.viewLine, - Y = btnOn.Bottom, - }; - switchView.frameLayout.AddChidren(btnLine); - Button btnOff = new Button - { - Y = btnLine.Bottom, - TextAlignment = TextAlignment.Center, - TextSize = LogicView.TextSize.text16, - TextColor = CSS.CSS_Color.textCancelColor, - TextID = StringId.offLogic, - Height = Application.GetRealHeight(44), - Width = Application.GetRealWidth(343), - }; - switchView.frameLayout.AddChidren(btnOff); - Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "on_off"); LogicMethod.dictionary(dic, "comparator", "="); LogicMethod.dictionary(dic, "data_type", "string"); keyVlaue = "on_off"; - btnOn.MouseUpEventHandler += (sender2, e2) => + switchView.btnOn.MouseUpEventHandler += (sender2, e2) => { LogicMethod.dictionary(dic, "value", "on"); RemView(frame); @@ -306,7 +275,7 @@ selectedState = device.functionType + "_on"; AddDictionaryData(dicSateteList, keyVlaue, dic); }; - btnOff.MouseUpEventHandler += (sender3, e3) => + switchView.btnOff.MouseUpEventHandler += (sender3, e3) => { LogicMethod.dictionary(dic, "value", "off"); RemView(frame); @@ -316,13 +285,13 @@ }; if (button.Text != "") { - if (button.Text == btnOn.Text) + if (button.Text == switchView.btnOn.Text) { - btnOn.TextColor = CSS.CSS_Color.textConfirmColor; + switchView.btnOn.TextColor = CSS.CSS_Color.textConfirmColor; } - else + else if (button.Text == switchView.btnOff.Text) { - btnOff.TextColor = CSS.CSS_Color.textConfirmColor; + switchView.btnOff.TextColor = CSS.CSS_Color.textConfirmColor; } } } -- Gitblit v1.8.0