語言

Chain.Switch<T,R>(IDialog<T>, ICase<T,R>[]) 方法

定義

當前件 IDialog<TResult> 完成後,逐一檢查 ICase<T,R> 並執行 ContextualSelector<T,R>第一個 ICase<T,R> 前件對話中回傳值所滿足的「。

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> Switch<T,R>(this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, params Microsoft.Bot.Builder.Dialogs.ICase<T,R>[] cases);
static member Switch : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Microsoft.Bot.Builder.Dialogs.ICase<'T, 'R>[] -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function Switch(Of T, R) (antecedent As IDialog(Of T), ParamArray cases As ICase(Of T, R)()) As IDialog(Of R)

類型參數

T

前行對話的類型。

R

對話的類型由 ContextualSelector<T,R>

參數

antecedent
IDialog<T>

前件對話 IDialog<TResult>。

cases
ICase<T,R>[]

換機箱

傳回

IDialog<R>

結果 IDialog<TResult>。

適用於