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/ProgressBar.cs |  174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 174 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs
new file mode 100644
index 0000000..716b366
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressBar.cs
@@ -0,0 +1,174 @@
+锘縰sing System;
+namespace Shared.Phone.UserCenter
+{
+    /// <summary>
+    /// 杩涘害鏉�(鍦嗗舰),鍙兘鐢ㄤ簬UserCenterCommonForm
+    /// </summary>
+    public class ProgressBar
+    {
+        /// <summary>
+        /// 鏈�澶у��
+        /// </summary>
+        private static decimal Max = 100;
+        /// <summary>
+        /// 褰撳墠鍊�
+        /// </summary>
+        private static decimal m_value = 0;
+        /// <summary>
+        /// 寮哄埗涓嶆樉绀鸿繘搴︽潯
+        /// </summary>
+        private static bool notShow = false;
+        /// <summary>
+        /// 寮哄埗涓嶅叧闂繘搴︽潯
+        /// </summary>
+        private static bool notClose = false;
+        /// <summary>
+        /// 鐗规畩闇�姹傦細寮哄埗涓嶅彉鏇磋繘搴︽潯鐨勫��
+        /// </summary>
+        private static bool notSetValue = false;
+        /// <summary>
+        /// 闄勫姞鏂囨湰
+        /// </summary>
+        private static string appendText = string.Empty;
+
+        /// <summary>
+        /// 鏄剧ず杩涘害鏉�
+        /// </summary>
+        /// <param name="text">鍒濆鏂囨湰</param>
+        public static void Show(string text = "")
+        {
+            m_value = 0;
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                if (Common.CommonPage.Loading.Visible == false && notShow == false)
+                {
+                    Common.CommonPage.Loading.Start(text);
+                }
+            }, ShowErrorMode.NO);
+        }
+
+        /// <summary>
+        /// 闅愯棌杩涘害鏉�
+        /// </summary>
+        /// <param name="coerce">寮哄埗鍏抽棴</param>
+        public static void Close(bool coerce = false)
+        {
+            m_value = 0;
+            Max = 0;
+            if (coerce == true)
+            {
+                notClose = false;
+            }
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                if (Common.CommonPage.Loading.Visible == true && notClose == false)
+                {
+                    Common.CommonPage.Loading.Hide();
+                    notShow = false;
+                    notClose = false;
+                    notSetValue = false;
+                }
+            }, ShowErrorMode.NO);
+        }
+
+        /// <summary>
+        /// 杩涘害鍊艰瀹�(鏁板瓧)
+        /// </summary>
+        /// <param name="value">Value.</param>
+        public static void SetValue(decimal value)
+        {
+            m_value += value;
+            int value2 = (int)((m_value / Max) * 100);
+            if (value2 > 100)
+            {
+                value2 = 100;
+            }
+
+            SetValue(value2.ToString() + "%");
+        }
+
+        /// <summary>
+        /// 杩涘害鍊艰瀹�
+        /// </summary>
+        /// <param name="value">Value.</param>
+        /// <param name="text">闄勫姞鍊�</param>
+        public static void SetValue(decimal value, string text)
+        {
+            m_value += value;
+            int value2 = (int)((m_value / Max) * 100);
+            if (value2 > 100)
+            {
+                value2 = 100;
+            }
+
+            SetValue(value2.ToString() + "% " + text);
+        }
+
+        /// <summary>
+        /// 杩涘害鍊艰瀹�(鏂囨湰)
+        /// </summary>
+        /// <param name="text">Text.</param>
+        public static void SetValue(string text)
+        {
+            if (notSetValue == true)
+            {
+                return;
+            }
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                //loading.Text = text;
+                Common.CommonPage.Loading.Text = text + appendText;
+            }, ShowErrorMode.NO);
+        }
+
+        /// <summary>
+        /// 璁惧畾杩涘害鍊兼渶澶х殑鍊硷紙鍒嗘瘝锛�
+        /// </summary>
+        /// <param name="maxValue">璁惧畾杩涘害鍊兼渶澶х殑鍊硷紙鍒嗘瘝锛�</param>
+        public static void SetMaxValue(decimal maxValue)
+        {
+            Max = maxValue;
+        }
+
+        /// <summary>
+        /// 寮哄埗璁剧疆涓嶅啀鏄剧ず杩涘害鏉★紝鐩村埌杩涘害鏉″彲浠ュ叧闂垨鑰呭啀娆¤缃�
+        /// </summary>
+        /// <param name="i_notShow">鏄惁寮哄埗涓嶆樉绀�</param>
+        public static void SetShowBarFlag(bool i_notShow)
+        {
+            notShow = i_notShow;
+        }
+
+        /// <summary>
+        /// 寮哄埗璁剧疆涓嶅啀鍏抽棴杩涘害鏉★紝鐩村埌杩涘害鏉″彲浠ュ叧闂垨鑰呭啀娆¤缃�
+        /// </summary>
+        /// <param name="i_notClose">鏄惁寮哄埗涓嶅叧闂�</param>
+        public static void SetCloseBarFlag(bool i_notClose)
+        {
+            notClose = i_notClose;
+        }
+
+        /// <summary>
+        /// 寮哄埗璁剧疆涓嶅彉鏇磋繘搴︽潯鐨勫�硷紝鐩村埌杩涘害鏉″彲浠ュ叧闂垨鑰呭啀娆¤缃�
+        /// </summary>
+        /// <param name="i_notSetvalue">鏄惁寮哄埗涓嶅彉鏇磋繘搴︽潯鐨勫��</param>
+        public static void SetSetValueFlag(bool i_notSetvalue)
+        {
+            notSetValue = i_notSetvalue;
+        }
+
+        /// <summary>
+        /// 鍦ㄨ繘搴︽潯閲岄潰闄勫姞鑷畾涔夋枃鏈�
+        /// </summary>
+        /// <param name="i_text"></param>
+        public static void SetAppendText(string i_text)
+        {
+            appendText = i_text;
+            if (appendText != string.Empty)
+            {
+                //澶氬姞涓�涓┖鏍�
+                appendText = " " + appendText;
+            }
+        }
+    }
+}

--
Gitblit v1.8.0