Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

IVsTrackProjectDocuments2.BeginBatch Method

This method starts a batch of IVsTrackProjectDocuments2.OnAfter* method calls.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int BeginBatch ()
int BeginBatch ()
function BeginBatch () : int

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From IVsTrackProjectDocuments2.idl

HRESULT BeginBatch();

The IVsTrackProjectDocuments2 interface allows projects to tell the environment when a project item has been added, removed, or renamed. During these operations, user interface (UI) is sometimes displayed. IVsTrackProjectDocuments2.BeginBatch informs the environment that you are going to call several IVsTrackProjectDocuments2.OnAfter* methods, and that you would like the user to receive only one UI display for those calls. Grouping these calls using IVsTrackProjectDocuments2.BeginBatch and EndBatch increases the likelihood that the environment will display only one UI display; however, this is not guaranteed.

Call IVsTrackProjectDocuments2.BeginBatch to start the batch, make multiple IVsTrackProjectDocuments2 calls, and then call EndBatch to display the UI.


You can batch only OnAfter* methods. OnQuery* methods cannot be batched.

Community Additions

© 2015 Microsoft