public static IEnumerable <GroupedTreeItem <A, D> > Index <A, B, C, D>(this GroupedTreeList <A, B, C, D> tree) where B : struct where A : class { for (var i = 0; i < tree.Count; i++) { yield return(tree[i]); } }
private GroupedTreeList <Item, int, int, int> GenerateTestTree(GroupedTreeSeparator separator) { var list = GroupedTreeList <Item> .Create( x => x.Id, x => x.ParentId, (x, y) => x == y, x => x.SortKey, (lhs, rhs) => lhs - rhs, x => x.GroupKey, (lhs, rhs) => lhs == rhs, new[] { 0, 1, 2, 3, 4 }, separator); foreach (var item in GenerateTestItems()) { list.Upsert(item); } return(list); }
private static List <GroupedTreeItem <Item, int> > CreateAutoDispatchedList(GroupedTreeList <Item, int, int, int> tree) { return(TreeTests.CreateAutoDispatchedList <GroupedTreeItem <Item, int>, GroupedTreeList <Item, int, int, int> >(tree)); }