From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 六月 2020 14:59:39 +0800
Subject: [PATCH] 上传一个合并的版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/FrameLayoutBase.cs |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 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..24b5d62 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,54 @@
             return HdlControlLogic.Current.GetPictrueRealSize(i_size);
         }
 
+        /// <summary>
+        /// 鎺т欢鎽ф瘉
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            ButtonClickEvent = null;
+
+            if (this.Parent != null)
+            {
+                base.RemoveFromParent();
+            }
+        }
+
+        #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