Пример #1
0
 /// <summary>
 /// MButtons: Display MyButtons on the message box.
 /// </summary>
 static public DialogResult Show(string Message, string Title, CButtons MButtons)
 {
     BuildMessageBox(Title);     // BuildMessageBox method, responsible for creating the MessageBox
     frmTitle.Text   = Title;    // Set the title of the MessageBox
     frmMessage.Text = Message;  //Set the text of the MessageBox
     ButtonStatements(MButtons); // ButtonStatements method is responsible for showing the appropreiate buttons
     newMessageBox.ShowDialog(); // Show the MessageBox as a Dialog.
     return(CYReturnButton);     // Return the button click as an Enumerator
 }
Пример #2
0
        /// <summary>
        /// MIcon: Display MyIcon on the message box.
        /// </summary>
        static public DialogResult Show(string Message, string Title, CButtons MButtons, CIcon MIcon)
        {
            BuildMessageBox(Title);
            frmTitle.Text   = Title;
            frmMessage.Text = Message;
            ButtonStatements(MButtons);
            IconStatements(MIcon);
            Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38);

            pIcon.Image = imageIcon;
            newMessageBox.ShowDialog();
            return(CYReturnButton);
        }
Пример #3
0
        static private void ButtonStatements(CButtons MButtons)
        {
            if (MButtons == CButtons.AbortRetryIgnore)
            {
                ShowIgnoreButton();
                ShowRetryButton();
                ShowAbortButton();
            }

            if (MButtons == CButtons.OK)
            {
                ShowOKButton();
            }

            if (MButtons == CButtons.OKCancel)
            {
                ShowCancelButton();
                ShowOKButton();
            }

            if (MButtons == CButtons.RetryCancel)
            {
                ShowCancelButton();
                ShowRetryButton();
            }

            if (MButtons == CButtons.YesNo)
            {
                ShowNoButton();
                ShowYesButton();
            }

            if (MButtons == CButtons.YesNoCancel)
            {
                ShowCancelButton();
                ShowNoButton();
                ShowYesButton();
            }
        }
Пример #4
0
 private void InitialiseButtons()
 {
     CButtons.ForEach(AddContentToButton);
 }
Пример #5
0
        private void AddButtonsToList()
        {
            IEnumerable <CButton> a = MainWindow.Buttons.Children.Cast <CButton>();

            CButtons.AddRange(a);
        }