private TreeNode addNodes(BrowserNode node, BrowserNode defaultNode) { TreeNode treeNode = new TreeNode(node.Text); treeNode.ImageResource = node.IconName; treeNode.UserData = node; if (node == defaultNode) { browserTree.SelectedNode = treeNode; } foreach (BrowserNode child in node.getChildIterator()) { treeNode.Children.add(addNodes(child, defaultNode)); } return(treeNode); }
private void addNodes(BrowserNode node, BrowserNode defaultNode) { if (node.Value != null) { ButtonGridItem item = imageGrid.addItem("", node.Text); item.UserObject = node.Value; imageManager.loadThumbnail(node.Value.ToString(), FullImageWidth, FullImageHeight, (imageKey, size) => { item.setImage(imageKey); item.setImageSize(size.Width, size.Height, FullImageWidth + Inflation, FullImageHeight + Inflation); }); if (node == defaultNode) { imageGrid.SelectedItem = item; } } foreach (BrowserNode child in node.getChildIterator()) { addNodes(child, defaultNode); } }