| | |
| | | X = Application.GetRealWidth(40), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Text =Logic.currlogic.name, |
| | | Text = Logic.currlogic.name, |
| | | }; |
| | | nameView.frameLayout.AddChidren(btnAutomationName); |
| | | |
| | |
| | | EventHandler<MouseEventArgs> editClick = (sender, e) => |
| | | { |
| | | List<string> list = new List<string>(); |
| | | foreach (var logic in Logic.LogicList) { |
| | | foreach (var logic in Logic.LogicList) |
| | | { |
| | | list.Add(logic.name); |
| | | } |
| | | |
| | | new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName,view |
| | | new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName, view |
| | | ) => |
| | | { |
| | | btnAutomationName.Text = logicName; |
| | | Logic.currlogic.name = logicName; |
| | | |
| | | },()=> { }); |
| | | }, () => { }); |
| | | }; |
| | | nameView.btnClick.MouseUpEventHandler += editClick; |
| | | btnAutomationName.MouseUpEventHandler += editClick; |
| | |
| | | BackgroundColor = CSS.CSS_Color.view, |
| | | Gravity = Gravity.BottomCenter,//置底的属性 |
| | | }; |
| | | this.AddChidren(frameLayout); |
| | | ///可以显示删除控件 |
| | | if (Logic.currlogic.tag == false) |
| | | { |
| | | this.AddChidren(frameLayout); |
| | | } |
| | | Button btnDel = new Button |
| | | { |
| | | TextSize = LogicView.TextSize.text16, |
| | |
| | | TextID = StringId.Del, |
| | | }; |
| | | frameLayout.AddChidren(btnDel); |
| | | |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> delClick = (sender, e) => |
| | |
| | | try |
| | | { |
| | | //发送删除逻辑命令; |
| | | responsePackNew = Send.DelLogic(Logic.currlogic); |
| | | |
| | | responsePackNew = Send.Current.DelLogic(Logic.currlogic, true); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if (responsePackNew != null && responsePackNew.Code == "0") |
| | | if (responsePackNew != null) |
| | | { |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | LogicMethod.Current.RemoveAllView(); |
| | | Logic.LogicList.Remove(Logic.currlogic); |
| | | MainView.MainShow(); |
| | | //发送删除逻辑命令; |
| | | } |
| | | else if (responsePackNew != null && responsePackNew.Code == "14005") |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.gatewayNotOnline)); |
| | | } |
| | | else |
| | | { |
| | | new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | }); |
| | | |
| | | }; |