From 163777d8a2cb7cfa469f54a7042528870ebc10a3 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 09 十二月 2019 17:46:20 +0800
Subject: [PATCH] 一个新版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs |   69 +++-------------------------------
 1 files changed, 6 insertions(+), 63 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
index 42798c2..7c86b24 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
@@ -30,20 +30,18 @@
                 else { this.SetClickStatu(); }
             }
         }
-
         /// <summary>
-        /// 鏄惁鏄暱鎸夌姸鎬�
+        /// 鍦嗚搴�
         /// </summary>
-        private bool isLongClick = false;
+        public int RadiusEx
+        {
+            set { this.Radius = (uint)Application.GetRealHeight(value); }
+        }
 
         /// <summary>
         /// 鎺т欢鐨勭偣鍑讳簨浠�(鑷畾涔夊皝瑁呬簨浠�,姝や簨浠惰璁ゅ彲涓烘墽琛屾寜閽寜涓嬩簨浠�,鍙桟anClick灞炴�ф帶鍒�)
         /// </summary>
         public Action<Button, MouseEventArgs> ButtonClickEvent = null;
-        /// <summary>
-        /// (鈽呭綋鍓嶄笉瑕佷娇鐢ㄢ槄)鎺т欢鐨勯暱鎸変簨浠�,褰撲簨浠朵负null鏃�,浠h〃闀挎寜缁撴潫(鑷畾涔夊皝瑁呬簨浠�,姝や簨浠惰璁ゅ彲涓烘墽琛屾寜閽暱鎸変簨浠�,鍙桟anClick灞炴�ф帶鍒�)
-        /// </summary>
-        public Action<Button, MouseEventArgs> ButtonLongClickEvent = null;
         /// <summary>
         /// 鎺т欢鐨勬寜涓嬩簨浠�(鑷畾涔夊皝瑁呬簨浠�,姝や簨浠惰璁ゅ彲涓烘墽琛屾寜閽寜涓嬩簨浠�,鍙桟anClick灞炴�ф帶鍒�)
         /// </summary>
@@ -68,8 +66,6 @@
             this.MouseUpEventHandler += ButtonBase_MouseUpEventHandler;
             //鎸変笅浜嬩欢
             this.MouseDownEventHandler += ButtonBase_MouseDownEventHandler;
-            //闀挎寜浜嬩欢
-            this.MouseLongEventHandler += ButtonBase_MouseLongEventHandler;
         }
 
         /// <summary>
@@ -146,15 +142,7 @@
 
                 try
                 {
-                    if (this.isLongClick == false)
-                    {
-                        this.ButtonClickEvent(this, e);
-                    }
-                    else if (ButtonLongClickEvent != null)
-                    {
-                        //闀挎寜缁撴潫
-                        this.ButtonLongClickEvent(this, null);
-                    }
+                    this.ButtonClickEvent(this, e);
                 }
                 catch (Exception ex)
                 {
@@ -165,8 +153,6 @@
                     HdlLogLogic.Current.WriteLog(ex);
                 }
             }
-            //鐘舵�佽繕鍘�
-            this.isLongClick = false;
         }
 
         #endregion
@@ -180,9 +166,6 @@
         /// <param name="e"></param>
         private void ButtonBase_MouseDownEventHandler(object sender, MouseEventArgs e)
         {
-            //杩樺師鐘舵��
-            this.isLongClick = false;
-
             if (CanClick == false || this.ButtonDownClickEvent == null)
             {
                 //涓嶈兘鐐瑰嚮
@@ -200,45 +183,6 @@
                 alert.Show();
                 //Log鍑哄姏
                 HdlLogLogic.Current.WriteLog(ex);
-            }
-        }
-
-        #endregion
-
-        #region 鈻� 闀挎寜浜嬩欢___________________________
-
-        /// <summary>
-        /// 闀挎寜浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ButtonBase_MouseLongEventHandler(object sender, MouseEventArgs e)
-        {
-            //闀挎寜鐘舵��
-            this.isLongClick = true;
-
-            if (ButtonLongClickEvent == null)
-            {
-                this.MouseLongEventHandler -= ButtonBase_MouseLongEventHandler;
-                return;
-            }
-            if (CanClick == true)
-            {
-                //Log鍑哄姏
-                this.WriteLog(1);
-
-                try
-                {
-                    this.ButtonLongClickEvent(this, e);
-                }
-                catch (Exception ex)
-                {
-                    //鍑虹幇鏈煡閿欒
-                    var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
-                    alert.Show();
-                    //Log鍑哄姏
-                    HdlLogLogic.Current.WriteLog(ex);
-                }
             }
         }
 
@@ -271,7 +215,6 @@
         {
             ButtonClickEvent = null;
             ButtonDownClickEvent = null;
-            ButtonLongClickEvent = null;
 
             base.RemoveFromParent();
         }

--
Gitblit v1.8.0