From f25c6122eb7e26be5e7f036cf29b9019c4953be2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 21 十二月 2020 19:44:02 +0800 Subject: [PATCH] Merge branch 'WJC' into NewFilePath --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs | 74 ++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 1 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs index df964b6..078ef48 100755 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs @@ -91,13 +91,17 @@ Width = Application.GetRealWidth(343), }; + + /// <summary> /// View鐨勬柟娉� /// </summary> /// <param name="frame">鐖舵帶浠�</param> /// <param name="i">鏄剧ず閫夋嫨View鏁伴噺</param> + ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param> + /// <param name="action">杩斿洖鍥炶皟</param> /// <returns></returns> - public void FLayoutView(FrameLayout frame, int i) + public void FLayoutView(FrameLayout frame, int i,string stateVuale,Action<string>action) { frameLayout.Y = Application.GetRealHeight(603 - (44 * i)); frameLayout.Height = Application.GetRealHeight(44 * i); @@ -112,11 +116,79 @@ frameLayout.AddChidren(btnLine1); frameLayout.AddChidren(btnStop); } + //鍙栨秷鐐瑰嚮浜嬩欢 btnCancel.MouseUpEventHandler += (sender1, e1) => { frame.RemoveFromParent(); }; + + ///鏄剧ず涔嬪墠鐘舵�� + if (stateVuale != "") + { + if (stateVuale ==btnOn.Text) + { + btnOn.TextColor = CSS.CSS_Color.textConfirmColor; + } + else if (stateVuale == btnOff.Text) + { + btnOff.TextColor = CSS.CSS_Color.textConfirmColor; + } + else if (stateVuale == btnStop.Text) + { + btnStop.TextColor = CSS.CSS_Color.textConfirmColor; + } + } + + //寮�-鐐瑰嚮浜嬩欢 + btnOn.MouseUpEventHandler += (sender2, e2) => + { + action("on"); + frame.RemoveFromParent(); + }; + //鍏�-鐐瑰嚮浜嬩欢 + btnOff.MouseUpEventHandler += (sender3, e3) => + { + action("off"); + frame.RemoveFromParent(); + }; + //鏆傚仠-鐐瑰嚮浜嬩欢 + btnStop.MouseUpEventHandler += (sender3, e3) => + { + action("stop"); + frame.RemoveFromParent(); + }; + } + + + + + ///// <summary> + ///// View鐨勬柟娉� + ///// </summary> + ///// <param name="frame">鐖舵帶浠�</param> + ///// <param name="i">鏄剧ず閫夋嫨View鏁伴噺</param> + ///// <returns></returns> + //public void FLayoutView(FrameLayout frame, int i) + //{ + // frameLayout.Y = Application.GetRealHeight(603 - (44 * i)); + // frameLayout.Height = Application.GetRealHeight(44 * i); + // frame.AddChidren(frameLayout); + // frame.AddChidren(btnCancel); + // frameLayout.AddChidren(btnOn); + // frameLayout.AddChidren(btnLine); + // frameLayout.AddChidren(btnOff); + // if (i > 2) + // { + // /// 鍒ゆ柇鏄惁瑕佹槸鏄剧ず"鏆傚仠"鎸夐挳 + // frameLayout.AddChidren(btnLine1); + // frameLayout.AddChidren(btnStop); + // } + // btnCancel.MouseUpEventHandler += (sender1, e1) => + // { + // frame.RemoveFromParent(); + // }; + //} } } -- Gitblit v1.8.0