Share via


ShellExtensibility.ShowPromptAsync Method

Definition

Overloads

ShowPromptAsync(String, InputPromptOptions, CancellationToken)

Prompts the user with a message waiting for the user to provide input or dismiss the prompt.

ShowPromptAsync<TResult>(String, PromptOptions<TResult>, CancellationToken)

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

ShowPromptAsync(String, InputPromptOptions, CancellationToken)

Prompts the user with a message waiting for the user to provide input or dismiss the prompt.

public System.Threading.Tasks.Task<string?> ShowPromptAsync(string message, Microsoft.VisualStudio.Extensibility.Shell.InputPromptOptions options, System.Threading.CancellationToken cancellationToken);
member this.ShowPromptAsync : string * Microsoft.VisualStudio.Extensibility.Shell.InputPromptOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function ShowPromptAsync (message As String, options As InputPromptOptions, cancellationToken As CancellationToken) As Task(Of String)

Parameters

message
String

The prompt message to show the user.

options
InputPromptOptions

The options to configure the prompt.

cancellationToken
CancellationToken

A cancellation token.

Returns

The input if the user confirms the prompt, otherwise null if the user dismissed the prompt.

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

ShowPromptAsync<TResult>(String, PromptOptions<TResult>, CancellationToken)

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