Ejemplo n.º 1
0
        /// <summary>
        /// 对MsgBox的调用封装
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="btnText">如果有多个按钮,用|分割,例如:确定|取消|关闭</param>
        /// <param name="onCloseEvent"></param>
        /// <returns></returns>
        public static UIWindow ShowMsgBox(string title, string content, string btnText, UIWindow.CloseEvent onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;
            UIWindow msgBox = UIManager.Instance.OpenWindow(UIConst.UIMsgBox, arg);

            if (msgBox != null && onCloseEvent != null)
            {
                msgBox.onClose += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }

            return(msgBox);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows the message box.
        /// </summary>
        /// <returns>The message box.</returns>
        /// <param name="title">Title.</param>
        /// <param name="content">Content.</param>
        /// <param name="btnText">Button text spilt by "|". Eg: 确定|取消|关闭</param>
        public static UIWindow ShowMsgBox(string title, string content, string btnText, UIWindow.CloseEvent onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;
            UIWindow ui = UIManager.Instance.OpenWindow(UIDef.UIMsgBox, arg);

            if (ui != null && onCloseEvent != null)
            {
                ui.OnCloseEvent += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }
            return(ui);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 对MsgBox的调用封装
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="btnText">如果有多个按钮,用|分割,例如:确定|取消|关闭</param>
        /// <param name="onCloseEvent"></param>
        /// <returns></returns>
        public static UIWindow ShowMsgBox(string title, string content, string btnText, UIWindow.CloseEvent onCloseEvent = null)
        {
            MessageBox.UIMsgBoxArg arg = new MessageBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;
            UIWindow wnd = UIManager.Instance.OpenWindow(UIDef.MessageBox, arg);

            if (wnd != null && onCloseEvent != null)
            {
                wnd.onClose += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }

            return(wnd);
        }