Exemplo n.º 1
0
        public static string Show(IWin32Window parent, string title, string message, string defaultValue, InputValidator validator)
        {
            PromptWindow window = new PromptWindow();
            window.Text = title;
            window.Message = message;
            window.textInput.Text = defaultValue;
            if (validator != null)
            {
                window.Validator = validator;
            }

            DialogResult result = window.ShowDialog(parent);
            if (result == DialogResult.OK)
            {
                return window.textInput.Text;
            }
            else
            {
                return null;
            }
        }
Exemplo n.º 2
0
        public static string Show(IWin32Window parent, string title, string message, string defaultValue, InputValidator validator)
        {
            PromptWindow window = new PromptWindow();

            window.Text           = title;
            window.Message        = message;
            window.textInput.Text = defaultValue;
            if (validator != null)
            {
                window.Validator = validator;
            }

            DialogResult result = window.ShowDialog(parent);

            if (result == DialogResult.OK)
            {
                return(window.textInput.Text);
            }
            else
            {
                return(null);
            }
        }