Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created August 11, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/cb316cde5055cc6d7dc9668513473005 to your computer and use it in GitHub Desktop.
Save bjoerntx/cb316cde5055cc6d7dc9668513473005 to your computer and use it in GitHub Desktop.
private void addBlockToTreeView(List<MergeBlock> blocks, TreeNode node)
{
foreach (MergeBlock block in blocks)
{
TreeNode curNode;
if (node == null)
curNode = treeView1.Nodes.Add(block.Name);
else
curNode = node.Nodes.Add(block.Name);
foreach (MergeField field in block.MergeFields)
{
curNode.Nodes.Add(field.Name);
}
if (block.MergeBlocks != null)
addBlockToTreeView(block.MergeBlocks, curNode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment