private void AddItem() { if (NameText.Text != "" && !((Form1)Form.ActiveForm).ContainsName(NameText.Text)) { EntityItem entityItem = new EntityItem(this); ((Label)entityItem.Controls.Find("EntityName", true)[0]).Text = NameText.Text; AddEntityItem(entityItem); ((Form1)Form.ActiveForm).AddEntity(entityItem); } }
public void SelectItem(EntityItem item) { if (ModifierKeys.HasFlag(Keys.Shift)) { item.BackColor = selectedColor; selected.Add(item); } else { foreach (EntityItem i in selected.ToList()) { i.BackColor = unselectedColor; selected.Remove(i); } selected.Add(item); selected[0].BackColor = selectedColor; } }
public void RemoveEntity(EntityItem entityItem) { entities.Remove(entities.Find(o => o.name == ((Label)entityItem.Controls.Find("EntityName", true)[0]).Text)); }
public void AddEntity(EntityItem entityItem) { entities.Add(new Entity(((Label)entityItem.Controls.Find("EntityName", true)[0]).Text)); }
public void AddEntityItem(EntityItem item) { Controls.Find("EntityList", true)[0].Controls.Add(item); }