wjc
2023-03-28 a9d1161b1df96e7ddad566335989a1444e433ef5
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -49,7 +49,7 @@
                X = Application.GetRealWidth(40),
                Gravity = Gravity.CenterVertical,
                TextAlignment = TextAlignment.CenterRight,
                Text =Logic.currlogic.name,
                Text = Logic.currlogic.name,
            };
            nameView.frameLayout.AddChidren(btnAutomationName);
@@ -57,17 +57,18 @@
            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;
@@ -81,7 +82,11 @@
                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,
@@ -92,6 +97,7 @@
                TextID = StringId.Del,
            };
            frameLayout.AddChidren(btnDel);
            EventHandler<MouseEventArgs> delClick = (sender, e) =>
@@ -107,8 +113,7 @@
                        try
                        {
                            //发送删除逻辑命令;
                            responsePackNew = Send.DelLogic(Logic.currlogic);
                            responsePackNew = Send.Current.DelLogic(Logic.currlogic, true);
                        }
                        catch { }
                        finally
@@ -116,27 +121,19 @@
                            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();
                });
            };