Udostępnij za pośrednictwem


IVsTrackProjectDocuments3 Interface

Definition

This interface allows for batch processing, coordination of locks on files, and an advanced OnQueryAddFiles(IVsProject, Int32, String[], VSQUERYADDFILEFLAGS[], VSQUERYADDFILERESULTS[], VSQUERYADDFILERESULTS[]) method.

public interface class IVsTrackProjectDocuments3
public interface class IVsTrackProjectDocuments3
__interface IVsTrackProjectDocuments3
[System.Runtime.InteropServices.Guid("53544C4D-9097-4325-9270-754EB85A6351")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsTrackProjectDocuments3
[<System.Runtime.InteropServices.Guid("53544C4D-9097-4325-9270-754EB85A6351")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsTrackProjectDocuments3 = interface
Public Interface IVsTrackProjectDocuments3
Attributes

Remarks

The advanced version of the OnQueryAddFiles method supports projects that copy files to new locations within the project directory after extraction from source control.

The batch process methods must be balanced; that is, every call to the BeginQueryBatch method must be matched with a call to the EndQueryBatch method or the CancelQueryBatch method. The batch process methods are used so that the user is presented with a single dialog box concerning the operation on all the files instead of multiple dialog boxes, one for each file. If any query says it is not okay to continue the operation, the CancelQueryBatch should be called to cancel the entire batch operation. Otherwise, if all queries indicate it is okay to continue, the EndQueryBatch method should be called. For example:

BOOL fRenameCanCont = FALSE;  
pTrackProjectDocuments3->BeginQueryBatch();  
QueryFolderRename(pFolderNode, strOldPath, strNewPath, &fRenameCanCont);  
if (fRenameCanCont)  
   pTrackProjectDocuments3->EndQueryBatch(&fRenameCanCont);  
else  
   pTrackProjectDocuments3->CancelQueryBatch();  
bool fRenameCanCont = false;  
pTrackProjectDocuments3.BeginQueryBatch();  
QueryFolderRename(pFolderNode, strOldPath, strNewPath, fRenameCanCont);  
if (fRenameCanCont)  
   pTrackProjectDocuments3.EndQueryBatch(&fRenameCanCont);  
else  
   pTrackProjectDocuments3.CancelQueryBatch();  

In this example, QueryFolderRename is assumed to be a user-defined helper function that causes a series of events to repeatedly call the OnQueryRenameFile method.

Notes to Implementers

This interface is implemented by Visual Studio source control package. Visual Studio routes calls to this interface to the currently active source control package if that package implements the IVsTrackProjectDocumentsEvents3 interface.


This interface is not derived from the IVsTrackProjectDocuments2 interface, although it is normally implemented on the same object. The IVsTrackProjectDocuments3 interface can be obtained by asking for it from the SVsTrackProjectDocuments service.

Notes to Callers

This interface provides a batch-processing mechanism that allows multiple accesses to a source control system without needing to provide a prompt for each individual file. In addition, this interface synchronizes read/write access to files and provides an extension to the OnQueryAddFiles(IVsProject, Int32, String[], VSQUERYADDFILEFLAGS[], VSQUERYADDFILERESULTS[], VSQUERYADDFILERESULTS[]) method.

Methods

BeginQueryBatch()

Starts a batch query process in which a single dialog box asking the user for an okay is presented instead of multiple dialog boxes, one for each file.

CancelQueryBatch()

Cancels a batched series of queries.

EndQueryBatch(Int32)

Indicates that a batched query process has been completed and determines whether or not the batched operations should be allowed to proceed.

HandsOffFiles(UInt32, Int32, String[])

This method is called when a project wants to affect a number of files and wants any locks on those files released.

HandsOnFiles(Int32, String[])

Indicates that a project is done manipulating the specified files.

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

This method is an extended version of the OnQueryAddFiles(IVsProject, Int32, String[], VSQUERYADDFILEFLAGS[], VSQUERYADDFILERESULTS[], VSQUERYADDFILERESULTS[]) method and is used when a project will be moving files to a new location in the project directory.

Applies to