private void BuildProperties(object sender, EventArgs e) { try { if (cmbxConnectionType.SelectedIndex == -1) { MessageBox.Show("Please, Choose a connectionType."); return; } if (true == string.IsNullOrWhiteSpace(txtConnStr.Text)) { MessageBox.Show( "Connection string can not be empty.", "Warning!.."); return; } if (true == string.IsNullOrWhiteSpace(txtPropName.Text)) { MessageBox.Show( "Connection Name can not be empty.", "Warning!.."); return; } txtHashedString.ResetText(); ConnectionTypes connType = (ConnectionTypes)cmbxConnectionType.Items[cmbxConnectionType.SelectedIndex]; string propStr = PropertyBuilder.BuildNew(connType, txtPropName.Text, txtConnStr.Text, chkConnectionStringContains.Checked); txtHashedString.AppendText(propStr); } catch (Exception exc) { txtHashedString.ResetText(); txtHashedString.AppendText(exc.Message + "\n" + exc.StackTrace); } }