コード例 #1
0
        public void DeleteItem(MyTreeViewItem item)
        {
            if (item == FocusedItem)
            {
                int index = item.GetIndex();
                if (index + 1 < GetItemCount())
                {
                    FocusedItem = GetItem(index + 1);
                }
                else if (index - 1 >= 0)
                {
                    FocusedItem = GetItem(index - 1);
                }
                else
                {
                    FocusedItem = FocusedItem.Parent as MyTreeViewItem;
                }
            }

            m_body.DeleteItem(item);
        }
コード例 #2
0
        public void DeleteItem(MyTreeViewItem item)
        {
            if (item == FocusedItem)
            {
                int index = item.GetIndex();
                if (index + 1 < GetItemCount())
                {
                    FocusedItem = GetItem(index + 1);
                }
                else if (index - 1 >= 0)
                {
                    FocusedItem = GetItem(index - 1);
                }
                else
                {
                    FocusedItem = FocusedItem.Parent as MyTreeViewItem;
                }
            }

            m_body.DeleteItem(item);
        }