コード例 #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;
            }
        }
コード例 #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);
            }
        }