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(); }
/// <summary> /// Remove this item from its associated collection /// </summary> public new void Remove() { TreeListViewItemCollection collection = Container; if (collection != null) { collection.Remove(this); } }
/// <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); }
/// <summary> /// Create a new instance of a TreeListViewItem /// </summary> public TreeListViewItem() { _items = new TreeListViewItemCollection(this); }