private void lstProperty_SelectedIndexChanged(object sender, EventArgs e) { PropertyDesigner property = this.lstProperty.SelectedItem as PropertyDesigner; bool selected = property != null; this.btnDeleteProperty.Enabled = selected; }
private void btnDeleteProperty_Click(object sender, EventArgs e) { PropertyDesigner property = this.lstProperty.SelectedItem as PropertyDesigner; TableDesigner table = this.lstTable.SelectedItem as TableDesigner; this.lstProperty.Items.Remove(property); table.PropertyDesignerList.Remove(property); }
private void btnAddProperty_Click(object sender, EventArgs e) { FormAddProperty frmAddProperty = new FormAddProperty(); if (frmAddProperty.ShowDialog() == System.Windows.Forms.DialogResult.OK) { PropertyDesigner propertyDesigner = frmAddProperty.NewPropertyDesigner; TableDesigner table = this.lstTable.SelectedItem as TableDesigner; table.PropertyDesignerList.Add(propertyDesigner); this.lstProperty.Items.Add(propertyDesigner); } }
public FormAddProperty() { InitializeComponent(); this.NewPropertyDesigner = new PropertyDesigner(); }