Example #1
0
        /// <summary>
        /// Gets the input string with regular expression checking and character casing.
        /// </summary>
        /// <param name="_text">Prompt text to be shown on the dialog.</param>
        /// <param name="_caption">The caption of the dialog.</param>
        /// <param name="_regEx">The regular expression checking object.</param>
        /// <param name="_casing">The character casing.</param>
        /// <returns></returns>
        public static string GetInputString(string _text, string _caption, Regex _regEx, CharacterCasing _casing)
        {
            StringInputBox inputBox = new StringInputBox();
            inputBox.lblPrompt.Text = _text;
            inputBox.Text = _caption;
            inputBox.regEx__ = _regEx;
            inputBox.textBox1.CharacterCasing = _casing;

            if (inputBox.ShowDialog() == DialogResult.OK)
            {
                return inputBox.textBox1.Text;
            }
            else
            {
                return string.Empty;
            }
        }
Example #2
0
        /// <summary>
        /// Gets the input string with regular expression checking and character casing.
        /// </summary>
        /// <param name="_text">Prompt text to be shown on the dialog.</param>
        /// <param name="_caption">The caption of the dialog.</param>
        /// <param name="_regEx">The regular expression checking object.</param>
        /// <param name="_casing">The character casing.</param>
        /// <returns></returns>
        public static string GetInputString(string _text, string _caption, Regex _regEx, CharacterCasing _casing)
        {
            StringInputBox inputBox = new StringInputBox();

            inputBox.lblPrompt.Text           = _text;
            inputBox.Text                     = _caption;
            inputBox.regEx__                  = _regEx;
            inputBox.textBox1.CharacterCasing = _casing;

            if (inputBox.ShowDialog() == DialogResult.OK)
            {
                return(inputBox.textBox1.Text);
            }
            else
            {
                return(string.Empty);
            }
        }