English 中文(简体)
VS2010扩展-订阅事件
原标题:VS2010 Extensions - Subscribing to Events

我正在尝试为VS2010创建一个扩展。我才刚刚开始,我需要做的事情之一就是跟踪项目项。

在包初始化后,我想订阅一组事件。

1) Solution Opened
2) Solution Closed
3) Project Loaded
4) Project Unloaded
5) File Added
6) File Removed

我目前的主要问题是我不确定从哪里开始这些事件。我见过DTE/Solution/Project/ProjectItem接口,也见过获取它们的技术,但这些接口都没有以这种方式打开事件。

有人知道我需要去哪里才能找到这些事件吗?以及如何创建一个实例来订阅它们?

最佳回答

找到EnvDTE.SolutionEvents,它允许我所需要的。

问题回答

这篇文章讨论了创建一个新的Project模板,但可能会给您一些关于继承ProjecFactoryProjectNode类的想法。

希望有帮助!





相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Enable PHP highlights in VS 2010?

I ve heard that Visual Studio 2010 Beta 2 has support for PHP. When I load a PHP file though, it has nothing highlighted and is nothing more than a glorified text editor. Is there a way to enable it?...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

Unit Testing .NET 3.5 projects using MStest in VS2010

There s a bug/feature in Visual Studio 2010 where you can t create a unit test project with the 2.0 CLR. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483891&wa=...

热门标签