From 2ed75b8b337048e5d75e6d9ec8307633134f02fd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 10 十月 2019 11:33:04 +0800
Subject: [PATCH] 个人中心添加楼层和创建房间,实装二级验证

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs |   73 ++++++++++++++++++++++++++++--------
 1 files changed, 56 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs
index 1041b41..8dba4e5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs
@@ -63,11 +63,11 @@
         /// <param name="chidrenBindMode">鍙樻洿鐨勭粦瀹氭ā寮�</param>
         public void ChangedChidrenBindMode(View view, ChidrenBindMode chidrenBindMode)
         {
-            if (view is Button)
+            if (view is ButtonBase)
             {
                 //瀛愭帶浠剁Щ闄や簨浠�
-                Button button = (Button)view;
-                button.MouseUpEventHandler -= ChildrenUpEvent;
+                ButtonBase button = (ButtonBase)view;
+                button.ButtonClickEvent -= ChildrenUpEvent;
                 button.MouseDownEventHandler -= ChildrenDownEvent;
 
                 this.BindChidrenEvent(view, chidrenBindMode);
@@ -82,11 +82,11 @@
                     {
                         break;
                     }
-                    if (myView is Button)
+                    if (myView is ButtonBase)
                     {
                         //瀛愭帶浠剁Щ闄や簨浠�
-                        Button button = (Button)myView;
-                        button.MouseUpEventHandler -= ChildrenUpEvent;
+                        ButtonBase button = (ButtonBase)myView;
+                        button.ButtonClickEvent -= ChildrenUpEvent;
                         button.MouseDownEventHandler -= ChildrenDownEvent;
                     }
                 }
@@ -105,14 +105,14 @@
         /// <param name="chidrenBindMode"></param>
         private void BindChidrenEvent(View view, ChidrenBindMode chidrenBindMode)
         {
-            if (view is Button && chidrenBindMode != ChidrenBindMode.NotBind)
+            if (view is ButtonBase && chidrenBindMode != ChidrenBindMode.NotBind)
             {
                 //涓哄瓙鎺т欢娣诲姞浜嬩欢
-                Button button = (Button)view;
-                button.MouseUpEventHandler -= ChildrenUpEvent;
+                ButtonBase button = (ButtonBase)view;
+                button.ButtonClickEvent -= ChildrenUpEvent;
                 button.MouseDownEventHandler -= ChildrenDownEvent;
 
-                button.MouseUpEventHandler += ChildrenUpEvent;
+                button.ButtonClickEvent += ChildrenUpEvent;
                 button.MouseDownEventHandler += ChildrenDownEvent;
             }
             else if (view is ViewGroup && chidrenBindMode != ChidrenBindMode.NotBind)
@@ -126,14 +126,14 @@
                     {
                         break;
                     }
-                    if (myView is Button)
+                    if (myView is ButtonBase)
                     {
                         //涓哄瓙鎺т欢娣诲姞浜嬩欢
-                        Button button = (Button)myView;
-                        button.MouseUpEventHandler -= ChildrenUpEvent;
+                        ButtonBase button = (ButtonBase)myView;
+                        button.ButtonClickEvent -= ChildrenUpEvent;
                         button.MouseDownEventHandler -= ChildrenDownEvent;
 
-                        button.MouseUpEventHandler += ChildrenUpEvent;
+                        button.ButtonClickEvent += ChildrenUpEvent;
                         button.MouseDownEventHandler += ChildrenDownEvent;
                     }
                 }
@@ -191,6 +191,11 @@
         /// <param name="e">E.</param>
         private void ChildrenUpEvent(object sender, MouseEventArgs e)
         {
+            if (sender is FrameLayoutControl)
+            {
+                //LOG鍑哄姏
+                this.WriteLog();
+            }
             //璋冪敤濮旀墭
             ButtonClickEvent?.Invoke(sender, e);
         }
@@ -247,7 +252,7 @@
 
             //璁剧疆閫夋嫨鐘舵��
             this.SetClickSelectStatu();
-            new System.Threading.Thread(() =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 System.Threading.Thread.Sleep(waiTime);
                 Application.RunOnMainThread(() =>
@@ -255,8 +260,7 @@
                     //璁剧疆涓嶉�夋嫨鐘舵��
                     this.SetClickNotSelectStatu();
                 });
-            })
-            { IsBackground = true }.Start();
+            });
         }
 
         /// <summary>
@@ -280,5 +284,40 @@
         }
 
         #endregion
+
+        #region 鈻� Log鍑哄姏____________________________
+
+        /// <summary>
+        /// 璇ユ帶浠舵墍灞炵殑鐣岄潰鍚嶅瓧
+        /// </summary>
+        private 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 + ".FrameLayoutControl 琚偣鍑�");
+        }
+
+        #endregion
     }
 }

--
Gitblit v1.8.0