ItemsCollection.RemoveItem C# (CSharp) Method

RemoveItem() protected method

protected RemoveItem ( int index ) : void
index int
return void
        protected override void RemoveItem(int index)
        {
            itemParentChanger(this[index], null);
            base.RemoveItem(index);
        }
    

Usage Example

Beispiel #1
0
    void TriggerMenuEvent(string evt, int selectedIndex)
    {
        EnsureItemsCollection();

        switch (evt)
        {
        case "Create Item":
            if (selectedIndex == 1)
            {
                selectedIndex = -1;
            }
            itemsCollection.AddNewItem();
            _simpleTreeView.Reload();
            _simpleTreeView.SetSelection(new List <int>()
            {
                itemsCollection.list.Count
            });
            this.SelectItem(itemsCollection.list.Count - 1);
            break;

        case "Delete Item":
            itemsCollection.RemoveItem(selectedIndex);
            if (itemsCollection != null && itemsCollection.list.Count > 0)
            {
                _simpleTreeView.Reload();
            }
            break;
        }
    }