From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 11 九月 2020 09:16:59 +0800 Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 115 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs index 889170d..8f12071 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs @@ -9,6 +9,23 @@ /// </summary> public class FrameLayoutBase : FrameLayout { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 璁剧疆鑳藉惁瑙︾偣鍑讳簨浠� + /// </summary> + public bool CanClick = true; + /// <summary> + /// 澹版槑姝ゅ彉閲�,鏃ㄥ湪瀛愮嚎绋嬩篃鑳藉鍘昏幏鍙栦竴涓帶浠剁殑涓婚敭 + /// </summary> + public string MainKey = string.Empty; + /// <summary> + /// 鎺т欢鐨勭偣鍑讳簨浠�(鑷畾涔夊皝瑁呬簨浠�,姝や簨浠惰璁ゅ彲涓烘墽琛屾寜閽寜涓嬩簨浠�,鍙桟anClick灞炴�ф帶鍒�) + /// </summary> + public Action<object, MouseEventArgs> ButtonClickEvent = null; + + #endregion + #region 鈻� 鍒濆鍖朹____________________________ /// <summary> @@ -16,6 +33,45 @@ /// </summary> public FrameLayoutBase() { + //鐐瑰嚮浜嬩欢 + this.MouseUpEventHandler += ButtonBase_MouseUpEventHandler; + } + + #endregion + + #region 鈻� 鐐瑰嚮浜嬩欢___________________________ + + /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ButtonBase_MouseUpEventHandler(object sender, MouseEventArgs e) + { + if (ButtonClickEvent == null) + { + this.MouseUpEventHandler -= ButtonBase_MouseUpEventHandler; + return; + } + //2020.05.14杩藉姞IsFormAdding:鐣岄潰杩樺湪鍔犺浇涓�,涓嶈兘鍐嶇偣鍑� + if (CanClick == true && ControlCommonResourse.IsFormAdding == false) + { + //Log鍑哄姏 + this.WriteLog(); + + try + { + this.ButtonClickEvent(this, e); + } + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒 + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); + alert.Show(); + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(ex); + } + } } #endregion @@ -32,6 +88,65 @@ return HdlControlLogic.Current.GetPictrueRealSize(i_size); } + /// <summary> + /// 鎺т欢鎽ф瘉 + /// </summary> + public override void RemoveFromParent() + { + ButtonClickEvent = null; + + if (this.Parent != null) + { + base.RemoveFromParent(); + } + } + + /// <summary> + /// 鈽嗏槅绉婚櫎鍏ㄩ儴鎺т欢鈽嗏槅 + /// </summary> + public override void RemoveAll() + { + if (this.Parent != null) + { + base.RemoveAll(); + } + } + + #endregion + + #region 鈻� Log鍑哄姏____________________________ + + /// <summary> + /// 璇ユ帶浠舵墍灞炵殑鐣岄潰鍚嶅瓧 + /// </summary> + public string formName = null; + /// <summary> + /// Log鍑哄姏 + /// </summary> + private void WriteLog() + { + if (formName == null) + { + formName = string.Empty; + View myView = this.Parent; + for (; ; ) + { + if (myView == null) + { + break; + } + else if (myView is CommonFormBase) + { + //杩欎釜鎺т欢鎵�灞炵殑鐣岄潰 + formName = ((CommonFormBase)myView).FormID; + break; + } + myView = myView.Parent; + } + } + HdlLogLogic.Current.WriteLog(1, formName + "鐨刐Y" + this.Y + "]琚偣鍑�"); + } + #endregion } -- Gitblit v1.8.0