Hello,
I'm developing source control plugin for Visual Studio 2010/2012. My work machine has Windows 7 installed on it. I've debug my development my deploying vsix content into experimental intance of Visual Studio 2012.
When plugin is activated/deactivated, it set custom glyphs to solution items for changes tracking indication. To achieve that I enumerate IVsHierarchy which is retrieved by such code:
(IVsSolution)Package.GetGlobalService(typeof(SVsSolution))
Each node glyph is refreshed as follows:
uint itemId = ... uint fileStatus = ... VsStateIcon glyph = ... var project = hierarchy as IVsSccProject2; if (project != null) project.SccGlyphChanged(1, new[] { itemId }, new[] { glyph }, new [] { fileStatus }); else hierarchy.SetProperty(itemId, (int)__VSHPROPID.VSHPROPID_StateIconIndex, glyph);Everything is fine, but recently I've encountered a problem, that can be reproduced as following:
- Start debugging of plugin (make sure that no Solution Explorer window will be displayed).
- Go to "Tools -> Options" main menu.
- Select "Source control" node in the tree to the left.
- My plugin source control is selected, then I deselect it.
- Close options dialog by OK button.
- Go to "View -> Solution Explorer" main menu.
- Solution explorer window opens and there is no custom glyphs (this is expected).
- Go to "Tools -> Options" main menu and select "Source control" node again.
- Then I select my plugin. At this time Microsoft.VisualStudio.Shell.Interop.IVsSccProvider.SetActive() call is received by my plugin and custom glyphs are assigned as was described before.
- Close options dialog.
Now I expect my custom glyphs to be displayed in Solution Explorer, but they aren't. If I mess a little with SE, expand/collapse nodes and scroll it down and forth, glyphs start appear on items.
However if hierarchy enumeration is delayed to the moment when options dialog is closed, glyphs appear as expected. But I can't figure any way to know when options dialog is closed.
Maybe someone can help me with this issue?