Exemplo n.º 1
0
        /// <summary>
        /// Gets the type of the exchequer dialog.
        /// </summary>
        /// <param name="icon">The icon.</param>
        /// <returns></returns>
        private static TEntMsgDlgType GetExchequerDialogType(MessageBoxIcon icon)
        {
            TEntMsgDlgType result = TEntMsgDlgType.emtCustom;

            switch (icon)
            {
            case MessageBoxIcon.None:
                result = TEntMsgDlgType.emtCustom;
                break;

            case MessageBoxIcon.Information:
                result = TEntMsgDlgType.emtInformation;
                break;

            case MessageBoxIcon.Error:
                result = TEntMsgDlgType.emtError;
                break;

            case MessageBoxIcon.Warning:
                result = TEntMsgDlgType.emtWarning;
                break;

            case MessageBoxIcon.Question:
                result = TEntMsgDlgType.emtConfirmation;
                break;
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Shows the message box.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="icon">The icon.</param>
        /// <param name="customisation">The customisation.</param>
        /// <param name="buttons">The buttons.</param>
        /// <returns></returns>
        public static DialogResult ShowMessageBox(string message, MessageBoxIcon icon, ICOMCustomisation customisation, MessageBoxButtons buttons = MessageBoxButtons.OK)
        {
            TEntMsgDlgType   dialogType            = GetExchequerDialogType(icon);
            TentMsgDlgReturn exchequerDialogResult = customisation.SysFunc.entMessageDlg(dialogType, message, GetExchequerMessageBoxButtons(buttons));
            DialogResult     result = GetDialogResult(exchequerDialogResult);

            return(result);
        }