IVsTrackProjectDocumentsEvents2 Interface
Notifies clients of changes made to project files or directories.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("53544C4D-663D-11D3-A60D-005004775AB1")> _
Public Interface IVsTrackProjectDocumentsEvents2
[InterfaceTypeAttribute()]
[GuidAttribute("53544C4D-663D-11D3-A60D-005004775AB1")]
public interface IVsTrackProjectDocumentsEvents2
[InterfaceTypeAttribute()]
[GuidAttribute(L"53544C4D-663D-11D3-A60D-005004775AB1")]
public interface class IVsTrackProjectDocumentsEvents2
[<InterfaceTypeAttribute()>]
[<GuidAttribute("53544C4D-663D-11D3-A60D-005004775AB1")>]
type IVsTrackProjectDocumentsEvents2 = interface end
public interface IVsTrackProjectDocumentsEvents2
The IVsTrackProjectDocumentsEvents2 type exposes the following members.
Methods
Name | Description | |
---|---|---|
OnAfterAddDirectoriesEx | This method notifies the client after directories are added to the project. | |
OnAfterAddFilesEx | This method notifies the client after a project has added files. | |
OnAfterRemoveDirectories | This method notifies the client when directories have been removed from the project. | |
OnAfterRemoveFiles | This method notifies the client after files are removed from the project. | |
OnAfterRenameDirectories | This method notifies the client when directories have been renamed in the project. | |
OnAfterRenameFiles | This method notifies the client when files have been renamed in the project. | |
OnAfterSccStatusChanged | This method notifies the client when source control status has changed. | |
OnQueryAddDirectories | This method notifies the client when a project has requested to add directories. | |
OnQueryAddFiles | This method notifies the client when a project has requested to add files. | |
OnQueryRemoveDirectories | This method notifies the client when a project has requested to remove directories. | |
OnQueryRemoveFiles | This method notifies the client when a project has requested to remove files. | |
OnQueryRenameDirectories | This method notifies the client when a project has requested to rename directories. | |
OnQueryRenameFiles | This method notifies the client when a project has requested to rename files. |
Top
Remarks
When you subscribe to the IVsTrackProjectDocumentEvents2 events, you will receive event notification for all projects. Generally, you will not receive batched notification of these events unless two projects coordinate, as in the case of a nested project and the parent project.
Before adding, renaming, or deleting a file or directory, each project must call the appropriate OnQuery* method from IVsTrackProjectDocuments2 to check whether the operation is allowed. After the operation is completed, the project must then notify the OnAfter* method in IVsTrackProjectDocuments2. The environment sends out the appropriate event notifications after each call.
The parameters in the methods of IVsTrackProjectDocumentEvents2 generally consist of:
The relevant IVsProject2, or the array of IVsProject2 pointers.
Flags regarding the operation taking place.
An array of documents sorted by project. If there is only one project, then the ordering of files does not matter. If there is more than one project, the files must be grouped by their associated projects.
An array of first indices. These indices relate the array of projects to the array of documents. There is one first index for each project, which points to the first file in the array of documents that is controlled by that project. Since the array of documents is sorted by projects, all of the indices greater than one first index and less than the next first index belong to a given project. For example:
Projects |
Indices |
Documents |
---|---|---|
Visual Basic |
0 |
0) a 1) b 2) c 3) d 4) |
Visual C++ |
5 |
5) f 6) g 7) h |
Visual C# |
8 |
8) i 9) j 10) k 11) l |
In this case:
Documents a, b, c, d, e (indices 0–4) belong to the Visual Basic Project.
Documents f, g, h (indices 5–7) belong to the Visual C++ Project.
Documents i, j, k, l (indices 8 and above) belong to the Visual C# Project.
Notes to Implementers
A source control package implements this interface if it needs to track changes in a project, such as when files or directories are added, removed, or renamed. It is recommended that this interface be implemented; otherwise, the user may need to manually refresh the source control display to see any changes in status.
Notes to Callers
Called by the environment in response to the addition, removal, or renaming of files or directories in a project.