private void toolStripMenuAttrsAdd_Click(object sender, EventArgs e) { var SelectedBlockType = (BlockType)listBoxBlockTypes.SelectedItem; var attrEditDialog = new AttrEdit(); attrEditDialog.InitData(SelectedBlockType, null); attrEditDialog.ShowDialog(); if (attrEditDialog.DialogResult == DialogResult.OK) { //MessageBox.Show("Ok"); listBoxAttrs.DataSource = GetBlockAttrs(SelectedBlockType.BlockTypeID); } }
private void toolStripMenuAttrsEdit_Click(object sender, EventArgs e) { var SelectedItem = (BlockAttribute)listBoxAttrs.SelectedItem; if (SelectedItem == null) { return; } var SelectedBlockType = (BlockType)listBoxBlockTypes.SelectedItem; var attrEditDialog = new AttrEdit(); attrEditDialog.InitData(SelectedBlockType, SelectedItem); attrEditDialog.ShowDialog(); if (attrEditDialog.DialogResult == DialogResult.OK) { listBoxAttrs.DataSource = GetBlockAttrs(SelectedBlockType.BlockTypeID); } }