Visual Studio 2010 扩展获取对解决方案资源管理器的引用
我正在将我的一个宏移至 VS2010 扩展。我有来自宏的行...
Dim items As EnvDTE.UIHierarchyItems = DTE.ToolWindows.SolutionExplorer.UIHierarchyItems
我已经设法获得 DTE - DTE dte = GetService(typeof(SDTE)) as DTE;
但它确实包含 ToolWindows 属性。
我尝试使用 dte.Windows 获取解决方案资源管理器,并且这种方法有效,但结果没有 UIHierarchyItems。
简而言之,获取解决方案资源管理器参考的最佳方式是什么?
I'm moving one of my macros over 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它位于
DTE2
上,这就是为什么你没有找到它。只需将as DTE
替换为as DTE2
即可。It's on
DTE2
, which is why you didn't find it. Just replace theas DTE
withas DTE2
.