Example #1
0
        private static String getChildren(IList list, int parentId, int depth, GetNodeString getItemString)
        {
            String result = "";

            foreach (INode node in list)
            {
                if (node.ParentId != parentId)
                {
                    continue;
                }

                String thisItemString = getItemString(node, depth);
                String childrenString = getChildren(list, node.Id, (depth + 1), getItemString);

                result += thisItemString + Environment.NewLine;
                if (strUtil.HasText(childrenString))
                {
                    result += childrenString + Environment.NewLine;
                }
            }

            return(result);
        }
Example #2
0
File: Html.cs Project: nust03/xcore
        private static String getChildren( IList list, int parentId, int depth, GetNodeString getItemString )
        {
            String result = "";

            foreach (INode node in list) {
                if (node.ParentId != parentId) continue;

                String thisItemString = getItemString( node, depth );
                String childrenString = getChildren( list, node.Id, (depth + 1), getItemString );

                result += thisItemString + Environment.NewLine;
                if (strUtil.HasText( childrenString )) result += childrenString + Environment.NewLine;
            }

            return result;
        }
Example #3
0
File: Html.cs Project: nust03/xcore
 public static String Tree( IList list, GetNodeString getItemString )
 {
     return getChildren( list, 0, 0, getItemString );
 }
Example #4
0
 public static String Tree(IList list, GetNodeString getItemString)
 {
     return(getChildren(list, 0, 0, getItemString));
 }