public static string GetUserString(string sTitle, string sPrompt, string sDefault, bool bReturnNullIfCancelled) { frmPrompt prompt = new frmPrompt { StartPosition = FormStartPosition.CenterScreen, Text = sTitle }; prompt.txtMessage.Text = sPrompt; prompt.txtInput.Text = sDefault; DialogResult result = prompt.ShowDialog(); if (DialogResult.OK == result) { sDefault = prompt.txtInput.Text; } prompt.Dispose(); if (bReturnNullIfCancelled && (DialogResult.OK != result)) { return null; } return sDefault; }
public static string GetUserString(string sTitle, string sPrompt, string sDefault, bool bReturnNullIfCancelled) { frmPrompt prompt = new frmPrompt { StartPosition = FormStartPosition.CenterScreen, Text = sTitle }; prompt.txtMessage.Text = sPrompt; prompt.txtInput.Text = sDefault; DialogResult result = prompt.ShowDialog(FiddlerApplication._frmMain); if (DialogResult.OK == result) { sDefault = prompt.txtInput.Text; } prompt.Dispose(); if (bReturnNullIfCancelled && (DialogResult.OK != result)) { return(null); } return(sDefault); }