通过CodeModel获取部分类的ProjectItems
我已经看到寻找一种方法来获取已知类的 ProjectItems(文件)列表,该类是从几个部分类生成的。我使用 CodeModel 来搜索类并访问 ProjectItem 来执行操作,这对于普通类来说效果很好。但是,当涉及到分部类时,ProjectItem 属性会提供一个文件,但不提供构成该分部类的其他文件。 如何通过部分类访问构成该类的其他 ProjectItems
I have seen looking for a way to get the list of ProjectItems (files) for a known class, which generated from several partial classes. I use CodeModel to search for a class and accessing the ProjectItem to do stuff, which works fine for normal classes. But when it comes to partial classes, the ProjectItem property give one file but dont provide the other files which make this partial class.
How can I access the other ProjectItems that make up the class , through partial classes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来原始发帖者确实在 MSDN 论坛。也将其链接回此处以供参考。
Looks like the original poster did find the answer to the question on the MSDN Forum. Linking it back here as well for reference.
你是递归地这样做吗?如果您只查询 EnvDTE.Project.ProjectItems,您将仅获得第一级的项目项,您还必须查询 EnvDTE.ProjectItem.ProjectItems。
Are you doing so recursively? If you just query EnvDTE.Project.ProjectItems you'll get only the project items at the first level, you'll have to EnvDTE.ProjectItem.ProjectItems as well.