Visual Studio 2010 extension get reference to solution explorer
I'm moving one of my macros over 开发者_Python百科to become a VS2010 extension. I have the line from the macro...
Dim items As EnvDTE.UIHierarchyItems = DTE.ToolWindows.SolutionExplorer.UIHierarchyItems
I've managed to get DTE - DTE dte = GetService(typeof(SDTE)) as DTE;
but it does contain a ToolWindows Property.
I tried using dte.Windows to get the solution explorer, and that sort of works, but the result doesn't have a UIHierarchyItems.
So in short, what's the best way to get a reference to the solution explorer?
It's on DTE2
, which is why you didn't find it. Just replace the as DTE
with as DTE2
.
精彩评论