Example #1
0
 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);
     }
 }
Example #2
0
 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;
     }
 }
Example #3
0
 public void RemoveEntity(EntityItem entityItem)
 {
     entities.Remove(entities.Find(o => o.name == ((Label)entityItem.Controls.Find("EntityName", true)[0]).Text));
 }
Example #4
0
 public void AddEntity(EntityItem entityItem)
 {
     entities.Add(new Entity(((Label)entityItem.Controls.Find("EntityName", true)[0]).Text));
 }
Example #5
0
 public void AddEntityItem(EntityItem item)
 {
     Controls.Find("EntityList", true)[0].Controls.Add(item);
 }