From a45fe56aeeac8f28a9891b83362954067c8166dc Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 14 八月 2020 09:07:05 +0800
Subject: [PATCH] 请合并新代码,更改多功能面板绑定表重复问题

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
index 3af1925..eba0af0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -11,7 +11,18 @@
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
-        private uint nowProgressBarColor = 0;
+        /// <summary>
+        /// 杩涘害鏉″彲鐢ㄦ椂鐨勮儗鏅壊
+        /// </summary>
+        private uint ProgressBarEnableColor = 0;
+        /// <summary>
+        /// 杩涘害鏉′笉鍙敤鏃剁殑鑳屾櫙鑹�(榛樿鐏拌壊)
+        /// </summary>
+        public uint ProgressBarUnEnableColor = 0xffe8e8e8;
+        /// <summary>
+        /// 褰撳墠鍙敤鐘舵��
+        /// </summary>
+        private bool nowEnable = true;
         /// <summary>
         /// 鎺т欢鑳藉惁浣跨敤
         /// </summary>
@@ -19,16 +30,20 @@
         {
             set
             {
+                //鐘舵�佹病鏈夋敼鍙�
+                if (nowEnable == value) { return; }
+                nowEnable = value;
+
                 this.IsClickable = value;
                 if (value == true)
                 {
                     //鍘熸潵鐨勯鑹�
-                    base.ProgressBarColor = nowProgressBarColor;
+                    base.ProgressBarColor = ProgressBarEnableColor;
                 }
                 else
                 {
                     //鐏拌壊
-                    base.ProgressBarColor = 0xffe8e8e8;
+                    base.ProgressBarColor = ProgressBarUnEnableColor;
                 }
             }
         }
@@ -40,7 +55,7 @@
         {
             set
             {
-                nowProgressBarColor = value;
+                ProgressBarEnableColor = value;
                 base.ProgressBarColor = value;
             }
         }
@@ -49,6 +64,14 @@
         /// 杩涘害鍊兼敼鍙�,濡傛灉瑕佽缃垵濮嬭繘搴﹀��,姝ゅ彉閲忚鍦ㄨ缃垵濮嬭繘搴﹀�间箣鍓嶈繘琛岃缃�(绗竴涓弬鏁�0:婊戝姩鐨勬椂鍊�,1:鎵嬫寚寮硅捣鐨勬椂鍊�)
         /// </summary>
         public Action<int, int> ProgressChangedEvent = null;
+        /// <summary>
+        /// 杩涘害鏉′簨浠剁殑瑙﹀彂鏃堕棿闂撮殧(榛樿娌℃湁闂撮殧,鍗曚綅涓烘绉�)
+        /// </summary>
+        public int EventWaitTime = -1;
+        /// <summary>
+        /// 鍓嶅洖鏃堕棿
+        /// </summary>
+        private DateTime oldTime = DateTime.Now;
 
         #endregion
 
@@ -62,10 +85,14 @@
         {
             this.Width = Application.GetRealWidth(i_width);
             this.Height = Application.GetRealHeight(84);
+            //鍦嗙悆鐨勫搴�
             this.ThumbImageHeight = Application.GetRealHeight(84);
             this.ThumbImagePath = "Item/SeekBarIcon.png";
+            //杩涘害鏉$殑瀹藉害
             this.SeekBarViewHeight = Application.GetRealHeight(10);
+            //杩涘害鏉¤儗鏅壊
             this.SeekBarBackgroundColor = 0xfff5f5f5;
+            //涓婃柟鏄惁鏄剧ず鏂囨湰
             this.IsProgressTextShow = false;
             this.MaxValue = 100;
             this.Gravity = Gravity.CenterHorizontal;
@@ -92,6 +119,13 @@
                 this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
                 return;
             }
+            //鏃堕棿闂撮殧
+            if (EventWaitTime != -1)
+            {
+                if ((DateTime.Now - oldTime).TotalMilliseconds < EventWaitTime) { return; }
+                oldTime = DateTime.Now;
+            }
+
             this.ProgressChangedEvent(0, value);
         }
 
@@ -107,6 +141,7 @@
                 this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
                 return;
             }
+            //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
             this.ProgressChangedEvent(1, value);
         }
 

--
Gitblit v1.8.0