| | |
| | | /// <param name="msg">信息</param>
|
| | | /// <param name="action">单击确认后执行的回调函数</param>
|
| | | /// <param name="buttonText">按钮的文本</param> |
| | | public void ShowMassage(ShowMsgType msgType, string msg, Action action = null, string buttonText = null)
|
| | | /// <param name="i_waitTime">等待时间,单位为秒,设置确认按钮在多长时间后才能够点击</param>
|
| | | public void ShowMassage(ShowMsgType msgType, string msg, Action action = null, string buttonText = null, int i_waitTime = -1)
|
| | | {
|
| | | //空对象时,不显示
|
| | | if (string.IsNullOrEmpty(msg)) |
| | | { |
| | | return; |
| | | }
|
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | var alert = new ShowMsgControl(msgType, msg, buttonText); |
| | | if (action != null)
|
| | | {
|
| | | alert.ConfirmClickEvent += () =>
|
| | | {
|
| | | try
|
| | | {
|
| | | //回调函数
|
| | | action?.Invoke();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | //出现未知错误,数据丢失
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
|
| | |
|
| | | //Log出力
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | }
|
| | | action = null;
|
| | | };
|
| | | }
|
| | | alert.Show(); |
| | | });
|
| | | HdlMessageLogic.Current.ShowMassage(msgType, msg, action, buttonText, i_waitTime); |
| | | } |
| | | |
| | | /// <summary>
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 计算真实宽度(可能以后会变动,所以声明出来有用处)
|
| | | /// </summary>
|
| | | /// <param name="i_size"></param>
|
| | | /// <returns></returns>
|
| | | public int GetRealWidth(int i_size)
|
| | | {
|
| | | return HdlControlLogic.Current.GetRealWidth(i_size);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 计算真实高度度(可能以后会变动,所以声明出来有用处)
|
| | | /// </summary>
|
| | | /// <param name="i_size"></param>
|
| | | /// <returns></returns>
|
| | | public int GetRealHeight(int i_size)
|
| | | {
|
| | | return HdlControlLogic.Current.GetRealHeight(i_size);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 计算真实大小(这个东西有特殊用处,考虑到加长型屏幕的控件,调用此方法)
|
| | | /// </summary>
|
| | | /// <param name="i_size"></param>
|
| | | /// <returns></returns>
|
| | | public int GetRealSizeEx(int i_size)
|
| | | {
|
| | | return HdlControlLogic.Current.GetRealSizeEx(i_size);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 判断指定的界面是否打开
|
| | | /// </summary>
|
| | | /// <param name="formId"></param>
|