From e90209beae6a4e822cecb18e6889f8bda23f630e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 14 十二月 2020 11:16:06 +0800
Subject: [PATCH] 合并了晾衣架(非新云端)

---
 ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs |   41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Common/Base/CommonFormBase.cs b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
similarity index 90%
rename from ZigbeeApp/Shared/Phone/Common/Base/CommonFormBase.cs
rename to ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
index d51bec8..2663989 100644
--- a/ZigbeeApp/Shared/Phone/Common/Base/CommonFormBase.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
@@ -28,7 +28,7 @@
         public virtual void InitForm()
         {
             //灏嗗綋鍓嶇殑鐢婚潰淇濆瓨鍒板唴瀛樺綋涓�
-            HdlFormLogic.Current.AddActionForm(this);
+            UserCenterLogic.AddActionForm(this);
             //Log鍑哄姏
             HdlLogLogic.Current.WriteLog(1, this.FormID + " 鐣岄潰鎵撳紑");
         }
@@ -63,7 +63,7 @@
         /// </summary>
         /// <param name="form">鐩爣鐣岄潰</param>
         /// <param name="parameter">鍚姩鍙傛暟锛氬弬鏁扮敱鎸囧畾鐢婚潰鐨凷howForm鍑芥暟鎵�鎸囧畾</param>
-        public void AddFormAndCloseNowForm(CommonFormBase form, params object[] parameter)
+        public void AddFromAndRemoveNowForm(CommonFormBase form, params object[] parameter)
         {
             //绉婚櫎褰撳墠鐢婚潰
             this.CloseForm();
@@ -111,7 +111,7 @@
                 base.RemoveFromParent();
 
                 //浠庡垪琛ㄤ腑绉婚櫎(闃叉鐢婚潰浜岄噸娣诲姞)
-                HdlFormLogic.Current.RemoveActionForm(this);
+                UserCenterLogic.RemoveActionForm(this);
 
                 //鐢婚潰鍏抽棴涔嬪悗
                 this.CloseFormAfter();
@@ -158,7 +158,7 @@
         /// <param name="text">鍒濆鏂囨湰</param>
         public void ShowProgressBar(string text = "")
         {
-            if (this.FormID != HdlFormLogic.Current.NowActionFormID)
+            if (this.FormID != UserCenterResourse.NowActionFormID)
             {
                 return;
             }
@@ -240,7 +240,7 @@
         /// <returns></returns>
         public bool NowFormIsAction()
         {
-            return HdlFormLogic.Current.NowActionFormID == this.FormID;
+            return UserCenterResourse.NowActionFormID == this.FormID;
         }
 
         /// <summary>
@@ -288,6 +288,16 @@
         public int GetRealSizeEx(int i_size)
         {
             return HdlControlLogic.Current.GetRealSizeEx(i_size);
+        }
+
+        /// <summary>
+        /// 鍒ゆ柇鎸囧畾鐨勭晫闈㈡槸鍚︽墦寮�
+        /// </summary>
+        /// <param name="formId"></param>
+        /// <returns></returns>
+        public bool IsFormOpen(string formId)
+        {
+            return UserCenterResourse.DicActionForm.ContainsKey(formId);
         }
 
         #endregion
@@ -349,6 +359,19 @@
 
         #region 鈻� 鍙嶅皠鏂规硶___________________________
 
+        /// <summary>
+        /// 鍏抽棴鎸囧畾鐨勭敾闈�
+        /// </summary>
+        /// <param name="formName">鎸囧畾瑕佸叧闂殑鐢婚潰鑻辨枃鍚嶅瓧</param>
+        public void CloseFormByFormName(string formName)
+        {
+            if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false)
+            {
+                return;
+            }
+            //鍏抽棴鎸囧畾鐢婚潰
+            UserCenterResourse.DicActionForm[formName]?.CloseForm();
+        }
 
         /// <summary>
         /// 鎵ц鎸囧畾鐢婚潰鐨勬柟娉�
@@ -358,11 +381,11 @@
         /// <param name="parameter">鍚姩鍙傛暟</param>
         public object LoadFormMethodByName(string formName, string method, params object[] parameter)
         {
-            var form = HdlFormLogic.Current.GetFormByName(formName);
-            if (form == null)
+            if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false)
             {
                 return null;
             }
+            var form = UserCenterResourse.DicActionForm[formName];
             return this.LoadFormMethodByName(form, method, parameter);
         }
 
@@ -374,11 +397,11 @@
         /// <param name="parameter">鍚姩鍙傛暟</param>
         public async Task<object> LoadFormMethodByNameAsync(string formName, string method, params object[] parameter)
         {
-            var form = HdlFormLogic.Current.GetFormByName(formName);
-            if (form == null)
+            if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false)
             {
                 return null;
             }
+            var form = UserCenterResourse.DicActionForm[formName];
             var task = this.LoadFormMethodByName(form, method, parameter) as Task;
             await task;
 

--
Gitblit v1.8.0