private void btnOk_Click(object sender, EventArgs e) { try { if (txtSolutionName.Text == string.Empty) { txtSolutionName.Select(); MessageBox.Show("Please input the solution name!", CGConstants.MSG_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (ConfigCtrl.IsSolutionExist(_vsversion, txtSolutionName.Text)) { txtSolutionName.Select(); MessageBox.Show("The template has already existed!", CGConstants.MSG_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ConfigCtrl.AddSolution(_vsversion, txtSolutionName.Text); _newsolutionname = txtSolutionName.Text; this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }