Freigeben über


IVsTrackProjectDocumentsEvents2 Interface

Definition

Notifies clients of changes made to project files or directories.

public interface class IVsTrackProjectDocumentsEvents2
public interface class IVsTrackProjectDocumentsEvents2
__interface IVsTrackProjectDocumentsEvents2
[System.Runtime.InteropServices.Guid("53544C4D-663D-11D3-A60D-005004775AB1")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsTrackProjectDocumentsEvents2
[System.Runtime.InteropServices.Guid("53544C4D-663D-11D3-A60D-005004775AB1")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsTrackProjectDocumentsEvents2
[<System.Runtime.InteropServices.Guid("53544C4D-663D-11D3-A60D-005004775AB1")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsTrackProjectDocumentsEvents2 = interface
[<System.Runtime.InteropServices.Guid("53544C4D-663D-11D3-A60D-005004775AB1")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsTrackProjectDocumentsEvents2 = interface
Public Interface IVsTrackProjectDocumentsEvents2
Derived
Attributes

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.

Methods

OnAfterAddDirectoriesEx(Int32, Int32, IVsProject[], Int32[], String[], VSADDDIRECTORYFLAGS[])

This method notifies the client after directories are added to the project.

OnAfterAddFilesEx(Int32, Int32, IVsProject[], Int32[], String[], VSADDFILEFLAGS[])

This method notifies the client after a project has added files.

OnAfterRemoveDirectories(Int32, Int32, IVsProject[], Int32[], String[], VSREMOVEDIRECTORYFLAGS[])

This method notifies the client when directories have been removed from the project.

OnAfterRemoveFiles(Int32, Int32, IVsProject[], Int32[], String[], VSREMOVEFILEFLAGS[])

This method notifies the client after files are removed from the project.

OnAfterRenameDirectories(Int32, Int32, IVsProject[], Int32[], String[], String[], VSRENAMEDIRECTORYFLAGS[])

This method notifies the client when directories have been renamed in the project.

OnAfterRenameFiles(Int32, Int32, IVsProject[], Int32[], String[], String[], VSRENAMEFILEFLAGS[])

This method notifies the client when files have been renamed in the project.

OnAfterSccStatusChanged(Int32, Int32, IVsProject[], Int32[], String[], UInt32[])

This method notifies the client when source control status has changed.

OnQueryAddDirectories(IVsProject, Int32, String[], VSQUERYADDDIRECTORYFLAGS[], VSQUERYADDDIRECTORYRESULTS[], VSQUERYADDDIRECTORYRESULTS[])

This method notifies the client when a project has requested to add directories.

OnQueryAddFiles(IVsProject, Int32, String[], VSQUERYADDFILEFLAGS[], VSQUERYADDFILERESULTS[], VSQUERYADDFILERESULTS[])

This method notifies the client when a project has requested to add files.

OnQueryRemoveDirectories(IVsProject, Int32, String[], VSQUERYREMOVEDIRECTORYFLAGS[], VSQUERYREMOVEDIRECTORYRESULTS[], VSQUERYREMOVEDIRECTORYRESULTS[])

This method notifies the client when a project has requested to remove directories.

OnQueryRemoveFiles(IVsProject, Int32, String[], VSQUERYREMOVEFILEFLAGS[], VSQUERYREMOVEFILERESULTS[], VSQUERYREMOVEFILERESULTS[])

This method notifies the client when a project has requested to remove files.

OnQueryRenameDirectories(IVsProject, Int32, String[], String[], VSQUERYRENAMEDIRECTORYFLAGS[], VSQUERYRENAMEDIRECTORYRESULTS[], VSQUERYRENAMEDIRECTORYRESULTS[])

This method notifies the client when a project has requested to rename directories.

OnQueryRenameFiles(IVsProject, Int32, String[], String[], VSQUERYRENAMEFILEFLAGS[], VSQUERYRENAMEFILERESULTS[], VSQUERYRENAMEFILERESULTS[])

This method notifies the client when a project has requested to rename files.

Applies to