Edit node item (or Refresh)

Aug 19, 2009 at 3:22 PM

Excellent code for creating SSMS addin, thanks!

Do you know of any way to either:

Edit a node name in Object Explorer and respond to the Edited event.

or (less ideal)

Refresh the node.Parent in code.

Thanks so much in advance

Aug 20, 2009 at 7:50 AM

I ended up (for now) with this lame solution:

 private void RefreshTree()
        {
            INodeInformation[] nodes;
            int nodeCount;

            IObjectExplorerService objectExplorer = ServiceCache.GetObjectExplorer();
            objectExplorer.GetSelectedNodes(out nodeCount, out nodes);
            INodeInformation node = (nodeCount > 0 ? nodes[0] : null);
            if (node != null)
            {
                objectExplorer.SynchronizeTree(node.Parent);
                SendKeys.Send("{F5}");
            }
        }