/// <summary> /// Shows the form modally and returns the address selected, or null if cancelled. /// </summary> public static string ShowAndGetAddress( IWin32Window parent ) { var form = new NewSessionForm( ); if ( form.ShowDialog( parent ) == DialogResult.OK ) return form.tbServerAddress.Text; else return null; }
//================================================================================= // // PRIVATE METHODS // //================================================================================= /// <summary>Prompts the user to enter an address, then creates a tab.</summary> private void PromptForNewSession( ) { var address = NewSessionForm.ShowAndGetAddress(this); if (!string.IsNullOrEmpty(address)) { Add(new MongoSession(address)); } }
/// <summary> /// Shows the form modally and returns the address selected, or null if cancelled. /// </summary> public static string ShowAndGetAddress(IWin32Window parent) { var form = new NewSessionForm( ); if (form.ShowDialog(parent) == DialogResult.OK) { return(form.tbServerAddress.Text); } else { return(null); } }