public virtual void RemoveFakeItem()
 {
     if (this.HasFakeItem())
     {
         IList <TreeViewItem> rows = this.GetRows();
         int indexOfID             = TreeViewController.GetIndexOfID(rows, this.m_FakeItem.id);
         if (indexOfID != -1)
         {
             rows.RemoveAt(indexOfID);
         }
         this.m_FakeItem = null;
     }
 }
        public void OffsetSelection(int offset)
        {
            IList <TreeViewItem> rows = this.data.GetRows();

            if (rows.Count != 0)
            {
                Event.current.Use();
                int indexOfID = TreeViewController.GetIndexOfID(rows, this.state.lastClickedID);
                int num       = Mathf.Clamp(indexOfID + offset, 0, rows.Count - 1);
                this.EnsureRowIsVisible(num, true);
                this.SelectionByKey(rows[num]);
            }
        }
Esempio n. 3
0
        virtual public void RemoveFakeItem()
        {
            if (!HasFakeItem())
            {
                return;
            }

            var visibleRows = GetRows();
            int index       = TreeViewController.GetIndexOfID(visibleRows, m_FakeItem.id);

            if (index != -1)
            {
                visibleRows.RemoveAt(index);
            }
            m_FakeItem = null;
        }
        public bool IsLastClickedPartOfRows()
        {
            IList <TreeViewItem> rows = this.data.GetRows();

            return(rows.Count != 0 && TreeViewController.GetIndexOfID(rows, this.state.lastClickedID) >= 0);
        }
        public virtual bool IsRevealed(int id)
        {
            IList <TreeViewItem> rows = this.GetRows();

            return(TreeViewController.GetIndexOfID(rows, id) >= 0);
        }