private void listView1_DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 1) { return; } //Console.WriteLine($"Current Cluster Node: {currentClusterNode.Text}"); NodeTag nodeTag = (NodeTag)listView1.SelectedItems[0].Tag; switch (nodeTag.Type) { case NodeType.Dirent: DatabaseFile databaseFile = nodeTag.Tag as DatabaseFile; if (databaseFile.IsDirectory()) { PopulateListView(databaseFile.Children, databaseFile.GetParent()); } break; case NodeType.Cluster: List <DatabaseFile> dirents = nodeTag.Tag as List <DatabaseFile>; PopulateListView(dirents, null); break; } }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { currentClusterNode = e.Node; while (currentClusterNode.Parent != null) { currentClusterNode = currentClusterNode.Parent; } //Console.WriteLine($"Current Cluster Node: {currentClusterNode.Text}"); NodeTag nodeTag = (NodeTag)e.Node.Tag; switch (nodeTag.Type) { case NodeType.Cluster: List <DatabaseFile> dirents = (List <DatabaseFile>)nodeTag.Tag; PopulateListView(dirents, null); break; case NodeType.Dirent: DatabaseFile databaseFile = (DatabaseFile)nodeTag.Tag; PopulateListView(databaseFile.Children, databaseFile.GetParent()); break; } }