如何为调试器事件注册我的Visual Studio Addin?

时间:2014-04-10 08:09:02

标签: debugging events build visual-studio-2013 add-in

我正在编写一个Visual Studio 2013插件(在C#中),我想注册一个事件,当用户构建他的项目时通知我。我怎么做? 有_dispBuildEvents_OnBuildBeginEventHandler OnBuildBegin,我该如何注册呢?

1 个答案:

答案 0 :(得分:0)

events = DTE.Events
buildEvents = events.BuildEvents
buildEvents.OnBuildBegin += MyHandler;

private EnvDTE.Events events;
private EnvDTE.BuildEvents buildEvents;