Fix creating new instances of files breaking tree
This commit is contained in:
parent
8961c8e592
commit
db2f7e70bd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -43,18 +43,28 @@ namespace Switch_Toolbox.Library.Forms
|
|||||||
|
|
||||||
public void AddNode(TreeNode node, bool ClearAllNodes = false)
|
public void AddNode(TreeNode node, bool ClearAllNodes = false)
|
||||||
{
|
{
|
||||||
// Invoke the treeview to add the nodes
|
if (treeViewCustom1.InvokeRequired)
|
||||||
treeViewCustom1.Invoke((Action)delegate ()
|
|
||||||
{
|
{
|
||||||
treeViewCustom1.BeginUpdate(); // No visual updates until we say
|
// Invoke the treeview to add the nodes
|
||||||
// if (ClearAllNodes)
|
treeViewCustom1.Invoke((Action)delegate ()
|
||||||
// ClearNodes();
|
{
|
||||||
|
AddNodes(node, ClearAllNodes);
|
||||||
treeViewCustom1.EndUpdate(); // Allow the treeview to update visually
|
});
|
||||||
});
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddNodes(node, ClearAllNodes);
|
||||||
|
}
|
||||||
|
// _fieldsTreeCache.Nodes.Add(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddNodes(TreeNode node, bool ClearAllNodes = false)
|
||||||
|
{
|
||||||
|
treeViewCustom1.BeginUpdate(); // No visual updates until we say
|
||||||
|
if (ClearAllNodes)
|
||||||
|
ClearNodes();
|
||||||
treeViewCustom1.Nodes.Add(node); // Add the new nodes
|
treeViewCustom1.Nodes.Add(node); // Add the new nodes
|
||||||
// _fieldsTreeCache.Nodes.Add(node);
|
treeViewCustom1.EndUpdate(); // Allow the treeview to update visually
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearNodes()
|
public void ClearNodes()
|
||||||
|
Loading…
Reference in New Issue
Block a user