public void refreshTargets() { menu_target.DropDownItems.Clear(); menu_target.DropDownItems.Add(new ToolStripMenuItem("Add target...",null,menu_target_add_Click,"menu_target_add")); menu_target.DropDownItems.Add(new ToolStripSeparator()); foreach (nodeTarget nt in targets) { targetItem ti = new targetItem(nt); menu_target.DropDownItems.Add(ti); ti.Click += new EventHandler(targetItem_Click); ti.DoubleClick += new EventHandler(ti_DoubleClick); ti.Checked = ti.getNodeTarget().Equals(currentTarget); targetItemDelete tidel = new targetItemDelete(ti); tidel.Click += new EventHandler(tidel_Click); ti.DropDownItems.Add(tidel); } }
public targetItemDelete(targetItem ti) { this.ti = ti; }