private static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, params string[] arguments)
 {
     return(ShowBox(messageID, RequiredIcon, RequiredButtons, isPrivateFunction, 0, arguments));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sMessage"></param>
 /// <param name="RequiredIcon">Icon to be displayed</param>
 /// <param name="isHardCodedMessage">Should be set to True in case the String is sent instead of the MessageID</param>
 /// <param name="arguments"></param>
 /// <returns>Dialogresult of the clicked button</returns>
 public static System.Windows.Forms.DialogResult ShowBox(string sMessage, BMC_Icon RequiredIcon, bool isHardCodedMessage, params string[] arguments)
 {
     return(ShowBox(sMessage, RequiredIcon, BMC_Button.OK, true, arguments));
 }
 public static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, params string[] arguments)
 {
     return(ShowBox(Application.Current.FindResource(messageID) as string, RequiredIcon, RequiredButtons, true, arguments));
 }
        private static System.Windows.Forms.DialogResult ShowText(string message, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, params string[] arguments)
        {
            newMsgBox = new MessageBox();

            newMsgBox.MsgContent.Text = message;
            if (message.Length > 100) { newMsgBox.MsgContent.FontSize = 14.0; }

            switch (RequiredIcon)
            {
                case (BMC_Icon.Information):
                    {
                        newMsgBox.icnInformation.Opacity = 1.0;
                        break;
                    }
                case (BMC_Icon.Warning):
                    {
                        newMsgBox.icnWarning.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Question:
                    {
                        newMsgBox.icnQuestion.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Error:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
                default:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
            }

            switch (RequiredButtons)
            {
                case BMC_Button.OK:
                    {
                        newMsgBox.OK.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.OKCancel:
                    {
                        newMsgBox.OK.Visibility = Visibility.Visible;
                        newMsgBox.Cancel.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNo:
                    {
                        newMsgBox.Yes.Visibility = Visibility.Visible;
                        newMsgBox.No.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNoCancel:
                    {
                        newMsgBox.Yes.Visibility = Visibility.Visible;
                        newMsgBox.No.Visibility = Visibility.Visible;
                        newMsgBox.Cancel.Visibility = Visibility.Visible;
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            newMsgBox.ShowDialog();
            return _DialogResult;
        }
 public static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, params string[] arguments)
 {
     return ShowBox(Application.Current.FindResource(messageID) as string, RequiredIcon, RequiredButtons, true, arguments);
 }
 private static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, params string[] arguments)
 {
     return ShowBox(messageID, RequiredIcon, RequiredButtons, isPrivateFunction, 0, arguments);
 }
 public static System.Windows.Forms.DialogResult ShowText(string message, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, params string[] arguments)
 {
     return ShowBox(message, RequiredIcon, RequiredButtons, true, arguments);
 }
示例#8
0
 public static System.Windows.Forms.DialogResult ShowText(string message, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, params string[] arguments)
 {
     return(ShowBox(message, RequiredIcon, RequiredButtons, true, arguments));
 }
示例#9
0
        private static System.Windows.Forms.DialogResult ShowText(string message, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, params string[] arguments)
        {
            newMsgBox = new MessageBox();

            newMsgBox.MsgContent.Text = message;
            if (message.Length > 100)
            {
                newMsgBox.MsgContent.FontSize = 14.0;
            }

            switch (RequiredIcon)
            {
            case (BMC_Icon.Information):
            {
                newMsgBox.icnInformation.Opacity = 1.0;
                break;
            }

            case (BMC_Icon.Warning):
            {
                newMsgBox.icnWarning.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Question:
            {
                newMsgBox.icnQuestion.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Error:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }

            default:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }
            }

            switch (RequiredButtons)
            {
            case BMC_Button.OK:
            {
                newMsgBox.OK.Visibility = Visibility.Visible;
                break;
            }

            case BMC_Button.OKCancel:
            {
                newMsgBox.OK.Visibility     = Visibility.Visible;
                newMsgBox.Cancel.Visibility = Visibility.Visible;
                break;
            }

            case BMC_Button.YesNo:
            {
                newMsgBox.Yes.Visibility = Visibility.Visible;
                newMsgBox.No.Visibility  = Visibility.Visible;
                break;
            }

            case BMC_Button.YesNoCancel:
            {
                newMsgBox.Yes.Visibility    = Visibility.Visible;
                newMsgBox.No.Visibility     = Visibility.Visible;
                newMsgBox.Cancel.Visibility = Visibility.Visible;
                break;
            }

            default:
            {
                break;
            }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            newMsgBox.ShowDialog();
            return(_DialogResult);
        }
 /// <summary>
 /// Creates a custom messagebox
 /// </summary>
 /// <param name="content">Content to be displayed</param>
 /// <param name="RequiredIcon">Icon to be displayed</param>
 /// <returns>Dialogresult of the clicked button</returns>
 public static System.Windows.Forms.DialogResult showBox(string content, BMC_Icon RequiredIcon)
 {
     return(showBox(content, RequiredIcon, BMC_Button.OK));
 }
        /// <summary>
        /// Creates a custom messagebox
        /// </summary>
        /// <param name="content">Content to be displayed</param>
        /// <param name="RequiredIcon">Icon to be displayed</param>
        /// <param name="RequiredButtons">Buttons to be displayed</param>
        /// <returns>Dialogresult of the clicked button</returns>
        public static System.Windows.Forms.DialogResult showBox(string content, BMC_Icon RequiredIcon, BMC_Button RequiredButtons)
        {
            newMsgBox = new MessageBox();
            newMsgBox.MsgContent.Text = content;
            //newMsgBox.tbHeader.Text = RequiredIcon.ToString();

            switch (RequiredIcon)
            {
            case (BMC_Icon.Information):
            {
                newMsgBox.icnInformation.Opacity = 1.0;
                break;
            }

            case (BMC_Icon.Warning):
            {
                newMsgBox.icnWarning.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Question:
            {
                newMsgBox.icnQuestion.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Error:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }

            default:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }
            }

            switch (RequiredButtons)
            {
            case BMC_Button.OK:
            {
                newMsgBox.btnOK.Visibility = Visibility.Visible;
                break;
            }

            case BMC_Button.OKCancel:
            {
                newMsgBox.btnOK.Visibility     = Visibility.Visible;
                newMsgBox.btnCancel.Visibility = Visibility.Visible;
                break;
            }

            case BMC_Button.YesNo:
            {
                newMsgBox.btnYes.Visibility = Visibility.Visible;
                newMsgBox.btnNo.Visibility  = Visibility.Visible;
                break;
            }

            case BMC_Button.YesNoCancel:
            {
                newMsgBox.btnYes.Visibility    = Visibility.Visible;
                newMsgBox.btnNo.Visibility     = Visibility.Visible;
                newMsgBox.btnCancel.Visibility = Visibility.Visible;
                break;
            }

            default:
            {
                break;
            }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            newMsgBox.ShowDialog();
            return(_DialogResult);
        }
        /// <summary>
        /// Creates a custom messagebox
        /// </summary>
        /// <param name="content">Content to be displayed</param>
        /// <param name="RequiredIcon">Icon to be displayed</param>
        /// <param name="RequiredButtons">Buttons to be displayed</param>
        /// <returns>Dialogresult of the clicked button</returns>
        public static System.Windows.Forms.DialogResult showBox(string content, BMC_Icon RequiredIcon, BMC_Button RequiredButtons)
        {
            newMsgBox = new MessageBox();
            newMsgBox.MsgContent.Text = content;
            //newMsgBox.tbHeader.Text = RequiredIcon.ToString();

            switch (RequiredIcon)
            {
                case (BMC_Icon.Information):
                    {
                        newMsgBox.icnInformation.Opacity = 1.0;
                        break;
                    }
                case (BMC_Icon.Warning):
                    {
                        newMsgBox.icnWarning.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Question:
                    {
                        newMsgBox.icnQuestion.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Error:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
                default:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
            }

            switch (RequiredButtons)
            {
                case BMC_Button.OK:
                    {
                        newMsgBox.btnOK.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.OKCancel:
                    {
                        newMsgBox.btnOK.Visibility = Visibility.Visible;
                        newMsgBox.btnCancel.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNo:
                    {
                        newMsgBox.btnYes.Visibility = Visibility.Visible;
                        newMsgBox.btnNo.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNoCancel:
                    {
                        newMsgBox.btnYes.Visibility = Visibility.Visible;
                        newMsgBox.btnNo.Visibility = Visibility.Visible;
                        newMsgBox.btnCancel.Visibility = Visibility.Visible;
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            newMsgBox.ShowDialog();
            return _DialogResult;
        }
 /// <summary>
 /// Creates a custom messagebox
 /// </summary>
 /// <param name="content">Content to be displayed</param>
 /// <param name="RequiredIcon">Icon to be displayed</param>
 /// <returns>Dialogresult of the clicked button</returns>
 public static System.Windows.Forms.DialogResult showBox(string content, BMC_Icon RequiredIcon)
 {
     return showBox(content, RequiredIcon, BMC_Button.OK);
 }
 /// <summary>
 /// Creates a custom messagebox whose arguments can be literals
 /// </summary>
 /// <param name="messageID"></param>
 /// <param name="RequiredIcon"></param>
 /// <param name="argument"></param>
 /// <returns></returns>
 public static System.Windows.Forms.DialogResult ShowBoxWithLiteralSubstitute(string messageID, BMC_Icon RequiredIcon, string argument)
 {
     string localizedValue = (string)Application.Current.FindResource(argument);
     return ShowBox(Application.Current.FindResource(messageID) as string, RequiredIcon, BMC_Button.OK, true, localizedValue);
 }
        /// <summary>
        /// Creates a custom messagebox
        /// </summary>
        /// <param name="content">Content to be displayed</param>
        /// <param name="RequiredIcon">Icon to be displayed</param>
        /// <param name="RequiredButtons">Buttons to be displayed</param>
        /// <param name="arguments"></param>
        /// <returns>Dialogresult of the clicked button</returns>
        private static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, int height, params string[] arguments)
        {
            newMsgBox = new MessageBox();

            if (height != 0 &&
                height > 250)
            {
                newMsgBox.LayoutRoot.Height = height;
            }

            var sval = messageID.Split(new string[] { "@@@@@@" }, StringSplitOptions.None);

            if (sval.Count() > 0)
            {
                string newmessage = string.Empty;
                for (int i = 0; i < sval.Count(); i++)
                {
                    newmessage += sval[i];
                    if (arguments.Count() - 1 >= i)
                    {
                        newmessage += arguments[i];
                    }
                }
                newmessage.Replace("@@@@@@", "");
                messageID = newmessage;
            }

            newMsgBox.MsgContent.Text = messageID;
            if (messageID.Length > 100)
            {
                newMsgBox.MsgContent.FontSize = 14.0; newMsgBox.MsgContent.Margin = new Thickness(0, 0, 0, 15);
            }


            switch (RequiredIcon)
            {
            case (BMC_Icon.Information):
            {
                newMsgBox.icnInformation.Opacity = 1.0;
                break;
            }

            case (BMC_Icon.Warning):
            {
                newMsgBox.icnWarning.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Question:
            {
                newMsgBox.icnQuestion.Opacity = 1.0;
                break;
            }

            case BMC_Icon.Error:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }

            default:
            {
                newMsgBox.icnError.Opacity = 1.0;
                break;
            }
            }

            switch (RequiredButtons)
            {
            case BMC_Button.OK:
            {
                newMsgBox.OK.Visibility = Visibility.Visible;
                newMsgBox.OK.IsDefault  = true;
                break;
            }

            case BMC_Button.OKCancel:
            {
                newMsgBox.OK.Visibility     = Visibility.Visible;
                newMsgBox.Cancel.Visibility = Visibility.Visible;
                newMsgBox.OK.IsDefault      = true;
                break;
            }

            case BMC_Button.YesNo:
            {
                newMsgBox.Yes.Visibility = Visibility.Visible;
                newMsgBox.No.Visibility  = Visibility.Visible;
                newMsgBox.Yes.IsDefault  = true;
                break;
            }

            case BMC_Button.YesNoCancel:
            {
                newMsgBox.Yes.Visibility    = Visibility.Visible;
                newMsgBox.No.Visibility     = Visibility.Visible;
                newMsgBox.Cancel.Visibility = Visibility.Visible;
                newMsgBox.Yes.IsDefault     = true;
                break;
            }

            default:
            {
                break;
            }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //
            if ((parentOwner != null) && (parentOwner.IsActive))
            {
                if ((childOwner != null) && (childOwner.IsActive))
                {
                    newMsgBox.Owner = childOwner;
                }
                else
                {
                    newMsgBox.Owner = parentOwner;
                }
            }
            else
            {
                WindowCollection WinScreens = Application.Current.Windows;
                foreach (Window screen in WinScreens)
                {
                    if ((screen.IsActive) && (screen != newMsgBox))
                    {
                        newMsgBox.Owner = screen;
                    }
                }
            }
            //
            if (newMsgBox.Owner == null)
            {
                newMsgBox.Topmost = true;
            }
            //
            newMsgBox.ShowDialog();
            return(_DialogResult);
        }
        /// <summary>
        /// Creates a custom messagebox
        /// </summary>
        /// <param name="content">Content to be displayed</param>
        /// <param name="RequiredIcon">Icon to be displayed</param>
        /// <param name="RequiredButtons">Buttons to be displayed</param>
        /// <param name="arguments"></param>
        /// <returns>Dialogresult of the clicked button</returns>
        private static System.Windows.Forms.DialogResult ShowBox(string messageID, BMC_Icon RequiredIcon, BMC_Button RequiredButtons, bool isPrivateFunction, params string[] arguments)
        {
            newMsgBox = new MessageBox();
            
            var sval = messageID.Split(new string[] { "@@@@@@" }, StringSplitOptions.None);
            if (sval.Count() > 0)
            {
                string newmessage = string.Empty;
                for (int i = 0; i < sval.Count(); i++)
                {
                    newmessage += sval[i];
                    if (arguments.Count() - 1 >= i)
                        newmessage += arguments[i];
                }
                newmessage.Replace("@@@@@@", "");
                messageID = newmessage;
            }

            newMsgBox.MsgContent.Text = messageID;
            if (messageID.Length > 100) { newMsgBox.MsgContent.FontSize = 14.0; }            

            switch (RequiredIcon)
            {
                case (BMC_Icon.Information):
                    {
                        newMsgBox.icnInformation.Opacity = 1.0;
                        break;
                    }
                case (BMC_Icon.Warning):
                    {
                        newMsgBox.icnWarning.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Question:
                    {
                        newMsgBox.icnQuestion.Opacity = 1.0;
                        break;
                    }
                case BMC_Icon.Error:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
                default:
                    {
                        newMsgBox.icnError.Opacity = 1.0;
                        break;
                    }
            }

            switch (RequiredButtons)
            {
                case BMC_Button.OK:
                    {
                        newMsgBox.OK.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.OKCancel:
                    {
                        newMsgBox.OK.Visibility = Visibility.Visible;
                        newMsgBox.Cancel.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNo:
                    {
                        newMsgBox.Yes.Visibility = Visibility.Visible;
                        newMsgBox.No.Visibility = Visibility.Visible;
                        break;
                    }
                case BMC_Button.YesNoCancel:
                    {
                        newMsgBox.Yes.Visibility = Visibility.Visible;
                        newMsgBox.No.Visibility = Visibility.Visible;
                        newMsgBox.Cancel.Visibility = Visibility.Visible;
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            newMsgBox.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //
            if ((parentOwner != null) && (parentOwner.IsActive))
            {
                if ((childOwner != null) && (childOwner.IsActive))
                {
                    newMsgBox.Owner = childOwner;
                }
                else
                    newMsgBox.Owner = parentOwner;
            }
            else
            {
                WindowCollection WinScreens = Application.Current.Windows;
                foreach (Window screen in WinScreens)
                {
                    if ((screen.IsActive) && (screen != newMsgBox))
                        newMsgBox.Owner = screen;
                }

            }
            //
            if (newMsgBox.Owner == null)
                newMsgBox.Topmost = true;
            //
            newMsgBox.ShowDialog();
            return _DialogResult;            
        }
        /// <summary>
        /// Creates a custom messagebox whose arguments can be literals
        /// </summary>
        /// <param name="messageID"></param>
        /// <param name="RequiredIcon"></param>
        /// <param name="argument"></param>
        /// <returns></returns>
        public static System.Windows.Forms.DialogResult ShowBoxWithLiteralSubstitute(string messageID, BMC_Icon RequiredIcon, string argument)
        {
            string localizedValue = (string)Application.Current.FindResource(argument);

            return(ShowBox(Application.Current.FindResource(messageID) as string, RequiredIcon, BMC_Button.OK, true, localizedValue));
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sMessage"></param>
 /// <param name="RequiredIcon">Icon to be displayed</param>
 /// <param name="isHardCodedMessage">Should be set to True in case the String is sent instead of the MessageID</param>
 /// <param name="arguments"></param>
 /// <returns>Dialogresult of the clicked button</returns>
 public static System.Windows.Forms.DialogResult ShowBox(string sMessage, BMC_Icon RequiredIcon, bool isHardCodedMessage, params string[] arguments)
 {
     return ShowBox(sMessage, RequiredIcon, BMC_Button.OK, true, arguments);
 }