コード例 #1
0
    /// <summary>
    ///     只提供信息显示功能和yes/no选项
    /// </summary>
    public static UIMessageBox ShowMessageBox(string caption, string msg,
                                              string yesText, string noText, CallBack callBack)
    {
        UIMessageBox msgBox = UIMessageBoxManager.Inst.CreateMessageBox();

        if (null != msgBox)
        {
            msgBox.caption = caption;
            msgBox.msg     = msg;
            msgBox.style   = Style.YesNo;
            msgBox.SetButtonText(ButtonId.Yes, yesText);
            msgBox.SetButtonText(ButtonId.No, noText);
            msgBox.callBack = callBack;

            msgBox.Show();

            return(msgBox);
        }

        return(null);
    }
コード例 #2
0
    /// <summary>
    ///     只提供信息显示功能和一个关闭按钮.
    /// </summary>
    public static UIMessageBox ShowMessageBox(string caption, string msg, string yesText = null)
    {
        UIMessageBox msgBox = UIMessageBoxManager.Inst.CreateMessageBox();

        if (null != msgBox)
        {
            msgBox.caption = caption;
            msgBox.msg     = msg;
            msgBox.style   = Style.Yes;

            if (null != yesText)
            {
                msgBox.SetButtonText(ButtonId.Yes, yesText);
            }

            msgBox.Show();

            return(msgBox);
        }

        return(null);
    }