Exemplo n.º 1
0
        public void AlertCheck(nsIDOMWindow aParent, string aDialogTitle, string aText, string aCheckMsg, ref bool aCheckState)
        {
            ConfirmDialog dialog = new ConfirmDialog(aText, aDialogTitle, "OK", null, null, aCheckMsg);

            dialog.ShowDialog();

            aCheckState = dialog.CheckBoxChecked;
        }
Exemplo n.º 2
0
        public bool ConfirmCheck(nsIDOMWindow aParent, string aDialogTitle, string aText, string aCheckMsg, ref bool aCheckState)
        {
            ConfirmDialog dialog = new ConfirmDialog(aText, aDialogTitle, "OK", "Cancel", null, aCheckMsg);

            DialogResult result = dialog.ShowDialog();

            aCheckState = dialog.CheckBoxChecked;

            return(result == (DialogResult)1);
        }
Exemplo n.º 3
0
        public int ConfirmEx(nsIDOMWindow aParent, string aDialogTitle, string aText, uint aButtonFlags, string aButton0Title, string aButton1Title, string aButton2Title, string aCheckMsg, ref bool aCheckState)
        {
            string [] buttons = new String[3];
            string [] titles  = { aButton0Title, aButton1Title, aButton2Title };

            for (int i = 0; i < 3; i++)
            {
                uint flags = (aButtonFlags >> (i * 8)) & 0xFF;
                switch (flags)
                {
                case nsIPromptServiceConstants.BUTTON_TITLE_CANCEL: buttons[i] = "Cancel"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_DONT_SAVE: buttons[i] = "&Don't Save"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_NO: buttons[i] = "No"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_OK: buttons[i] = "OK"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_REVERT: buttons[i] = "&Revert"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_SAVE: buttons[i] = "&Save"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_YES: buttons[i] = "Yes"; break;

                case nsIPromptServiceConstants.BUTTON_TITLE_IS_STRING:
                    buttons[i] = titles[i];
                    break;
                }
            }

            ConfirmDialog dialog = new ConfirmDialog(aText, aDialogTitle, buttons[0], buttons[1], buttons[2], aCheckMsg);

            DialogResult result = dialog.ShowDialog();

            aCheckState = dialog.CheckBoxChecked;

            if (result == (DialogResult)1)
            {
                return(0);
            }
            else if (result == (DialogResult)2)
            {
                return(1);
            }
            else if (result == (DialogResult)3)
            {
                return(2);
            }

            return(0);
        }
Exemplo n.º 4
0
        public void ShowNonBlockingAlert(nsIDOMWindow aParent, string aDialogTitle, string aText)
        {
            ConfirmDialog dialog = new ConfirmDialog(aText, aDialogTitle, "OK", null, null, null);

            dialog.Show();
        }