Chain Chain Chain Class

Definition

A fluent, chainable interface for IDialogs.

public static class Chain
type Chain = class
Public Module Chain
Inheritance
ChainChainChain

Methods

Case(Regex, ContextualSelector) Case(Regex, ContextualSelector)

Constructs a case based on a regular expression.

public static Microsoft.Bot.Builder.Dialogs.ICase<string,R> Case<R> (System.Text.RegularExpressions.Regex regex, Microsoft.Bot.Builder.Dialogs.ContextualSelector<string,R> selector);
static member Case : System.Text.RegularExpressions.Regex * Microsoft.Bot.Builder.Dialogs.ContextualSelector<string, 'R> -> Microsoft.Bot.Builder.Dialogs.ICase<string, 'R>
Type Parameters
R

The type of the object returned by selector.

Parameters
regex
Regex Regex Regex

The regex for condition.

selector
ContextualSelector<String,R>

The contextual selector for the case.

Returns

The case.

Case(Func, ContextualSelector) Case(Func, ContextualSelector) Case(Func, ContextualSelector)

Constructs a case.

public static Microsoft.Bot.Builder.Dialogs.ICase<T,R> Case<T,R> (Func<T,bool> condition, Microsoft.Bot.Builder.Dialogs.ContextualSelector<T,R> selector);
static member Case : Func<'T, bool> * Microsoft.Bot.Builder.Dialogs.ContextualSelector<'T, 'R> -> Microsoft.Bot.Builder.Dialogs.ICase<'T, 'R>
Public Function Case(Of T, R) (condition As Func(Of T, Boolean), selector As ContextualSelector(Of T, R)) As ICase(Of T, R)
Type Parameters
T

The type of incoming value to case.

R

The type of the object returned by selector.

Parameters
condition
Func<T,Boolean>

The condition of the case.

selector
ContextualSelector<T,R> ContextualSelector<T,R> ContextualSelector<T,R>

The contextual selector of the case.

Returns

Catch(IDialog, Func<>,E,IDialog>) Catch(IDialog, Func<>,E,IDialog>) Catch(IDialog, Func<>,E,IDialog>)

When the antecedent IDialog<TResult> has completed, catch and handle any exceptions of type E.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Catch<T,E> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<Microsoft.Bot.Builder.Dialogs.IDialog<T>,E,Microsoft.Bot.Builder.Dialogs.IDialog<T>> block) where E : Exception;
static member Catch : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<Microsoft.Bot.Builder.Dialogs.IDialog<'T>, 'E, Microsoft.Bot.Builder.Dialogs.IDialog<'T> (requires 'E :> Exception)> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T> (requires 'E :> Exception)
<Extension()>
Public Function Catch(Of T, E) (antecedent As IDialog(Of T), block As Func(Of IDialog(Of T), E, IDialog(Of T))) As IDialog(Of T)
Type Parameters
T

The type returned by the antecedent dialog.

E

The type of exception to catch and handle.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

block
Func<IDialog<T>,E,IDialog<T>>

The lambda expression representing the catch block handler.

Returns
IDialog<T>

The result of the catch block handler if there is an exception of type E.

Catch(IDialog, Func<>,Exception,IDialog>) Catch(IDialog, Func<>,Exception,IDialog>) Catch(IDialog, Func<>,Exception,IDialog>)

When the antecedent IDialog<TResult> has completed, catch and handle any exceptions.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Catch<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<Microsoft.Bot.Builder.Dialogs.IDialog<T>,Exception,Microsoft.Bot.Builder.Dialogs.IDialog<T>> block);
static member Catch : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<Microsoft.Bot.Builder.Dialogs.IDialog<'T>, Exception, Microsoft.Bot.Builder.Dialogs.IDialog<'T>> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Catch(Of T) (antecedent As IDialog(Of T), block As Func(Of IDialog(Of T), Exception, IDialog(Of T))) As IDialog(Of T)
Type Parameters
T

The type returned by the antecedent dialog.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

block
Func<IDialog<T>,Exception,IDialog<T>>

The lambda expression representing the catch block handler.

Returns
IDialog<T>

The result of the catch block handler if there is an exception.

ContinueWith(IDialog, Chain) ContinueWith(IDialog, Chain) ContinueWith(IDialog, Chain)

When the antecedent IDialog<TResult> has completed, execute the continuation to produce the next IDialog<TResult>.

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> ContinueWith<T,R> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Microsoft.Bot.Builder.Dialogs.Chain.Continuation<T,R> continuation);
static member ContinueWith : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Microsoft.Bot.Builder.Dialogs.Chain.Continuation<'T, 'R> -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function ContinueWith(Of T, R) (antecedent As IDialog(Of T), continuation As Chain.Continuation(Of T, R)) As IDialog(Of R)
Type Parameters
T

The type of the antecedent dialog.

R

The type of the next dialog.

Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

continuation
Chain.Continuation<T,R>

The continuation to produce the next IDialog<TResult>.

Returns
IDialog<R>

The next IDialog<TResult>.

Default(ContextualSelector) Default(ContextualSelector) Default(ContextualSelector)

Constructs a case to use as the default.

public static Microsoft.Bot.Builder.Dialogs.ICase<T,R> Default<T,R> (Microsoft.Bot.Builder.Dialogs.ContextualSelector<T,R> selector);
static member Default : Microsoft.Bot.Builder.Dialogs.ContextualSelector<'T, 'R> -> Microsoft.Bot.Builder.Dialogs.ICase<'T, 'R>
Public Function Default(Of T, R) (selector As ContextualSelector(Of T, R)) As ICase(Of T, R)
Type Parameters
T

The type of incoming value to case.

R

The type of the object returned by selector.

Parameters
selector
ContextualSelector<T,R> ContextualSelector<T,R> ContextualSelector<T,R>

The contextual selector of the case.

Returns

DefaultIfException(IDialog) DefaultIfException(IDialog) DefaultIfException(IDialog)

When the antecedent IDialog<TResult> has completed, stop the propagation of an exception of E.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> DefaultIfException<T,E> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent) where E : Exception;
static member DefaultIfException : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T> (requires 'E :> Exception)
<Extension()>
Public Function DefaultIfException(Of T, E) (antecedent As IDialog(Of T)) As IDialog(Of T)
Type Parameters
T

The type returned by the antecedent dialog.

E

The type of exception to swallow.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

Returns
IDialog<T>

The default value of T if there is an exception of type E.

DefaultIfException(IDialog) DefaultIfException(IDialog) DefaultIfException(IDialog)

When the antecedent IDialog<TResult> has completed, stop the propagation of Exception.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> DefaultIfException<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent);
static member DefaultIfException : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function DefaultIfException(Of T) (antecedent As IDialog(Of T)) As IDialog(Of T)
Type Parameters
T

The type returned by the antecedent dialog.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

Returns
IDialog<T>

The default value of T if there is an Exception.

Do(IDialog, Func<>,Task>) Do(IDialog, Func<>,Task>) Do(IDialog, Func<>,Task>)

Execute a side-effect after a IDialog<TResult> completes.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Do<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<Microsoft.Bot.Builder.Dialogs.IBotContext,Microsoft.Bot.Builder.Dialogs.IAwaitable<T>,System.Threading.Tasks.Task> callback);
static member Do : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<Microsoft.Bot.Builder.Dialogs.IBotContext, Microsoft.Bot.Builder.Dialogs.IAwaitable<'T>, System.Threading.Tasks.Task> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Do(Of T) (antecedent As IDialog(Of T), callback As Func(Of IBotContext, IAwaitable(Of T), Task)) As IDialog(Of T)
Type Parameters
T

The type of the dialog.

Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

callback
Func<IBotContext,IAwaitable<T>,Task>

The callback method.

Returns
IDialog<T>

The antecedent dialog.

Fold(IDialog<><>>>, Func) Fold(IDialog<><>>>, Func) Fold(IDialog<><>>>, Func)

Fold items from an enumeration of dialogs.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Fold<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<System.Collections.Generic.IEnumerable<Microsoft.Bot.Builder.Dialogs.IDialog<T>>> antecedent, Func<T,T,T> folder);
static member Fold : Microsoft.Bot.Builder.Dialogs.IDialog<seq<Microsoft.Bot.Builder.Dialogs.IDialog<'T>>> * Func<'T, 'T, 'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Fold(Of T) (antecedent As IDialog(Of IEnumerable(Of IDialog(Of T))), folder As Func(Of T, T, T)) As IDialog(Of T)
Type Parameters
T

The type of the dialogs in the enumeration produced by the antecedent dialog.

Parameters
antecedent
IDialog<IEnumerable<IDialog<T>>>

The antecedent dialog that produces an enumeration of IDialog<TResult>.

folder
Func<T,T,T>

The accumulator for the dialog enumeration.

Returns
IDialog<T>

The accumulated result.

From(Func<>>) From(Func<>>) From(Func<>>)

Construct a IDialog<TResult> that will make a new copy of another IDialog<TResult> when started.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> From<T> (Func<Microsoft.Bot.Builder.Dialogs.IDialog<T>> MakeDialog);
static member From : Func<Microsoft.Bot.Builder.Dialogs.IDialog<'T>> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
Public Function From(Of T) (MakeDialog As Func(Of IDialog(Of T))) As IDialog(Of T)
Type Parameters
T

The type of the dialog.

Parameters
MakeDialog
Func<IDialog<T>>

The dialog factory method.

Returns
IDialog<T>

The new dialog.

Loop(IDialog) Loop(IDialog) Loop(IDialog)

Loop the IDialog<TResult> forever.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Loop<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent);
static member Loop : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Loop(Of T) (antecedent As IDialog(Of T)) As IDialog(Of T)
Type Parameters
T
Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

Returns
IDialog<T>

The looping dialog.

PostEvent(IDialog, E) PostEvent(IDialog, E) PostEvent(IDialog, E)

When the antecedent IDialog<TResult> has completed, post the item to the event queue.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> PostEvent<T,E> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, E event);
static member PostEvent : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * 'E -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function PostEvent(Of T, E) (antecedent As IDialog(Of T), event As E) As IDialog(Of T)
Type Parameters
T

The type of the antecedent dialog.

E

The type of the event.

Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

event

The event.

Returns
IDialog<T>

The result from the antecedent IDialog<TResult>.

PostToChain() PostToChain() PostToChain()

Post the message from the user to Chain.

public static Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Connector.IMessageActivity> PostToChain ();
static member PostToChain : unit -> Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Connector.IMessageActivity>
Public Function PostToChain () As IDialog(Of IMessageActivity)
Returns
IDialog<Microsoft.Bot.Connector.IMessageActivity>

The dialog that dispatches the incoming message from the user to chain.

Remarks

The returned IDialog<TResult> can be used as the root dialog for a chain.

PostToUser(IDialog) PostToUser(IDialog) PostToUser(IDialog)

Post to the user the result of a IDialog<TResult>.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> PostToUser<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent);
static member PostToUser : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function PostToUser(Of T) (antecedent As IDialog(Of T)) As IDialog(Of T)
Type Parameters
T

The type of the dialog.

Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

Returns
IDialog<T>

The antecedent dialog.

Return(T) Return(T) Return(T)

Creates a IDialog<TResult> that returns a value.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Return<T> (T item);
static member Return : 'T -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
Public Function Return(Of T) (item As T) As IDialog(Of T)
Type Parameters
T

Type of the value.

Parameters
item

The value to be wrapped.

Returns
IDialog<T>

The IDialog<TResult> that wraps the value.

Remarks

The type of the value should be serializable.

Select(IDialog, Func) Select(IDialog, Func) Select(IDialog, Func)

When the antecedent IDialog<TResult> has completed, project the result into a new IDialog<TResult>.

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> Select<T,R> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<T,R> selector);
static member Select : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<'T, 'R> -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function Select(Of T, R) (antecedent As IDialog(Of T), selector As Func(Of T, R)) As IDialog(Of R)
Type Parameters
T

The type of the antecedent dialog.

R

The type of the projected dialog.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

selector
Func<T,R>

The projection function from T to R.

Returns
IDialog<R>

The result IDialog<TResult>.

SelectMany(IDialog, Func<>>, Func) SelectMany(IDialog, Func<>>, Func) SelectMany(IDialog, Func<>>, Func)

When the antecedent IDialog<TResult> has completed, execute the next IDialog<TResult>, and use the projection to combine the results.

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> SelectMany<T,C,R> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<T,Microsoft.Bot.Builder.Dialogs.IDialog<C>> function, Func<T,C,R> projection);
static member SelectMany : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<'T, Microsoft.Bot.Builder.Dialogs.IDialog<'C>> * Func<'T, 'C, 'R> -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function SelectMany(Of T, C, R) (antecedent As IDialog(Of T), function As Func(Of T, IDialog(Of C)), projection As Func(Of T, C, R)) As IDialog(Of R)
Type Parameters
T

The type of the antecedent dialog.

C

The type of the intermediate dialog.

R

The type of the projected dialog.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

function
Func<T,IDialog<C>>

The factory method to create the next dialog IDialog<TResult>.

projection
Func<T,C,R>

The projection function for the combination of the two dialogs.

Returns
IDialog<R>

The result IDialog<TResult>.

Switch(IDialog, ICase[]) Switch(IDialog, ICase[]) Switch(IDialog, ICase[])

When the antecedent IDialog<TResult> has completed, go through each ICase<T,R> and run the ContextualSelector<T,R>" of the first ICase<T,R> that the returned value by the antecedent dialog satisfies.

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)
Type Parameters
T

The type of the antecedent dialog.

R

The type of the Dialog returned by ContextualSelector<T,R>

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

cases
ICase<T,R>[]

Cases for the switch

Returns
IDialog<R>

The result IDialog<TResult>.

Then(IDialog, Func<>,Task>) Then(IDialog, Func<>,Task>) Then(IDialog, Func<>,Task>)

Execute an action after the IDialog<TResult> completes.

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> Then<T,R> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> Antecedent, Func<Microsoft.Bot.Builder.Dialogs.IBotContext,Microsoft.Bot.Builder.Dialogs.IAwaitable<T>,System.Threading.Tasks.Task<R>> Action);
static member Then : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<Microsoft.Bot.Builder.Dialogs.IBotContext, Microsoft.Bot.Builder.Dialogs.IAwaitable<'T>, System.Threading.Tasks.Task<'R>> -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function Then(Of T, R) (Antecedent As IDialog(Of T), Action As Func(Of IBotContext, IAwaitable(Of T), Task(Of R))) As IDialog(Of R)
Type Parameters
T

The type of the dialog.

R

They type returned by action.

Parameters
Antecedent
IDialog<T>

The antecedent IDialog<TResult>.

Action
Func<IBotContext,IAwaitable<T>,Task<R>>

The action that will be called after the antecedent dialog completes.

Returns
IDialog<R>

The antecedent dialog.

Unwrap(IDialog<>>) Unwrap(IDialog<>>) Unwrap(IDialog<>>)

When the antecedent IDialog<TResult> where T is IDialog<TResult> completes, unwrap the result into a new IDialog<TResult>.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Unwrap<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Builder.Dialogs.IDialog<T>> antecedent);
static member Unwrap : Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Builder.Dialogs.IDialog<'T>> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Unwrap(Of T) (antecedent As IDialog(Of IDialog(Of T))) As IDialog(Of T)
Type Parameters
T

The type of the antecedent dialog.

Parameters
antecedent
IDialog<IDialog<T>>

The antecedent dialog IDialog<TResult> where T is IDialog<TResult>.

Returns

Void(IDialog) Void(IDialog) Void(IDialog)

Call the voided IDialog<TResult>, ignore the result, then restart the original dialog wait.

public static Microsoft.Bot.Builder.Dialogs.IDialog<R> Void<T,R> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent);
static member Void : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<'R>
<Extension()>
Public Function Void(Of T, R) (antecedent As IDialog(Of T)) As IDialog(Of R)
Type Parameters
T

The type of the voided dialog.

R

The type of the original dialog wait.

Parameters
antecedent
IDialog<T>

The voided dialog.

Returns
IDialog<R>

The dialog that produces the item to satisfy the original wait.

Remarks

The purpose of this method is to wrap an antecedent dialog A with a new dialog D to push on the stack
on top of the existing stack top dialog L.
1. D will call A.
2. D will receive the value of A when A is done.
3. D will re-initiate the typed wait (often for a message) for which a method of L was waiting
4. D will receive that value of the re-initiated typed wait.
5. D will return that value of the typed wait to L.
This depends on the symmetry of IDialogStack.Done and IDialogStack.Wait in how they satisfy typed waits.

Void(IDialog, IDialogStack) Void(IDialog, IDialogStack) Void(IDialog, IDialogStack)

Call the voided IDialog<TResult>, ignore the result, then restart the original dialog wait.

public static Microsoft.Bot.Builder.Dialogs.IDialog<object> Void<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Microsoft.Bot.Builder.Dialogs.Internals.IDialogStack stack);
static member Void : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Microsoft.Bot.Builder.Dialogs.Internals.IDialogStack -> Microsoft.Bot.Builder.Dialogs.IDialog<obj>
<Extension()>
Public Function Void(Of T) (antecedent As IDialog(Of T), stack As IDialogStack) As IDialog(Of Object)
Type Parameters
T

The type of the voided dialog.

Parameters
antecedent
IDialog<T>

The voided dialog.

stack
IDialogStack IDialogStack IDialogStack

The dialog stack.

Returns

The dialog that produces the item to satisfy the original wait.

Remarks

(value types don't support generic parameter variance - so this reflection-based method may not work) It's okay to loose type information (i.e. IDialog{object}) because voided dialogs are called with a null ResumeAfter<T> because they are hacking the stack to satisfy the wait of the interrupted dialog.

WaitToBot(IDialog) WaitToBot(IDialog) WaitToBot(IDialog)

Post to the chain the message to the bot after the antecedent completes.

public static Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Connector.IMessageActivity> WaitToBot<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent);
static member WaitToBot : Microsoft.Bot.Builder.Dialogs.IDialog<'T> -> Microsoft.Bot.Builder.Dialogs.IDialog<Microsoft.Bot.Connector.IMessageActivity>
<Extension()>
Public Function WaitToBot(Of T) (antecedent As IDialog(Of T)) As IDialog(Of IMessageActivity)
Type Parameters
T

The type of the dialog.

Parameters
antecedent
IDialog<T>

The antecedent IDialog<TResult>.

Returns
IDialog<Microsoft.Bot.Connector.IMessageActivity>

The dialog representing the message sent to the bot.

Where(IDialog, Func) Where(IDialog, Func) Where(IDialog, Func)

When the antecedent IDialog<TResult> has completed, evaluate the predicate and decide whether to continue.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> Where<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Func<T,bool> predicate);
static member Where : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<'T, bool> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function Where(Of T) (antecedent As IDialog(Of T), predicate As Func(Of T, Boolean)) As IDialog(Of T)
Type Parameters
T

The type of the antecedent dialog.

Parameters
antecedent
IDialog<T>

The antecedent dialog IDialog<TResult>.

predicate
Func<T,Boolean>

The predicate to decide whether to continue the chain.

Returns
IDialog<T>

The result from the antecedent IDialog<TResult> or its cancellation, wrapped in a IDialog<TResult>.

While(IDialog, Func<>>, Func<>>) While(IDialog, Func<>>, Func<>>) While(IDialog, Func<>>, Func<>>)

Create a IDialog<TResult> that represents a while loop.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> While<T> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> initial, Func<T,Microsoft.Bot.Builder.Dialogs.IDialog<bool>> test, Func<T,Microsoft.Bot.Builder.Dialogs.IDialog<T>> body);
static member While : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Func<'T, Microsoft.Bot.Builder.Dialogs.IDialog<bool>> * Func<'T, Microsoft.Bot.Builder.Dialogs.IDialog<'T>> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function While(Of T) (initial As IDialog(Of T), test As Func(Of T, IDialog(Of Boolean)), body As Func(Of T, IDialog(Of T))) As IDialog(Of T)
Type Parameters
T

The type of the value.

Parameters
initial
IDialog<T>

The value if test is never true.

test
Func<T,IDialog<Boolean>>

The test to enter the while loop body.

body
Func<T,IDialog<T>>

The body of the while loop.

Returns
IDialog<T>

Zero or the last value returned by the body of the while loop.

WithScorable(IDialog, IScorable) WithScorable(IDialog, IScorable) WithScorable(IDialog, IScorable)

Decorate a dialog with a scorable, so that a scorable can participate on the dialog stack.

public static Microsoft.Bot.Builder.Dialogs.IDialog<T> WithScorable<T,Item,Score> (this Microsoft.Bot.Builder.Dialogs.IDialog<T> antecedent, Microsoft.Bot.Builder.Scorables.IScorable<Item,Score> scorable);
static member WithScorable : Microsoft.Bot.Builder.Dialogs.IDialog<'T> * Microsoft.Bot.Builder.Scorables.IScorable<'Item, 'Score> -> Microsoft.Bot.Builder.Dialogs.IDialog<'T>
<Extension()>
Public Function WithScorable(Of T, Item, Score) (antecedent As IDialog(Of T), scorable As IScorable(Of Item, Score)) As IDialog(Of T)
Type Parameters
T

The type of the dialog.

Item

The type of the item scored by the scorable.

Score

The type of the scope produced by the scorable.

Parameters
antecedent
IDialog<T>

The antecedent dialog.

Returns
IDialog<T>

The dialog augmented with the scorables.

Applies to