예제 #1
0
    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();
        }
    }
예제 #2
0
 public void Destroy(IFieldable item)
 {
     item.ShowSelection(false);
     _itemPool.Remove(item);
 }