void Select(IFieldable toSelect, bool state, bool additive) { //Clear by click on empty space if (toSelect == null) { DeselectAll(); } else { if (additive) { if (state) { ConsumateSelection(); } else { ConsumateSelection(); } } else { //if(selected.Contains(toSelect)) if (selected.Count > 0 || !state) { DeselectAll(toSelect); } //else //{ //state = !state; //} if (state) { ConsumateSelection(); } } } void ConsumateSelection() { if (state) { selected.Add(toSelect); } else { selected.Remove(toSelect); } toSelect.ShowSelection(state); _UImanager.selectionmetric.UpdateText(); } }
public void Destroy(IFieldable item) { item.ShowSelection(false); _itemPool.Remove(item); }