Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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)
[InterfaceTypeAttribute()]
[GuidAttribute("53544C4D-663D-11D3-A60D-005004775AB1")]
public interface IVsTrackProjectDocumentsEvents2

The IVsTrackProjectDocumentsEvents2 type exposes the following members.

  NameDescription
Public methodOnAfterAddDirectoriesExThis method notifies the client after directories are added to the project.
Public methodOnAfterAddFilesExThis method notifies the client after a project has added files.
Public methodOnAfterRemoveDirectoriesThis method notifies the client when directories have been removed from the project.
Public methodOnAfterRemoveFilesThis method notifies the client after files are removed from the project.
Public methodOnAfterRenameDirectoriesThis method notifies the client when directories have been renamed in the project.
Public methodOnAfterRenameFilesThis method notifies the client when files have been renamed in the project.
Public methodOnAfterSccStatusChangedThis method notifies the client when source control status has changed.
Public methodOnQueryAddDirectoriesThis method notifies the client when a project has requested to add directories.
Public methodOnQueryAddFilesThis method notifies the client when a project has requested to add files.
Public methodOnQueryRemoveDirectoriesThis method notifies the client when a project has requested to remove directories.
Public methodOnQueryRemoveFilesThis method notifies the client when a project has requested to remove files.
Public methodOnQueryRenameDirectoriesThis method notifies the client when a project has requested to rename directories.
Public methodOnQueryRenameFilesThis method notifies the client when a project has requested to rename files.
Top

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.

Show:
© 2014 Microsoft. All rights reserved.