Skip to content

Commit d75f877

Browse files
committed
build tree
1 parent 0b26162 commit d75f877

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/viewers/HDSViewer/FormViewer.vb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@ Public Class FormViewer
4949
End Sub
5050

5151
Private Sub LoadTree(tree As JsonObject, group As StreamGroup)
52+
For Each dir As StreamGroup In group.dirs
53+
Dim node As New JsonObject With {
54+
.Id = dir.fileName,
55+
.JsonType = JsonType.Object,
56+
.Value = dir,
57+
.Parent = tree
58+
}
5259

60+
Call tree.Fields.Add(node)
61+
Call LoadTree(node, dir)
62+
Next
63+
64+
For Each file As StreamBlock In group.files
65+
Dim node As New JsonObject With {
66+
.Id = file.fileName,
67+
.JsonType = JsonType.Value,
68+
.Parent = tree,
69+
.Value = file
70+
}
71+
72+
Call tree.Fields.Add(node)
73+
Next
5374
End Sub
5475
End Class

0 commit comments

Comments
 (0)