Weird RemoveInventory fix
git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@36 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
parent
90c56020d4
commit
256b113097
1 changed files with 22 additions and 14 deletions
|
@ -1992,6 +1992,28 @@ namespace LSLEditor.Solution
|
|||
return typeSL;
|
||||
}
|
||||
|
||||
private delegate void DelegateRemoveInventory(Guid guid, SecondLife.String name);
|
||||
public void RemoveInventory(Guid guid, SecondLife.String name)
|
||||
{
|
||||
if (this.treeView1.InvokeRequired)
|
||||
{
|
||||
this.treeView1.Invoke(new DelegateRemoveInventory(RemoveInventory), new object[] { guid, name });
|
||||
return;
|
||||
}
|
||||
|
||||
TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid);
|
||||
if (treeNode == null)
|
||||
return;
|
||||
TreeNode parent = treeNode.Parent;
|
||||
for (int i = 0; i < parent.Nodes.Count; ++i)
|
||||
{
|
||||
if (parent.Nodes[i].Text == name)
|
||||
{
|
||||
parent.Nodes.RemoveAt(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
private delegate string DelegateGetInventoryName(Guid guid, int type, int number);
|
||||
public string GetInventoryName(Guid guid, int type, int number)
|
||||
{
|
||||
|
@ -2185,7 +2207,6 @@ namespace LSLEditor.Solution
|
|||
return Guid.Empty; // no objects found
|
||||
}
|
||||
|
||||
|
||||
private void GetScriptsFromNode(TreeNode treeNode, List<Guid> list, bool recursive)
|
||||
{
|
||||
foreach (TreeNode tn in treeNode.Nodes)
|
||||
|
@ -2420,19 +2441,6 @@ namespace LSLEditor.Solution
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void RemoveInventoryDelegate(Guid guid, SecondLife.String name);
|
||||
public void RemoveInventory(Guid guid, SecondLife.String name)
|
||||
{
|
||||
|
||||
if (this.treeView1.InvokeRequired)
|
||||
this.treeView1.Invoke(new RemoveInventoryDelegate(RemoveInventory), new object[] { guid, name });
|
||||
|
||||
TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid);
|
||||
if (treeNode == null)
|
||||
return;
|
||||
treeNode.Remove();
|
||||
}
|
||||
}
|
||||
public class NodeSorter : System.Collections.IComparer
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue