// Run when the attribute type is changed private void cboxAttributeType_SelectedIndexChanged(object sender, EventArgs e) { int columnIndex = cboxCurrentAttribute.SelectedIndex; currentEditDef = SQLTypeDefFactory.getNew((SQLTypeDef.SQLTypeID)cboxAttributeType.SelectedIndex); if (currentEditDef.getParams().Length == 0) { btnAdvancedAttribute.Enabled = false; } else { btnAdvancedAttribute.Enabled = true; } }
// Run when the advanced button is pressed private void btnAdvancedAttribute_Click(object sender, EventArgs e) { int columnIndex = cboxCurrentAttribute.SelectedIndex; SQLTypeDef def = SQLTypeDefFactory.getCopy(currentEditDef); AdvancedAttributeForm popupForm = new AdvancedAttributeForm(def); if (popupForm.ShowDialog(this) == DialogResult.OK) { currentEditDef = def; MessageBox.Show("Successfully saved attribute parameter changes!", "Success"); } else { MessageBox.Show("Attribute parameter changes have been cancelled!", "Cancelled"); } }
private SQLTypeDef tdCng; // Temporary copy of edited SQLTypeDef to validate changes // Constructor public AdvancedAttributeForm(SQLTypeDef typeDef) { InitializeComponent(); tdRef = typeDef; tdCng = SQLTypeDefFactory.getCopy(typeDef); }