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; } }
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); } }