Example #1
0
        public TreeListEx()
        {
            InitializeComponent();

            _items           = new TreeListViewItemCollection(this);
            base.MultiSelect = false;
        }
 /// <summary>
 /// Adds a collection to this collection
 /// </summary>
 /// <param name="collection"></param>
 public void AddRange(TreeListViewItemCollection collection)
 {
     collection.ReadWriteLock.AcquireReaderLock(-1);
     foreach (TreeListViewItem item in collection)
     {
         Add(item);
     }
     collection.ReadWriteLock.ReleaseReaderLock();
 }
Example #3
0
        /// <summary>
        /// Remove this item from its associated collection
        /// </summary>
        public new void Remove()
        {
            TreeListViewItemCollection collection = Container;

            if (collection != null)
            {
                collection.Remove(this);
            }
        }
Example #4
0
        /// <summary>
        /// Check if this node is one of the parents of an item (recursively)
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool IsAParentOf(TreeListViewItem item)
        {
            TreeListViewItemCollection parents = item.ParentsInHierarch;

            foreach (TreeListViewItem parent in parents)
            {
                if (parent == this)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #5
0
 /// <summary>
 /// Create a new instance of a TreeListViewItem
 /// </summary>
 public TreeListViewItem()
 {
     _items = new TreeListViewItemCollection(this);
 }