PromptDialog.Choice 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Choice<T>(IDialogContext, ResumeAfter<T>, IPromptOptions<T>, Boolean, Boolean, Boolean, Double)
提示從一組選項中選出一個。
public static void Choice<T>(Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, Microsoft.Bot.Builder.Dialogs.IPromptOptions<T> promptOptions, bool recognizeChoices = true, bool recognizeNumbers = true, bool recognizeOrdinals = true, double minScore = 0.4);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * Microsoft.Bot.Builder.Dialogs.IPromptOptions<'T> * bool * bool * bool * double -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), promptOptions As IPromptOptions(Of T), Optional recognizeChoices As Boolean = true, Optional recognizeNumbers As Boolean = true, Optional recognizeOrdinals As Boolean = true, Optional minScore As Double = 0.4)
類型參數
- T
選項的類型。
參數
- context
- IDialogContext
對話框內容。
- resume
- ResumeAfter<T>
履歷處理員。
- promptOptions
- IPromptOptions<T>
提示選項。
- recognizeChoices
- Boolean
(選擇性)如果為 true,提示會嘗試使用選項本身辨識選取的值。 默認值為 「true」。
- recognizeNumbers
- Boolean
(選擇性)如果為 true,提示會嘗試辨識用戶語句中的數位,做為選擇傳回的索引。 默認值為 「true」。
- recognizeOrdinals
- Boolean
(選擇性)如果為 true,則提示會嘗試辨識「第一個」或「第二個」等序數,做為選擇傳回的索引。 默認值為 「true」。
- minScore
- Double
(選擇性) 最低分數從 0.0 - 1.0 需要,才能將已辨識的選擇視為相符專案。 預設值為 “0.4”。
備註
T 應該實施 ToString()
適用於
Choice<T>(IDialogContext, ResumeAfter<T>, IEnumerable<T>, String, String, Int32, PromptStyle, IEnumerable<String>)
提示從一組選項中選出一個。
public static void Choice<T>(Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, System.Collections.Generic.IEnumerable<T> options, string prompt, string retry = default, int attempts = 3, Microsoft.Bot.Builder.Dialogs.PromptStyle promptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, System.Collections.Generic.IEnumerable<string> descriptions = default);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * seq<'T> * string * string * int * Microsoft.Bot.Builder.Dialogs.PromptStyle * seq<string> -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), options As IEnumerable(Of T), prompt As String, Optional retry As String = Nothing, Optional attempts As Integer = 3, Optional promptStyle As PromptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, Optional descriptions As IEnumerable(Of String) = Nothing)
類型參數
- T
參數
- context
- IDialogContext
內容。
- resume
- ResumeAfter<T>
履歷處理員。
- options
- IEnumerable<T>
所有可能的選項都必須可轉換為字串。
- prompt
- String
顯示給使用者的提示。
- retry
- String
重試時要顯示什麼。
- attempts
- Int32
要重試的次數。
- promptStyle
- PromptStyle
提示風格 PromptStyle
- descriptions
- IEnumerable<String>
描述可供選擇。
適用於
Choice<T>(IDialogContext, ResumeAfter<T>, IDictionary<T,IEnumerable<T>>, String, String, Int32, PromptStyle, IEnumerable<String>, Boolean, Boolean, Boolean, Double)
提示從一組選項中選出一個。
public static void Choice<T>(Microsoft.Bot.Builder.Dialogs.IDialogContext context, Microsoft.Bot.Builder.Dialogs.ResumeAfter<T> resume, System.Collections.Generic.IDictionary<T,System.Collections.Generic.IEnumerable<T>> choices, string prompt, string retry = default, int attempts = 3, Microsoft.Bot.Builder.Dialogs.PromptStyle promptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, System.Collections.Generic.IEnumerable<string> descriptions = default, bool recognizeChoices = true, bool recognizeNumbers = true, bool recognizeOrdinals = true, double minScore = 0.4);
static member Choice : Microsoft.Bot.Builder.Dialogs.IDialogContext * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'T> * System.Collections.Generic.IDictionary<'T, seq<'T>> * string * string * int * Microsoft.Bot.Builder.Dialogs.PromptStyle * seq<string> * bool * bool * bool * double -> unit
Public Shared Sub Choice(Of T) (context As IDialogContext, resume As ResumeAfter(Of T), choices As IDictionary(Of T, IEnumerable(Of T)), prompt As String, Optional retry As String = Nothing, Optional attempts As Integer = 3, Optional promptStyle As PromptStyle = Microsoft.Bot.Builder.Dialogs.PromptStyle.Auto, Optional descriptions As IEnumerable(Of String) = Nothing, Optional recognizeChoices As Boolean = true, Optional recognizeNumbers As Boolean = true, Optional recognizeOrdinals As Boolean = true, Optional minScore As Double = 0.4)
類型參數
- T
參數
- context
- IDialogContext
內容。
- resume
- ResumeAfter<T>
履歷處理員。
- choices
- IDictionary<T,IEnumerable<T>>
字典中,鍵可選擇選項,並以同義詞作為值。
- prompt
- String
顯示給使用者的提示。
- retry
- String
重試時要顯示什麼。
- attempts
- Int32
要重試的次數。
- promptStyle
- PromptStyle
提示風格 PromptStyle
- descriptions
- IEnumerable<String>
描述可供選擇。
- recognizeChoices
- Boolean
(選擇性)如果為 true,提示會嘗試使用選項本身辨識選取的值。 默認值為 「true」。
- recognizeNumbers
- Boolean
(選擇性)如果為 true,提示會嘗試辨識用戶語句中的數位,做為選擇傳回的索引。 默認值為 「true」。
- recognizeOrdinals
- Boolean
(選擇性)如果為 true,則提示會嘗試辨識「第一個」或「第二個」等序數,做為選擇傳回的索引。 默認值為 「true」。
- minScore
- Double
(選擇性) 最低分數從 0.0 - 1.0 需要,才能將已辨識的選擇視為相符專案。 預設值為 “0.4”。