本文介绍了Visual Studio 2010源代码控制自动化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好 -


 在Visual Studio 2003中我创建了一个Visual Studio加载项(使用C#),它允许我挂钩到Visual Studio事件知道何时签入文件。  


 在IDTExtensibility2接口OnConnection方法中,我为EventDTE.CommandEvents对象AfterExecute和BeforeExecute事件创建了处理程序。  在AfterExecute和BeforeExecute处理程序中,您可以知道
正在触发的事件类型。      在这些处理程序中,我可以看到什么类型的事件正在触发并执行某些操作。  在我的情况下,我想知道何时将文件检入源代码控制,我能够做一些事情,比如取消事件,
可以在BeforeExecute处理程序中完成。


 这是BeforeExecute处理程序的签名


 
public void BeforeExecute( string Guid, int ID, object CustomIn,对象 CustomOut, ref bool CancelDefault)
解决方案

Hello -

 In Visual Studio 2003  I had created a Visual Studio Add-In (using C#) which allowed me to hook into Visual Studio Events to know when a file was being checked in.   

  Within the the IDTExtensibility2 interfaces OnConnection method I created handlers for the EventDTE.CommandEvents objects AfterExecute and BeforeExecute events.  Within the AfterExecute and BeforeExecute handlers you can tell what type of event is firing.      In these handlers I could see what type of event was firing and do certain things.   In my case I wanted to know when a file was being checked into source control, and I was able to do some things, such as cancel the event, which can be done in the BeforeExecute handler.

  here is the signature for the BeforeExecute handler

   public void BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
解决方案


这篇关于Visual Studio 2010源代码控制自动化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 05:38
查看更多