From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs |  387 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 239 insertions(+), 148 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
old mode 100755
new mode 100644
index 1882d5f..7047a9d
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -1,148 +1,239 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter
-{
-    /// <summary>
-    /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
-    /// </summary>
-    public class SeekBarControl : DiyImageSeekBar
-    {
-        #region 鈻� 鍙橀噺澹版槑___________________________
-
-        private uint nowProgressBarColor = 0;
-        /// <summary>
-        /// 鎺т欢鑳藉惁浣跨敤
-        /// </summary>
-        public new bool Enable
-        {
-            set
-            {
-                this.IsClickable = value;
-                if (value == true)
-                {
-                    //鍘熸潵鐨勯鑹�
-                    base.ProgressBarColor = nowProgressBarColor;
-                }
-                else
-                {
-                    //鐏拌壊
-                    base.ProgressBarColor = 0xffe8e8e8;
-                }
-            }
-        }
-
-        /// <summary>
-        /// 杩涘害鏉¢鑹�
-        /// </summary>
-        public new uint ProgressBarColor
-        {
-            set
-            {
-                nowProgressBarColor = value;
-                base.ProgressBarColor = value;
-            }
-        }
-
-        /// <summary>
-        /// 杩涘害鍊兼敼鍙�,濡傛灉瑕佽缃垵濮嬭繘搴﹀��,姝ゅ彉閲忚鍦ㄨ缃垵濮嬭繘搴﹀�间箣鍓嶈繘琛岃缃�(绗竴涓弬鏁�0:婊戝姩鐨勬椂鍊�,1:鎵嬫寚寮硅捣鐨勬椂鍊�)
-        /// </summary>
-        public Action<int, int> ProgressChangedEvent = null;
-        /// <summary>
-        /// 杩涘害鏉′簨浠剁殑瑙﹀彂鏃堕棿闂撮殧(榛樿娌℃湁闂撮殧,鍗曚綅涓烘绉�)
-        /// </summary>
-        public int EventWaitTime = -1;
-        /// <summary>
-        /// 鍓嶅洖鏃堕棿
-        /// </summary>
-        private DateTime oldTime = DateTime.Now;
-
-        #endregion
-
-        #region 鈻� 鍒濆鍖朹____________________________
-
-        /// <summary>
-        /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
-        /// </summary>
-        /// <param name="i_width">瀹藉害,闈炵湡瀹炲��</param>
-        public SeekBarControl(int i_width = 962)
-        {
-            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;
-
-            //杩涘害鏉″�兼敼鍙樹簨浠�
-            this.OnProgressChangedEvent += this.MyProgressChangedEvent;
-            //鎵嬫寚寮硅捣浜嬩欢
-            this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
-        }
-
-        #endregion
-
-        #region 鈻� 浜嬩欢_______________________________
-
-        /// <summary>
-        /// 杩涘害鏉″�兼敼鍙樹簨浠�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="value"></param>
-        private void MyProgressChangedEvent(object sender, int value)
-        {
-            if (this.ProgressChangedEvent == null)
-            {
-                this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
-                return;
-            }
-            //鏃堕棿闂撮殧
-            if (EventWaitTime != -1)
-            {
-                if ((DateTime.Now - oldTime).TotalMilliseconds < EventWaitTime) { return; }
-                oldTime = DateTime.Now;
-            }
-
-            this.ProgressChangedEvent(0, value);
-        }
-
-        /// <summary>
-        /// 鎵嬫寚寮硅捣浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="value"></param>
-        private void MyStopTrackingTouchEvent(object sender, int value)
-        {
-            if (this.ProgressChangedEvent == null)
-            {
-                this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
-                return;
-            }
-            //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
-            this.ProgressChangedEvent(1, value);
-        }
-
-        #endregion
-
-        #region 鈻� 涓�鑸柟娉昣__________________________
-
-        /// <summary>
-        /// 鎺т欢鎽ф瘉
-        /// </summary>
-        public override void RemoveFromParent()
-        {
-            this.ProgressChangedEvent = null;
-            base.RemoveFromParent();
-        }
-
-        #endregion
-    }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+    /// <summary>
+    /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
+    /// </summary>
+    public class SeekBarControl : DiyImageSeekBar
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 杩涘害鍊兼敼鍙�,濡傛灉瑕佽缃垵濮嬭繘搴﹀��,姝ゅ彉閲忚鍦ㄨ缃垵濮嬭繘搴﹀�间箣鍓嶈繘琛岃缃�(绗竴涓弬鏁�0:婊戝姩鐨勬椂鍊�,1:鎵嬫寚寮硅捣鐨勬椂鍊�)
+        /// </summary>
+        public Action<int, int> ProgressChangedEvent = null;
+        /// <summary>
+        /// 杩涘害鏉″彲鐢ㄦ椂鐨勮儗鏅壊
+        /// </summary>
+        private uint ProgressBarEnableColor = 0;
+        /// <summary>
+        /// 杩涘害鏉′笉鍙敤鏃剁殑鑳屾櫙鑹�(榛樿鐏拌壊)
+        /// </summary>
+        public uint ProgressBarUnEnableColor = 0xffe8e8e8;
+        /// <summary>
+        /// 褰撳墠鍙敤鐘舵��
+        /// </summary>
+        private bool nowEnable = true;
+        /// <summary>
+        /// 鎺т欢鑳藉惁浣跨敤
+        /// </summary>
+        public new bool Enable
+        {
+            set
+            {
+                //鐘舵�佹病鏈夋敼鍙�
+                if (nowEnable == value) { return; }
+                nowEnable = value;
+
+                this.IsClickable = value;
+                if (value == true)
+                {
+                    //鍘熸潵鐨勯鑹�
+                    base.ProgressBarColor = ProgressBarEnableColor;
+                }
+                else
+                {
+                    //鐏拌壊
+                    base.ProgressBarColor = ProgressBarUnEnableColor;
+                }
+            }
+        }
+
+        /// <summary>
+        /// 杩涘害鏉¢鑹�
+        /// </summary>
+        public new uint ProgressBarColor
+        {
+            set
+            {
+                ProgressBarEnableColor = value;
+                base.ProgressBarColor = value;
+            }
+        }
+
+        private int m_SeekBarPadding = Application.GetRealWidth(20);
+        /// <summary>
+        /// 杩涘害鏉′笌宸﹀彸涓よ竟鐨勮竟妗嗙殑杈硅窛(閲嶅啓搴曞眰灞炴��)
+        /// </summary>
+        public new int SeekBarPadding
+        {
+            set
+            {
+                m_SeekBarPadding = value;
+                base.SeekBarPadding = value;
+            }
+        }
+
+        private int m_MaxValue = 0;
+        /// <summary>
+        /// 杩涘害鏉℃渶澶у��(閲嶅啓搴曞眰灞炴��)
+        /// </summary>
+        public new int MaxValue
+        {
+            set
+            {
+                m_MaxValue = value;
+                base.MaxValue = value;
+            }
+        }
+
+        private int m_MinValue = 0;
+        /// <summary>
+        /// 杩涘害鏉℃渶灏忓��(閲嶅啓搴曞眰灞炴��)
+        /// </summary>
+        public new int MinValue
+        {
+            set
+            {
+                m_MinValue = value;
+                base.MinValue = value;
+            }
+        }
+        /// <summary>
+        /// 涓婃柟鏄剧ず鐨勬枃鏈�
+        /// </summary>
+        private NormalViewControl btnTopView = null;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
+        /// </summary>
+        /// <param name="i_width">瀹藉害,闈炵湡瀹炲��</param>
+        public SeekBarControl(int i_width = 962)
+        {
+            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;
+
+            //杩涘害鏉″�兼敼鍙樹簨浠�
+            this.OnProgressChangedEvent += this.MyProgressChangedEvent;
+            //鎵嬫寚寮硅捣浜嬩欢
+            this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
+        }
+
+        #endregion
+
+        #region 鈻� 浜嬩欢_______________________________
+
+        /// <summary>
+        /// 杩涘害鏉″�兼敼鍙樹簨浠�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="value"></param>
+        private void MyProgressChangedEvent(object sender, int value)
+        {
+            if (this.ProgressChangedEvent == null)
+            {
+                this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
+                return;
+            }
+
+            this.ProgressChangedEvent(0, value);
+        }
+
+        /// <summary>
+        /// 鎵嬫寚寮硅捣浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="value"></param>
+        private void MyStopTrackingTouchEvent(object sender, int value)
+        {
+            if (this.ProgressChangedEvent == null)
+            {
+                this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
+                return;
+            }
+            //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
+            this.ProgressChangedEvent(1, value);
+        }
+
+        #endregion
+
+        #region 鈻� 鑷畾涔変笂鏂规樉绀烘枃鏈琠________________
+
+        /// <summary>
+        /// 鍦ㄤ笂鏂规樉绀鸿嚜瀹氫箟鏂囨湰
+        /// </summary>
+        /// <param name="i_width">瀹藉害(鐪熷疄鍊�)</param>
+        /// <param name="textSize">鏂囧瓧澶у皬</param>
+        /// <param name="textColor">鏂囧瓧棰滆壊</param>
+        public void ShowCustomTextView(int i_width, int textSize, uint textColor)
+        {
+            if (this.btnTopView != null) { return; }
+
+            int contrHeight = Application.GetRealHeight(60);
+            this.btnTopView = new NormalViewControl(i_width, contrHeight, false);
+            btnTopView.TextColor = textColor;
+            btnTopView.TextSize = textSize;
+            btnTopView.TextAlignment = TextAlignment.Center;
+            btnTopView.Y = this.Y - contrHeight + Application.GetRealHeight(20);
+            //鍒濆鍖栨椂,X杞村彲浠ヤ笉鐢ㄧ悊浼�
+
+            this.Parent.AddChidren(btnTopView);
+        }
+
+        /// <summary>
+        /// 璁剧疆鑷畾涔夋枃鏈俊鎭�
+        /// </summary>
+        /// <param name="i_text"></param>
+        public void SetCustomText(string i_text)
+        {
+            if (this.btnTopView == null) { return; }
+
+            this.btnTopView.Text = i_text;
+            //婊戞潯鏈�宸﹁竟鐨勮窛绂�
+            int XX = this.X + this.m_SeekBarPadding;
+            //褰撳墠婊戞潯鎵�鍦ㄧ殑澶ц嚧鐧惧垎姣�
+            int tempValue = this.Progress - this.m_MinValue;
+            if (tempValue < 0) { tempValue = 0; }
+            decimal persent = (decimal)tempValue / (this.m_MaxValue - this.m_MinValue);
+            //褰撳墠婊戞潯鎵�鍦ㄧ殑澶ц嚧浣嶇疆
+            XX += (int)((this.Width - this.m_SeekBarPadding * 2) * persent);
+            //鍥犱负瑕佸眳涓�,鎵�浠ュ噺鎺夎嚜瀹氫箟鎺т欢鐨勫搴︾殑涓�鑸�
+            XX = XX - this.btnTopView.Width / 2;
+
+            this.btnTopView.X = XX;
+        }
+
+        #endregion
+
+        #region 鈻� 涓�鑸柟娉昣__________________________
+
+        /// <summary>
+        /// 鎺т欢鎽ф瘉
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            this.ProgressChangedEvent = null;
+            base.RemoveFromParent();
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0