private void _tvFileSystem_DoubleClick(object sender, EventArgs e) { GHFileSystemNode node = _tvFileSystem.SelectedNode.Tag as GHFileSystemNode; if (node != null) { new FileViewerForm(node.Content).Show(); } }
public static void AddToTreeNodeCollection(this GHFileSystemNode node, TreeNodeCollection treeNodeCollection) { treeNodeCollection.Add(node.Name); treeNodeCollection[treeNodeCollection.Count - 1].Tag = node; if (!string.IsNullOrWhiteSpace(node.Content)) { treeNodeCollection[treeNodeCollection.Count - 1].BackColor = Color.Aqua; } treeNodeCollection = treeNodeCollection[treeNodeCollection.Count - 1].Nodes; foreach (var child in node.Children) { child.Value.AddToTreeNodeCollection(treeNodeCollection); } }