Ejemplo n.º 1
0
        /// <summary>
        /// Obtiene la imagen de un icono para un messagebox
        /// a partir de su tipo y tama�o
        /// </summary>
        /// <param name="_MessageBoxIcon">Tipo del MessageBoxIcon</param>
        /// <param name="pIconSize">Tama�o del icono</param>
        /// <returns>Imagen resultante.</returns>
        public static Image GetMessageBoxIcon(Fwk.UI.Common.MessageBoxIcon _MessageBoxIcon, IconSize pIconSize)
        {
            Image imgIcon = null;

            switch (_MessageBoxIcon)
            {
            case Fwk.UI.Common.MessageBoxIcon.Exclamation:
            {
                imgIcon =
                    (Image)
                    Fwk.UI.Properties.Resources.ResourceManager.GetObject(
                        string.Concat("exclamation_", (int)pIconSize));

                break;
            }

            case Fwk.UI.Common.MessageBoxIcon.Warning:
            {
                imgIcon =
                    (Image)
                    Fwk.UI.Properties.Resources.ResourceManager.GetObject(
                        string.Concat("warning_", (int)pIconSize));
                break;
            }

            case Fwk.UI.Common.MessageBoxIcon.Question:
            {
                imgIcon =
                    (Image)
                    Fwk.UI.Properties.Resources.ResourceManager.GetObject(
                        string.Concat("question_", (int)pIconSize));
                break;
            }

            case Fwk.UI.Common.MessageBoxIcon.Error:
            {
                imgIcon =
                    (Image)
                    Fwk.UI.Properties.Resources.ResourceManager.GetObject(
                        string.Concat("error_", (int)pIconSize));
                break;
            }

            case Fwk.UI.Common.MessageBoxIcon.Information:
            {
                imgIcon =
                    (Image)
                    Fwk.UI.Properties.Resources.ResourceManager.GetObject(
                        string.Concat("information_", (int)pIconSize));

                break;
            }
            }

            return(imgIcon);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Muestra el Mensaje
        /// </summary>
        /// <param name="pMessage">Mensaje a mostrar</param>
        /// <param name="pMessageBoxButtons">Specifies constants defining which buttons to display on a System.Windows.Forms.MessageBox.</param>
        /// <param name="MessageBoxIcon">Specifies constants defining which information to display.</param>
        /// <returns>DialogResult</returns>
        public static DialogResult Show(String pMessage, String pTitle,
                                        MessageBoxButtons pMessageBoxButtons, Fwk.UI.Common.MessageBoxIcon pIcon)
        {
            using (MessageView wfrmMessageView = new MessageView())
            {
                wfrmMessageView.Text           = pTitle;
                wfrmMessageView.Message        = pMessage;
                wfrmMessageView.MessageBoxIcon = pIcon;

                wfrmMessageView.SetButtonsVisibility(pMessageBoxButtons);

                wfrmMessageView.ShowDialog();

                return(wfrmMessageView.DialogResult);
            }
        }