Esempio n. 1
0
        public FieldSelectorTree GenerateFullFieldSelectorTree(Int32 maximumDeep)
        {
            var result = new FieldSelectorTree();

            var childParts = this.GenerateChildTreeFromProperties(typeof(TRoot).GetProperties(), 0, maximumDeep);

            foreach (var childPart in childParts)
            {
                result.AddPart(childPart);
            }

            return(result);
        }
Esempio n. 2
0
        private FieldSelectorTree MergeRootParts([NotNull] IEnumerable <FieldSelectorTree> rootParts)
        {
            if (rootParts == null)
            {
                throw new ArgumentNullException(nameof(rootParts));
            }

            var result = new FieldSelectorTree();

            foreach (var firstLevel in rootParts.SelectMany(m => m.ChildParts).GroupBy(m => m.PartName))
            {
                var childgroup = new FieldSelectorPart(firstLevel.Key);
                foreach (var part in this.MergeChildPart(firstLevel.SelectMany(m => m.ChildParts).GroupBy(m => m.PartName)))
                {
                    childgroup.AddPart(part);
                }

                result.AddPart(childgroup);
            }

            return(result);
        }