Trapping SourceSafe Events
Visual SourceSafe exposes events for a few basic commands to Visual SourceSafe add-ins. All commands described by events take action on an individual file, so if a User checks out a project, a separate event is generated for each file in the project.
The Before event indicates that the user is about to take an action. The After event indicates that the user just took an action.
Trapping SourceSafe events may be accomplished through the creation of a Visual SourceSafe add-in. When SourceSafe is launched, it creates an instance of your add-in and calls its Init method. This method is exposed through the IVSSEventHandler interface. To trap SourceSafe events, your managed DLL must support the IVSSEventHandler interface.
The add-in cannot tell from where the command is coming. For instance, if you discover that a file is about to be added to Visual SourceSafe, it may be coming from the Visual SourceSafe Explorer, from an integrated development environment (IDE), or even from a Visual SourceSafe add-in using the OLE Automation interface—including your own program! However, it is definitely not coming from the Visual SourceSafe command line because the Visual SourceSafe command line does not send events.
In This Section
Describes how to create and run C# project add-in for trapping events in Visual SourceSafe.