BulkFileOperation Class

Definition

BulkFileOperation provides functionality to safely perform operations with bulk of files, currently opened in the solution. One of the example is SCC. Before operation consumer should provide estimated set of files and folders where changes are expected. This class takes care about "hands-off" logic for all these files. Once operation done BulkFileOperation does all neccessary job for "hands-on" logic and make a decision on what to reload (project/solution/nothing). Order of operations is the following: QueryBulkFileOperationAsync BeginAsync (optional) EndAsync (optional, but BeginAsync is required to complete before this) Dispose This API is very strict to inappropriate usage, for example calling EndAsync without waiting for BeginAsync is done, or calling the same method twice and so on. In this case exception will be thrown.

public ref class BulkFileOperation : Microsoft::VisualStudio::PlatformUI::DisposableObject
public ref class BulkFileOperation : Microsoft::VisualStudio::PlatformUI::DisposableObject, Microsoft::Internal::VisualStudio::Shell::Interop::IVsSolutionReloadBatchHandler
public class BulkFileOperation : Microsoft.VisualStudio.PlatformUI.DisposableObject
public class BulkFileOperation : Microsoft.VisualStudio.PlatformUI.DisposableObject, Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler, Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler2
type BulkFileOperation = class
    inherit DisposableObject
type BulkFileOperation = class
    inherit DisposableObject
    interface IVsSolutionReloadBatchHandler2
    interface IVsSolutionReloadBatchHandler
Public Class BulkFileOperation
Inherits DisposableObject
Public Class BulkFileOperation
Inherits DisposableObject
Implements IVsSolutionReloadBatchHandler, IVsSolutionReloadBatchHandler2
Inheritance
BulkFileOperation
Implements
Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler2

Properties

IsDisposed

Returns whether the object has been disposed once, protects against double disposal

(Inherited from DisposableObject)
IsInProgress

Gets indication whether some BulkFileOperation is in progress right now. It would be useful in several cases:

  • to avoid getting exception if you want to run new BulkFileOperation;
  • to not lost current context, when subscibes on Begin/End events.
IsSynchronousUpdateNeeded

Gets value whether synchronous update will be needed after bulk file operation is done.

ProjectsToReload

Gets list of the full path to the project files which will have to be reloaded/updated with requested bulk file operation.

TelemetryInfo

Get information about statistics for the current BulkFileOperation. It is possible to attach it to the event and have additional information about timings and counts.

UnsavedFiles

The subset of document file paths which are currently in use.

Methods

BeginAsync(CancellationToken)

Start bulk file operation based on the previous QueryBulkFileOperationAsync method.

Dispose()

Disposes the current object then suppresses further finalization.

(Inherited from DisposableObject)
Dispose(Boolean)

Standard virtual overload for IDisposable pattern

(Inherited from DisposableObject)
DisposeManagedResources()

There is no protection from calling this method while other methods are in progress. For example, if BeginAsync is in progress and customer calls Dispose() it will silently dispose resources and moves object to Disposed state.

DisposeNativeResources()

Allows derived classes to provide custom dispose handling for native resources

(Inherited from DisposableObject)
EndAsync()

Completes bulk file operation. Makes necessary decisions on what to reload (project/solution/nothing). Does all hands-on logic and adds files/folders on track. This method is not cancellable, because otherwise system will be in unknown state:

  • some files were handed-on, some not;
  • if projects/solution file were updated, and solution were not reloaded, which is the bad UX experience.
QueryBulkFileOperationAsync(IEnumerable<String>, IEnumerable<String>, CancellationToken)

Start bulk file operation. This method is called by customer prior start some bulk file operation, for example git checkout.

ThrowIfDisposed()

Throws an ObjectDisposedException if this object has been disposed

(Inherited from DisposableObject)

Events

BeforeFlushPendingFileChangeNotification

Sends BeforeFlushPendingFileChangeNotification signal when BulkFileOperation ends before we resume FileChange service.

Begin

Sends Begin signal when BulkFileOperation begin and we processed all pending FileChange service signals and pause it.

Disposing

Raised when the event is being disposed, while it is still accessible.

(Inherited from DisposableObject)
End

Sends End signal when BulkFileOperation ends at the very end.

Explicit Interface Implementations

IVsSolutionReloadBatchHandler.CanCommitBatch(IVsSolutionReloadBatch, UInt32, UInt32, UInt32) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanCommitBatch(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.UInt32,System.UInt32@)
IVsSolutionReloadBatchHandler.CanCommitBatchUI(IVsSolutionReloadBatch, UInt32, UInt32, UInt32) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanCommitBatchUI(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.UInt32,System.UInt32@)
IVsSolutionReloadBatchHandler.CanGiveControl(IVsSolutionReloadBatchHandler) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanGiveControl(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler.CanJoin(IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler.CanTakeControl(IVsSolutionReloadBatchHandler) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanTakeControl(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler.ExecuteReloadUI(IVsSolutionReloadBatch, UInt32, Guid[], UInt32[]) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.ExecuteReloadUI(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.Guid[],System.UInt32[])
IVsSolutionReloadBatchHandler.HandlerId Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.HandlerId
IVsSolutionReloadBatchHandler2.CanCommitBatch(IVsSolutionReloadBatch, UInt32, UInt32, UInt32) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanCommitBatch(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.UInt32,System.UInt32@)
IVsSolutionReloadBatchHandler2.CanCommitBatchUI(IVsSolutionReloadBatch, UInt32, UInt32, UInt32) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanCommitBatchUI(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.UInt32,System.UInt32@)
IVsSolutionReloadBatchHandler2.CanGiveControl(IVsSolutionReloadBatchHandler) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanGiveControl(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler2.CanJoin(IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler2.CanTakeControl(IVsSolutionReloadBatchHandler) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.CanTakeControl(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler)
IVsSolutionReloadBatchHandler2.ExecuteReloadUI(IVsSolutionReloadBatch, UInt32, Guid[], UInt32[]) Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.ExecuteReloadUI(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.Guid[],System.UInt32[])
IVsSolutionReloadBatchHandler2.ExecuteReloadWithProjectDefinitionsUI(IVsSolutionReloadBatch, UInt32, Guid[], IVsProjectDefinitionInSolution[], UInt32[]) System.Object.Microsoft#Internal#VisualStudio#Shell#Interop#IVsSolutionReloadBatchHandler2#ExecuteReloadWithProjectDefinitionsUI(Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatch,System.UInt32,System.Guid[],Microsoft.Internal.VisualStudio.Shell.Interop.IVsProjectDefinitionInSolution[],System.UInt32[])
IVsSolutionReloadBatchHandler2.HandlerId Microsoft.Internal.VisualStudio.Shell.Interop.IVsSolutionReloadBatchHandler.HandlerId

Applies to