語言

ChoicePrompt 建構函式

定義

多載

ChoicePrompt(String, PromptValidator<FoundChoice>, String)

初始化 ChoicePrompt 類別的新執行個體。

public ChoicePrompt(string dialogId, Microsoft.Bot.Builder.Dialogs.PromptValidator<Microsoft.Bot.Builder.Dialogs.Choices.FoundChoice> validator = default, string defaultLocale = default);
new Microsoft.Bot.Builder.Dialogs.ChoicePrompt : string * Microsoft.Bot.Builder.Dialogs.PromptValidator<Microsoft.Bot.Builder.Dialogs.Choices.FoundChoice> * string -> Microsoft.Bot.Builder.Dialogs.ChoicePrompt
Public Sub New (dialogId As String, Optional validator As PromptValidator(Of FoundChoice) = Nothing, Optional defaultLocale As String = Nothing)

參數

dialogId
String

要指派給這個提示的標識碼。

validator
PromptValidator<FoundChoice>

選擇性的 PromptValidator<T>,其中包含此提示的其他自定義驗證。

defaultLocale
String

選擇性的預設地區設定,用來判斷提示的語言特定行為。 地區設定是代表語言或語言系列的 2、3 或 4 個字元 ISO 639 程式代碼。

備註

dialogId 的值在提示加入的 DialogSet 或 ComponentDialog 內必須是唯一的。

若Locale指定 的ActivityDialogContextContext,則該 local 用於判斷語言特定行為;否則使用 。defaultLocale 如果沒有語言或預設地區設定可用,或是不支援語言或地區設定,則會使用 US-English。

適用於

ChoicePrompt(String, Dictionary<String,ChoiceFactoryOptions>, PromptValidator<FoundChoice>, String)

初始化 ChoicePrompt 類別的新執行個體。

public ChoicePrompt(string dialogId, System.Collections.Generic.Dictionary<string,Microsoft.Bot.Builder.Dialogs.Choices.ChoiceFactoryOptions> choiceDefaults, Microsoft.Bot.Builder.Dialogs.PromptValidator<Microsoft.Bot.Builder.Dialogs.Choices.FoundChoice> validator = default, string defaultLocale = default);
new Microsoft.Bot.Builder.Dialogs.ChoicePrompt : string * System.Collections.Generic.Dictionary<string, Microsoft.Bot.Builder.Dialogs.Choices.ChoiceFactoryOptions> * Microsoft.Bot.Builder.Dialogs.PromptValidator<Microsoft.Bot.Builder.Dialogs.Choices.FoundChoice> * string -> Microsoft.Bot.Builder.Dialogs.ChoicePrompt
Public Sub New (dialogId As String, choiceDefaults As Dictionary(Of String, ChoiceFactoryOptions), Optional validator As PromptValidator(Of FoundChoice) = Nothing, Optional defaultLocale As String = Nothing)

參數

dialogId
String

要指派給這個提示的標識碼。

choiceDefaults
Dictionary<String,ChoiceFactoryOptions>

覆寫 Bot Framework SDK 支援的_choiceDefaults字典(適用於提示本地化)。 必須傳入需要自定義選擇預設值的每個 ConfirmPrompt。

validator
PromptValidator<FoundChoice>

選擇性的 PromptValidator<T>,其中包含此提示的其他自定義驗證。

defaultLocale
String

選擇性的預設地區設定,用來判斷提示的語言特定行為。 地區設定是代表語言或語言系列的 2、3 或 4 個字元 ISO 639 程式代碼。

備註

dialogId 的值在提示加入的 DialogSet 或 ComponentDialog 內必須是唯一的。

若Locale指定 的ActivityDialogContextContext,則該 local 用於判斷語言特定行為;否則使用 。defaultLocale 如果沒有語言或預設地區設定可用,或是不支援語言或地區設定,則會使用 US-English。

適用於