Share via


ShellExtensibility.ShowPromptAsync<TResult> Method

Definition

Prompts the user with specified message and options, waiting for the user to make a choice or dismiss the prompt without a selection.

public System.Threading.Tasks.Task<TResult> ShowPromptAsync<TResult> (string message, Microsoft.VisualStudio.Extensibility.Shell.PromptOptions<TResult> options, System.Threading.CancellationToken cancellationToken) where TResult : struct;
member this.ShowPromptAsync : string * Microsoft.VisualStudio.Extensibility.Shell.PromptOptions<'Result (requires 'Result : struct)> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result (requires 'Result : struct)> (requires 'Result : struct)
Public Function ShowPromptAsync(Of TResult As Structure) (message As String, options As PromptOptions(Of TResult), cancellationToken As CancellationToken) As Task(Of TResult)

Type Parameters

TResult

The type of the result value.

Parameters

message
String

The prompt message to show the user.

options
PromptOptions<TResult>

The options to configure the prompt.

cancellationToken
CancellationToken

A cancellation token.

Returns

Task<TResult>

The mapped result value of the choice defined in options.

Remarks

If cancellationToken is triggered, a visible prompt will be force closed. In this case the return value is undefined and should be discarded.

Applies to