Partager via


AsyncPackage.FindToolWindowAsync Method

Definition

Asynchronously locates the tool window corresponding to the specified type and ID. If it does not exist, it creates and returns one if create is true, or returns null if create is false.

public:
 System::Threading::Tasks::Task<Microsoft::VisualStudio::Shell::ToolWindowPane ^> ^ FindToolWindowAsync(Type ^ toolWindowType, int id, bool create, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.ToolWindowPane> FindToolWindowAsync (Type toolWindowType, int id, bool create, System.Threading.CancellationToken cancellationToken);
member this.FindToolWindowAsync : Type * int * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.ToolWindowPane>
Public Function FindToolWindowAsync (toolWindowType As Type, id As Integer, create As Boolean, cancellationToken As CancellationToken) As Task(Of ToolWindowPane)

Parameters

toolWindowType
Type

Type of the window to be created

id
Int32

Instance ID

create
Boolean

Create if none exist?

cancellationToken
CancellationToken

The cancellation token for the asynchronous operation

Returns

A task returning either an instance of a class derived from ToolWindowPane or null if the tool window doesn't derive from ToolWindowPane.

Applies to