public static DocNode CombineList(List <DocNode> docs) { var sb = new System.Text.StringBuilder("Combination of: ["); for (int i = 0; i < docs.Count; i++) { if (i > 0) { sb.Append(", "); } sb.Append(docs[i].SourceInformation); } sb.Append("]"); ComposedDocNode result = new ComposedDocNode(DocNodeType.List, sourceInformation: sb.ToString()); for (int i = 0; i < docs.Count; i++) { if (docs[i].Type == DocNodeType.List) // flatten file containing list { for (int j = 0; j < docs[i].Count; j++) { result.Add(docs[i][j]); } } else { result.Add(docs[i]); } } return(result); }
public static DocNode CombineList(List <DocNode> docs) { ComposedDocNode result = new ComposedDocNode(DocNodeType.List); for (int i = 0; i < docs.Count; i++) { if (docs[i].Type == DocNodeType.List) // flatten file containing list { for (int j = 0; j < docs[i].Count; j++) { result.Add(docs[i][j]); } } else { result.Add(docs[i]); } } return(result); }