예제 #1
0
        //
        //Функция для вывода сообщения ошибки или предупреждения с 0 по 19 зарезервированы номера ошибок с 20 предупреждений
        //

        private void GenFault(int numOfError)
        {
            string txtOfError;
            string txtOfHead = "Ошибка!";

            System.Windows.Forms.MessageBoxButtons MBB = MessageBoxButtons.OK;
            System.Windows.Forms.MessageBoxIcon    MBI = MessageBoxIcon.Error;
            switch (numOfError)
            {
            //
            //Ошибки
            //
            case 0:
                txtOfError = "Произошла ошибка при открытии документа 1!\nError in CreateTemplate()";
                break;

            case 1:
                txtOfError = "Произошла ошибка при генерации основного формата!\nError in ChangeTemplate()";
                break;

            case 2:
                txtOfError = "Произошла ошибка при открытии документа 2!\nError in CreateTemplate()";
                break;

            case 3:
                txtOfError = "Произошла ошибка при редактировании тела шаблона!\nError in ChangeTable()";
                break;

            case 4:
                txtOfError = "Произошла ошибка при генерации тела шаблона! \nError in ChangeBody();";
                break;

            //
            //Предупреждения
            //
            case 20:
                txtOfError = "Не все поля заполнены и/или не указано место сохранения";
                txtOfHead  = "Предупреждение!";
                MBI        = MessageBoxIcon.Warning;
                break;

            //
            //Ошибка, при некорректном method
            //
            default:
                txtOfError = "Неизвестная ошибка в коде. Обратитесь к специалисту.";
                break;
            }
            MessageBox.Show(txtOfError, txtOfHead, MBB, MBI);
            if (numOfError <= 19)
            {
                wordapp.Quit(ref falseObj, ref missingObj, ref missingObj);
                worddocument  = null;
                worddocument2 = null;
                wordapp       = null;
                GeneralFault  = true;
            }
        }
예제 #2
0
        public void syntaxErrorPopUp(string com)
        {
            System.Windows.Forms.MessageBoxButtons button = System.Windows.Forms.MessageBoxButtons.OK;
            string caption = "SYNTAX ERROR";
            string message = ($"Syntax error at: {com}");

            System.Windows.Forms.MessageBoxIcon icon = System.Windows.Forms.MessageBoxIcon.Error;
            System.Windows.Forms.MessageBox.Show(message, caption, button, icon);
        }
예제 #3
0
        private void bFileHelp_Click(object sender, RoutedEventArgs e)
        {
            string messageBoxText = "Adjusting the slider control changes the flood fill algorithm and it may provide for better results.";
            string caption        = "help";

            System.Windows.Forms.MessageBoxButtons mbutton = MessageBoxButtons.OK;
            System.Windows.Forms.MessageBoxIcon    mIcon   = System.Windows.Forms.MessageBoxIcon.Information;
            System.Windows.Forms.MessageBox.Show(messageBoxText, caption, mbutton, mIcon);
        }
예제 #4
0
        private void bImageHelp_Click(object sender, RoutedEventArgs e)
        {
            string messageBoxText = "Use the BROWSE button to select a scanned image of shreds for processing.  For best results scan the paper shreds on top of a high contrast background (example: white paper shreds on a pink background)";
            string caption        = "help";

            System.Windows.Forms.MessageBoxButtons mbutton = MessageBoxButtons.OK;
            System.Windows.Forms.MessageBoxIcon    mIcon   = System.Windows.Forms.MessageBoxIcon.Information;
            System.Windows.Forms.MessageBox.Show(messageBoxText, caption, mbutton, mIcon);
        }
예제 #5
0
            public override void Execute()
            {
                System.Windows.Forms.MessageBoxButtons button = 0;
                System.Windows.Forms.MessageBoxIcon    icon   = 0;

                switch (parameters[1])
                {
                case "MB1":
                    button = System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore;
                    break;

                case "MB2":
                    button = System.Windows.Forms.MessageBoxButtons.OK;
                    break;

                case "MB3":
                    button = System.Windows.Forms.MessageBoxButtons.OKCancel;
                    break;

                case "MB4":
                    button = System.Windows.Forms.MessageBoxButtons.RetryCancel;
                    break;

                case "MB5":
                    button = System.Windows.Forms.MessageBoxButtons.YesNo;
                    break;

                case "MB6":
                    button = System.Windows.Forms.MessageBoxButtons.YesNoCancel;
                    break;
                }

                switch (parameters[2])
                {
                case "MI1":
                    icon = System.Windows.Forms.MessageBoxIcon.Information;
                    break;

                case "MI2":
                    icon = System.Windows.Forms.MessageBoxIcon.Error;
                    break;

                case "MI3":
                    icon = System.Windows.Forms.MessageBoxIcon.Exclamation;
                    break;

                case "MI4":
                    icon = System.Windows.Forms.MessageBoxIcon.None;
                    break;

                case "MI5":
                    icon = System.Windows.Forms.MessageBoxIcon.Question;
                    break;
                }

                System.Windows.Forms.MessageBox.Show(value, parameters[0].ToString(), button, icon);
            }
예제 #6
0
        public void invalidFunctionPopUp(string type)
        {
            System.Windows.Forms.MessageBoxButtons button = System.Windows.Forms.MessageBoxButtons.OK;
            string caption = "INVALID FUNCTION NAME";
            string message = ($"{type} function doesn't exist in the current context!");

            message = message.Substring(0, 1).ToUpper() + message.Substring(1, message.Length - 1);
            System.Windows.Forms.MessageBoxIcon icon = System.Windows.Forms.MessageBoxIcon.Error;
            System.Windows.Forms.MessageBox.Show(message, caption, button, icon);
        }
예제 #7
0
 public void ShowMessage(string msg, System.Windows.Forms.MessageBoxIcon type)
 {
     if (this._main is IMessage)
     {
         ((IMessage)_main).ShowMessage(msg, type);
     }
     else
     {
         MessageBox.Show(msg, this.Caption, System.Windows.Forms.MessageBoxButtons.OK, type);
     }
 }
예제 #8
0
        public System.Windows.Forms.DialogResult ShowDialog(IWin32Window owner,
                                                            string text, string detail = "", string caption = "DialogAsShieldIcon",
                                                            System.Windows.Forms.MessageBoxButtons Buttons = System.Windows.Forms.MessageBoxButtons.OKCancel,
                                                            System.Windows.Forms.MessageBoxIcon icon       = MessageBoxIcon.Question)
        {
            this.Label1.Text     = text;
            this.Text            = caption;
            this.TextDetail.Text = detail;

            switch (Buttons)
            {
            case MessageBoxButtons.OKCancel:
                OK_Button.Text     = "OK";
                Cancel_Button.Text = "Cancel";
                break;

            case MessageBoxButtons.YesNo:
                OK_Button.Text     = "Yes";
                Cancel_Button.Text = "No";
                break;

            default:
                OK_Button.Text     = "OK";
                Cancel_Button.Text = "Cancel";
                break;
            }
            // とりあえずアイコンは処理しない(互換性のためパラメータだけ指定できる)

            base.ShowDialog(this.Owner);
            while (this.dResult == System.Windows.Forms.DialogResult.None)
            {
                System.Threading.Thread.Sleep(200);
                Application.DoEvents();
            }
            if (Buttons == MessageBoxButtons.YesNo)
            {
                switch (dResult)
                {
                case System.Windows.Forms.DialogResult.OK:
                    return(System.Windows.Forms.DialogResult.Yes);

                case System.Windows.Forms.DialogResult.Cancel:
                    return(System.Windows.Forms.DialogResult.No);
                }
            }
            else
            {
                return(dResult);
            }

            return(dResult);
        }
예제 #9
0
        public void doAction()
        {
            if (trianglePossible())
            {
                using (Graphics g = Graphics.FromImage(f.getBitmap()))
                {
                    g.DrawPolygon(Pens.White, drawPoints());
                    g.Dispose();
                }

                f.getMainDraw().Invalidate();
            }
            else
            {
                System.Windows.Forms.MessageBoxButtons button = System.Windows.Forms.MessageBoxButtons.OK;
                string caption = "Invalid parameters";
                string message = ("Cannot make triangle from these sides");
                System.Windows.Forms.MessageBoxIcon icon = System.Windows.Forms.MessageBoxIcon.Error;
                System.Windows.Forms.MessageBox.Show(message, caption, button, icon);
            }
        }
예제 #10
0
        public static void ShowMessage(string msg, int w, int h, System.Windows.Forms.MessageBoxIcon iconStyle, ScrollBars scrollBars = ScrollBars.None)
        {
            using (Dialogs form = new Dialogs())
            {
                form.btnYes.Visible = false;

                if (iconStyle == MessageBoxIcon.Information)
                {
                    form.pictureBox1.Image = Properties.Resources.information;
                }
                else if (iconStyle == MessageBoxIcon.Warning)
                {
                    form.pictureBox1.Image = Properties.Resources.warning;
                }
                else if (iconStyle == MessageBoxIcon.Error)
                {
                    form.pictureBox1.Image = Properties.Resources.error;
                }
                else
                {
                    form.pictureBox1.Visible = false;
                }

                form.metroTextBox3.Text       = msg;
                form.metroTextBox3.ScrollBars = scrollBars;
                if (w > 0)
                {
                    form.Width = w;
                }
                if (h > 0)
                {
                    form.Height = Math.Max(150, h);
                }
                form.ShowDialog();
            }
        }
예제 #11
0
 ///<summary>Shows a message to the user.  Automatically checks to see if a progress window is showing and will ask the progress window
 ///to show the message to the user so that the progress window doesn't cover up the question.</summary>
 public static System.Windows.Forms.DialogResult Show(System.Windows.Forms.IWin32Window owner, string text, string caption,
                                                      System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon)
 {
     return(ShowHelper((formPB) => formPB.MsgBoxShow(text, caption, buttons, icon), () => System.Windows.Forms.MessageBox.Show(owner, text, caption, buttons, icon)));
 }
예제 #12
0
 public static bool PromptDefaultNo(IWin32Window owner, string text, string caption = Const.Confirm, MBI icon = Warning) =>
 Prompt(owner, text, caption, icon, true);
예제 #13
0
 public static bool PromptDefaultNo(string text, string caption = Const.Confirm, MBI icon = Warning) =>
 Prompt(text, caption, icon, true);
예제 #14
0
 public static bool Prompt(IWin32Window owner, string text, string caption = Const.Confirm, MBI icon = Question, bool defaultTheNoButton = false) =>
 Show(owner, text, caption, YesNoCancel, icon, defaultTheNoButton) == DR.Yes;
예제 #15
0
 public static DR Show(IWin32Window owner, string text, string caption = Const.Confirm, MBB buttons = YesNoCancel, MBI icon = Question, bool defaultTheNoButton = false) =>
 MB.Show(owner, text, caption, buttons, icon, defaultTheNoButton ? Button2 : Button1);
예제 #16
0
        public static System.Windows.Forms.DialogResult ShowMSSS(System.String text, System.String caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon)
        {
            object result;

            if (TestSpecificStubsUtil.RunTestSpecificStub(System.Reflection.MethodBase.GetCurrentMethod(), new object[] { text, caption, buttons, icon }, out result))
            {
                return((System.Windows.Forms.DialogResult)result);
            }
            else
            {
                return(STEE.ISCS.MulLanguage.MessageBoxDialog.Show(text, caption, buttons, icon));
            }
        }
예제 #17
0
 public MsgBoxInfo()
 {
     this.messageBoxIcon_0 = System.Windows.Forms.MessageBoxIcon.Asterisk;
 }
예제 #18
0
 public DialogResult message_box(string _msg, string _caption, MessageBoxButtons _buttons, System.Windows.Forms.MessageBoxIcon _icon = System.Windows.Forms.MessageBoxIcon.Warning)
 {
     return(MessageBox.Show(this, _msg, _caption, _buttons, _icon));
 }
예제 #19
0
 /// <summary>
 /// 显示信息窗口(对话框)
 /// </summary>
 /// <param name="text">信息文本(主要的信息内容)</param>
 /// <param name="caption">提示框标题</param>
 /// <param name="buttons">可选按钮</param>
 /// <param name="icon">窗口图标</param>
 /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
 /// <param name="options">选项</param>
 /// <returns>对话框结果</returns>
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 {
     return(SWF.MessageBox.Show(text, caption, buttons, icon, defaultButton, options));
 }
예제 #20
0
 public static DialogResult ShowMessage(string MessID, System.Windows.Forms.MessageBoxButtons MessageButtons, System.Windows.Forms.MessageBoxIcon MessageIcons)
 {
     return(System.Windows.Forms.MessageBox.Show(GetMessage(MessID), HPA.Common.CommonConst.CPN_STD_NAME, MessageButtons, MessageIcons));
 }
예제 #21
0
 public static System.Windows.Forms.DialogResult MsgBox(string message, string title = "Dupe Clear",
                                                        System.Windows.Forms.MessageBoxButtons buttons = System.Windows.Forms.MessageBoxButtons.OK,
                                                        System.Windows.Forms.MessageBoxIcon icon       = System.Windows.Forms.MessageBoxIcon.Information)
 {
     return(System.Windows.Forms.MessageBox.Show(message, title, buttons, icon));
 }
예제 #22
0
 public void Mensage(string Mensaje, string Titulo, System.Windows.Forms.MessageBoxButtons Botones, System.Windows.Forms.MessageBoxIcon Icono)
 {
     DevExpress.XtraEditors.XtraMessageBox.Show(Mensaje, Titulo, Botones, Icono);
 }
예제 #23
0
        public static System.Windows.Forms.DialogResult ShowTSSS(System.String text, System.String caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon)
        {
            string name = Dottest.Framework.Stubs.CurrentTestMethod.Name;

            if (name.Equals("TestdataPointListDataGridView_CellDoubleClick01") ||
                name.Equals("TestCellDoubleClick01"))
            {
                return(DialogResult.Yes);
            }
            else
            {
                Exception e = new Exception();
                throw e;
            }
        }
예제 #24
0
        //┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        //  start access operation
        //┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        internal void StartAccess()
        {
            button_access.Text = "STOP";

            // lock operation
            if (radioButton_lock.Checked)
            {
                UInt32 pwdACCESS;
                ushort lock_enable = 0;
                ushort lock_mask   = 0;

                int mark;
                int index = (int)comboBox_bank.SelectedIndex;

                if (false == UtilClass.HEX32(out pwdACCESS, textBox_accesspassword.Text))
                {
                    AccessEnd();
                    MessageBox.Show("Wrong Access Password!!");
                    return;
                }

                // set kill password field
                if (index == 0)
                {
                    mark = (int)comboBox_lockop.SelectedIndex;
                }
                else
                {
                    mark = 0;
                }

                lock_enable |= SWAPLSB2(mark > 0 ? mark - 1 : 0);
                lock_mask   |= (ushort)(mark > 0 ? 3 : 0);

                lock_enable <<= 2;
                lock_mask   <<= 2;

                // set access password field
                if (index == 1)
                {
                    mark = (int)comboBox_lockop.SelectedItem;
                }
                else
                {
                    mark = 0;
                }

                lock_enable |= SWAPLSB2(mark > 0 ? mark - 1 : 0);
                lock_mask   |= (ushort)(mark > 0 ? 3 : 0);

                lock_enable <<= 2;
                lock_mask   <<= 2;

                // set EPC memory field
                if (index == 2)
                {
                    mark = (int)comboBox_lockop.SelectedItem;
                }
                else
                {
                    mark = 0;
                }

                lock_enable |= SWAPLSB2(mark > 0 ? mark - 1 : 0);
                lock_mask   |= (ushort)(mark > 0 ? 3 : 0);

                lock_enable <<= 2;
                lock_mask   <<= 2;

                // TID memory field
                if (index == 3)
                {
                    mark = (int)comboBox_lockop.SelectedItem;
                }
                else
                {
                    mark = 0;
                }

                lock_enable |= SWAPLSB2(mark > 0 ? mark - 1 : 0);
                lock_mask   |= (ushort)(mark > 0 ? 3 : 0);

                lock_enable <<= 2;
                lock_mask   <<= 2;

                // USER memory field
                if (index == 4)
                {
                    mark = (int)comboBox_lockop.SelectedItem;
                }
                else
                {
                    mark = 0;
                }

                lock_enable |= SWAPLSB2(mark > 0 ? mark - 1 : 0);
                lock_mask   |= (ushort)(mark > 0 ? 3 : 0);

                MainForm.RFIDAPI.UHFAPI_LockSetTag((UHFAPI_NET.UHFAPI_NET.typeLockMasks)lock_mask, (UHFAPI_NET.UHFAPI_NET.typeLockMasks)lock_enable, pwdACCESS, MainForm.SetControlParam, false);
            }

            else if (radioButton_kill.Checked)
            {
                UInt32 pwdACCESS;
                UInt32 pwdKILL;

                if (false == UtilClass.HEX32(out pwdACCESS, textBox_accesspassword.Text))
                {
                    AccessEnd();
                    MessageBox.Show("Wrong Access Password!!");
                    return;
                }

                if (false == UtilClass.HEX32(out pwdKILL, textBox_killpassword.Text))
                {
                    AccessEnd();
                    MessageBox.Show("Wrong Access Password!!");
                    return;
                }

                System.Windows.Forms.MessageBoxButtons button = System.Windows.Forms.MessageBoxButtons.YesNo;
                System.Windows.Forms.MessageBoxIcon    icon   = System.Windows.Forms.MessageBoxIcon.Warning;
                System.Windows.Forms.DialogResult      rts    = System.Windows.Forms.MessageBox.Show("If you click on this YES, the kill tag will run..", "", button, icon);

                switch (rts)
                {
                case System.Windows.Forms.DialogResult.Yes:
                {
                    MainForm.SetupOperationParameter();

                    MainForm.RFIDAPI.UHFAPI_KillTag(pwdKILL, pwdACCESS, MainForm.SetControlParam, false);
                }
                break;

                case System.Windows.Forms.DialogResult.No:
                {
                    AccessEnd();
                }
                break;
                }
            }
        }
예제 #25
0
 public static bool Prompt(string message, System.Windows.Forms.MessageBoxIcon icon = System.Windows.Forms.MessageBoxIcon.Question)
 {
     return(System.Windows.Forms.MessageBox.Show(message, Application.ProductName, System.Windows.Forms.MessageBoxButtons.YesNo, icon) == DialogResult.Yes);
 }
예제 #26
0
 public static void Show(string txtMessage, string txtCaption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon)
 {
     System.Windows.Forms.MessageBox.Show(txtMessage, txtCaption, buttons, icon);
 }
예제 #27
0
 public static WF.DialogResult ShowMessage(WF.IWin32Window owner = null, string text = null, string caption = null, WF.MessageBoxButtons buttons = WF.MessageBoxButtons.OK, WF.MessageBoxIcon icon = WF.MessageBoxIcon.Information, WF.MessageBoxDefaultButton defaultButton = WF.MessageBoxDefaultButton.Button1)
 {
     if (owner == null)
     {
         owner = GetMainForm();
     }
     if (string.IsNullOrEmpty(text))
     {
         text = "Informace nebyla zadána";
     }
     if (string.IsNullOrEmpty(caption))
     {
         caption = AppTitle;
     }
     if (owner != null && owner is WF.Form form && form.InvokeRequired)
     {
         return((WF.DialogResult)form.Invoke(new Func <WF.IWin32Window, string, string, WF.MessageBoxButtons, WF.MessageBoxIcon, WF.MessageBoxDefaultButton, WF.DialogResult>(_ShowMessage), owner, text, caption, buttons, icon, defaultButton));
     }
예제 #28
0
 private void NewMessageWindow(int textID, LSPosMessageTypeButton buttonType, System.Windows.Forms.MessageBoxIcon icon)
 {
     CloseExistingMessageWindow();
     popupDialog = new frmMessage(textID, buttonType, icon);
     this.Application.ApplicationFramework.POSShowFormModeless(popupDialog);
 }
예제 #29
0
 public static DR Show(string text, string caption = Const.Confirm, MBB buttons = YesNoCancel, MBI icon = Question, bool defaultTheNoButton = false) =>
 Show(null, text, caption, buttons, icon, defaultTheNoButton);
예제 #30
0
            public RichMessageBox(NetComUser pSender, NetComUser pReceiver, string pMessage, string pCaption, System.Windows.Forms.MessageBoxButtons pButtons, System.Windows.Forms.MessageBoxIcon pIcon)
                : base(pSender, pReceiver, pMessage, null)
            {
                object[] prm = new object[3];

                prm[0] = pCaption;

                switch (pButtons)
                {
                case System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore:
                    prm[1] = "MB1";
                    break;

                case System.Windows.Forms.MessageBoxButtons.OK:
                    prm[1] = "MB2";
                    break;

                case System.Windows.Forms.MessageBoxButtons.OKCancel:
                    prm[1] = "MB3";
                    break;

                case System.Windows.Forms.MessageBoxButtons.RetryCancel:
                    prm[1] = "MB4";
                    break;

                case System.Windows.Forms.MessageBoxButtons.YesNo:
                    prm[1] = "MB5";
                    break;

                case System.Windows.Forms.MessageBoxButtons.YesNoCancel:
                    prm[1] = "MB6";
                    break;
                }

                switch (pIcon)
                {
                case System.Windows.Forms.MessageBoxIcon.Information:
                    prm[2] = "MI1";
                    break;

                case System.Windows.Forms.MessageBoxIcon.Error:
                    prm[2] = "MI2";
                    break;

                case System.Windows.Forms.MessageBoxIcon.Exclamation:
                    prm[2] = "MI3";
                    break;

                case System.Windows.Forms.MessageBoxIcon.None:
                    prm[2] = "MI4";
                    break;

                case System.Windows.Forms.MessageBoxIcon.Question:
                    prm[2] = "MI5";
                    break;
                }

                parameters = prm;
            }