Microsoft.Bot.Builder.Dialogs.Extensions Class Reference

Helper methods. More...

Static Public Member Functions

static void AddHeroCard< T > (this IMessageActivity message, string text, IEnumerable< T > options, IEnumerable< string > descriptions=null)
 Generates buttons from options and add them to the message. More...
 
static void AddKeyboardCard< T > (this IMessageActivity message, string text, IEnumerable< T > options, IEnumerable< string > descriptions=null)
 Generates buttons from options and add them to the message. More...
 
static async Task Forward< R > (this IDialogStack stack, IDialog< R > child, ResumeAfter< R > resume, IMessageActivity message, CancellationToken token)
 Call a child dialog, add it to the top of the stack and post the message to the child dialog. More...
 
static T Get< T > (this IBotDataBag bag, string key)
 Gets the value associated with the specified key. More...
 
static string GZipSerialize (this ResumptionCookie resumptionCookie)
 Binary serializes ResumptionCookie using GZipStream. More...
 
static async Task PostAsync (this IBotToUser botToUser, string text, string locale=null, CancellationToken cancellationToken=default(CancellationToken))
 Post a message to be sent to the bot, using previous messages to establish a conversation context. More...
 
static void Wait (this IDialogStack stack, ResumeAfter< IMessageActivity > resume)
 Suspend the current dialog until the user has sent a message to the bot. More...
 

Detailed Description

Helper methods.

Definition at line 90 of file IBotDataBag.cs.

Member Function Documentation

static void Microsoft.Bot.Builder.Dialogs.Extensions.AddHeroCard< T > ( this IMessageActivity  message,
string  text,
IEnumerable< T >  options,
IEnumerable< string >  descriptions = null 
)
inlinestatic

Generates buttons from options and add them to the message.

T should implement ToString().

Template Parameters
TType of the options.
Parameters
messageThe message that the buttons will be added to.
textThe text in the HeroCard.
optionsThe options that cause generation of buttons.
descriptionsDescriptions for each option.

Definition at line 658 of file PromptDialog.cs.

static void Microsoft.Bot.Builder.Dialogs.Extensions.AddKeyboardCard< T > ( this IMessageActivity  message,
string  text,
IEnumerable< T >  options,
IEnumerable< string >  descriptions = null 
)
inlinestatic

Generates buttons from options and add them to the message.

T should implement ToString().

Template Parameters
TType of the options.
Parameters
messageThe message that the buttons will be added to.
textThe text in the HeroCard.
optionsThe options that cause generation of buttons.
descriptionsDescriptions for each option.

Definition at line 675 of file PromptDialog.cs.

static async Task Microsoft.Bot.Builder.Dialogs.Extensions.Forward< R > ( this IDialogStack  stack,
IDialog< R >  child,
ResumeAfter< R >  resume,
IMessageActivity  message,
CancellationToken  token 
)
inlinestatic

Call a child dialog, add it to the top of the stack and post the message to the child dialog.

Template Parameters
RThe type of result expected from the child dialog.
Parameters
stackThe dialog stack.
childThe child dialog.
resumeThe method to resume when the child dialog has completed.
messageThe message that will be posted to child dialog.
tokenA cancellation token.
Returns
A task representing the Forward operation.

Definition at line 134 of file IDialogContext.cs.

static T Microsoft.Bot.Builder.Dialogs.Extensions.Get< T > ( this IBotDataBag  bag,
string  key 
)
inlinestatic

Gets the value associated with the specified key.

Template Parameters
TThe type of the value to get.
Parameters
bagThe bot data bag.
keyThe key of the value to get or set.
Returns
The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException.

Definition at line 99 of file IBotDataBag.cs.

static string Microsoft.Bot.Builder.Dialogs.Extensions.GZipSerialize ( this ResumptionCookie  resumptionCookie)
inlinestatic

Binary serializes ResumptionCookie using GZipStream.

Parameters
resumptionCookieThe resumption cookie.
Returns
A Base64 encoded string.

Definition at line 184 of file ResumptionCookie.cs.

static async Task Microsoft.Bot.Builder.Dialogs.Extensions.PostAsync ( this IBotToUser  botToUser,
string  text,
string  locale = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)
inlinestatic

Post a message to be sent to the bot, using previous messages to establish a conversation context.

If the locale parameter is not set, locale of the incoming message will be used for reply.

Parameters
botToUserCommunication channel to use.
textThe message text.
localeThe locale of the text.
cancellationTokenThe cancellation token.
Returns
A task that represents the post operation.

Definition at line 101 of file IDialogContext.cs.

static void Microsoft.Bot.Builder.Dialogs.Extensions.Wait ( this IDialogStack  stack,
ResumeAfter< IMessageActivity resume 
)
inlinestatic

Suspend the current dialog until the user has sent a message to the bot.

Parameters
stackThe dialog stack.
resumeThe method to resume when the message has been received.

Definition at line 119 of file IDialogContext.cs.


The documentation for this class was generated from the following files: