Exemplo n.º 1
0
        public IEnumerable <ITreeNode> GetDisplayTreeNodes(string id)
        {
            ITreeNode node = GetTreeNode(id);

            if (node == null)
            {
                return(RootNodes);
            }

            IParamBuilder builder = TreeUtil.GetValueBuilder(fSelector, fDefinition,
                                                             TopLevel, node.Convert <NormalDataRowTreeNode>());

            builder = GetCustomParamBuilder(builder);
            if (builder == null)
            {
                return(Enumerable.Empty <ITreeNode>());
            }
            //IParamBuilder customSql = fTreeProvider.CustomSql;
            //if (builder == null && customSql == null)
            //    return TreeUtil.CreateEmptyEnumerable();
            //if (customSql != null)
            //    builder = builder == null ? customSql : SqlParamBuilder.CreateParamBuilder(builder, customSql);
            var data = TreeUtil.SelectData(fSelector, this, () => fSelector.Select(builder, fOrder), id);

            return(TreeUtil.GetDisplayTreeNodes(data, id));
        }
Exemplo n.º 2
0
 private void SetTopLevel(ITreeNode node)
 {
     fTopLevel = (node == null) ? 0 : node.Convert <NormalDataRowTreeNode>().Layer.Length / 3;
 }