| | |
| | | |
| | | } |
| | | break; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | |
| | | 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); |
| | |
| | | selectedState = device.functionType + "_on"; |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender3, e3) => |
| | | switchView.btnOff.MouseUpEventHandler += (sender3, e3) => |
| | | { |
| | | LogicMethod.dictionary(dic, "value", "off"); |
| | | RemView(frame); |
| | |
| | | }; |
| | | 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; |
| | | } |
| | | } |
| | | } |