File was renamed from ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs |
| | |
| | | public virtual void InitForm() |
| | | { |
| | | //将当前的画面保存到内存当中 |
| | | UserCenterLogic.AddActionForm(this); |
| | | HdlFormLogic.Current.AddActionForm(this); |
| | | //Log出力 |
| | | HdlLogLogic.Current.WriteLog(1, this.FormID + " 界面打开"); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="form">目标界面</param> |
| | | /// <param name="parameter">启动参数:参数由指定画面的ShowForm函数所指定</param> |
| | | public void AddFromAndRemoveNowForm(CommonFormBase form, params object[] parameter) |
| | | public void AddFormAndCloseNowForm(CommonFormBase form, params object[] parameter) |
| | | { |
| | | //移除当前画面 |
| | | this.CloseForm(); |
| | |
| | | base.RemoveFromParent(); |
| | | |
| | | //从列表中移除(防止画面二重添加) |
| | | UserCenterLogic.RemoveActionForm(this); |
| | | HdlFormLogic.Current.RemoveActionForm(this); |
| | | |
| | | //画面关闭之后 |
| | | this.CloseFormAfter(); |
| | |
| | | /// <param name="text">初始文本</param> |
| | | public void ShowProgressBar(string text = "") |
| | | { |
| | | if (this.FormID != UserCenterResourse.NowActionFormID) |
| | | if (this.FormID != HdlFormLogic.Current.NowActionFormID) |
| | | { |
| | | return; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public bool NowFormIsAction() |
| | | { |
| | | return UserCenterResourse.NowActionFormID == this.FormID; |
| | | return HdlFormLogic.Current.NowActionFormID == this.FormID; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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 |
| | |
| | | |
| | | #region ■ 反射方法___________________________ |
| | | |
| | | /// <summary> |
| | | /// 关闭指定的画面 |
| | | /// </summary> |
| | | /// <param name="formName">指定要关闭的画面英文名字</param> |
| | | public void CloseFormByFormName(string formName) |
| | | { |
| | | if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false) |
| | | { |
| | | return; |
| | | } |
| | | //关闭指定画面 |
| | | UserCenterResourse.DicActionForm[formName]?.CloseForm(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 执行指定画面的方法 |
| | |
| | | /// <param name="parameter">启动参数</param> |
| | | public object LoadFormMethodByName(string formName, string method, params object[] parameter) |
| | | { |
| | | if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false) |
| | | var form = HdlFormLogic.Current.GetFormByName(formName); |
| | | if (form == null) |
| | | { |
| | | return null; |
| | | } |
| | | var form = UserCenterResourse.DicActionForm[formName]; |
| | | return this.LoadFormMethodByName(form, method, parameter); |
| | | } |
| | | |
| | |
| | | /// <param name="parameter">启动参数</param> |
| | | public async Task<object> LoadFormMethodByNameAsync(string formName, string method, params object[] parameter) |
| | | { |
| | | if (UserCenterResourse.DicActionForm.ContainsKey(formName) == false) |
| | | var form = HdlFormLogic.Current.GetFormByName(formName); |
| | | if (form == null) |
| | | { |
| | | return null; |
| | | } |
| | | var form = UserCenterResourse.DicActionForm[formName]; |
| | | var task = this.LoadFormMethodByName(form, method, parameter) as Task; |
| | | await task; |
| | | |