HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-14 e90209beae6a4e822cecb18e6889f8bda23f630e
ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
File was renamed from ZigbeeApp/Shared/Phone/Common/Base/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">启动参数:参数由指定画面的ShowForm函数所指定</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;