diff --git a/trunk/Solution/SolutionExplorer.cs b/trunk/Solution/SolutionExplorer.cs index 91ccd2e..9a1125c 100644 --- a/trunk/Solution/SolutionExplorer.cs +++ b/trunk/Solution/SolutionExplorer.cs @@ -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 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 {