Model for Source Control Packages
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
The following model represents an example of a source control implementation. In the model, you see the interfaces that you must implement and the environment services that you must call. Like all services, you actually call the methods of a particular interface that you obtain by way of the service. The names of the classes are identified to make it easier to see how source control is carried out.
Example Source Control Project
Interfaces
You can implement source control for your new project types in Visual Studio using the list of interfaces shown in the following table.
Interface | Use |
---|---|
IVsQueryEditQuerySave2 | Called by projects and editors before they save or change (dirty) files. This interface is accessed using the SVsQueryEditQuerySave service. |
IVsTrackProjectDocuments2 | Called by projects to request permission to add, remove, or rename a file or directory. This interface is also called by projects to inform the environment when an approved add, remove, or rename action is complete. It is accessed using the SVsTrackProjectDocuments service. |
IVsTrackProjectDocumentsEvents2 | Implemented by any entity that registers to be notified when projects add, rename, or remove a file or directory. To register for event notification, call AdviseTrackProjectDocumentsEvents. |
IVsSccManager2 | Called by projects to register with the source control package and to obtain information on source control status. This interface is accessed using the SVsSccManager service. |
IVsSccProject2 | Implemented by the project to respond to source control requests for information about files and to obtain the source control settings required for the project file. |