AsyncPackage.InitializeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The async initialization portion of the package initialization process. This method is invoked from a background thread.
protected:
virtual System::Threading::Tasks::Task ^ InitializeAsync(System::Threading::CancellationToken cancellationToken, IProgress<Microsoft::VisualStudio::Shell::ServiceProgressData ^> ^ progress);
protected virtual System.Threading.Tasks.Task InitializeAsync (System.Threading.CancellationToken cancellationToken, IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> progress);
abstract member InitializeAsync : System.Threading.CancellationToken * IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> -> System.Threading.Tasks.Task
override this.InitializeAsync : System.Threading.CancellationToken * IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData> -> System.Threading.Tasks.Task
Protected Overridable Function InitializeAsync (cancellationToken As CancellationToken, progress As IProgress(Of ServiceProgressData)) As Task
Parameters
- cancellationToken
- CancellationToken
A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.
- progress
- IProgress<ServiceProgressData>
Returns
A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.