Beispiel #1
0
        public static NoneElement Create(SelectionTree parentTree)
        {
            SelectionNode root  = CreateRoot(parentTree);
            var           child = new NoneElement(root, parentTree);

            root.ChildNodes.Add(child);
            return(child);
        }
Beispiel #2
0
        public SelectionTree(
            SortedSet <TypeItem> items,
            Type selectedType,
            Action <Type> onTypeSelected,
            int searchbarMinItemsCount,
            bool hideNoneElement)
        {
            _root           = SelectionNode.CreateRoot(this);
            _onTypeSelected = onTypeSelected;

            if (!hideNoneElement)
            {
                _noneElement = NoneElement.Create(this);
            }

            SelectionPaths = items.Select(item => item.Path).ToArray();
            FillTreeWithItems(items);
            _drawSearchbar = items.Count >= searchbarMinItemsCount;

            SetSelection(items, selectedType);
        }