语言

DialogContext 类

定义

public sealed class DialogContext : Microsoft.Bot.Builder.Dialogs.IDialogContext
type DialogContext = class
    interface IDialogContext
    interface IDialogStack
    interface IBotContext
    interface IBotData
    interface IBotToUser
Public NotInheritable Class DialogContext
Implements IDialogContext
继承
DialogContext
实现

构造函数

名称 说明
DialogContext(IBotToUser, IBotData, IDialogStack, IActivity, CancellationToken)

显式接口实现

名称 说明
IBotContext.Activity
IBotContext.CancellationToken
IBotData.ConversationData
IBotData.FlushAsync(CancellationToken)
IBotData.LoadAsync(CancellationToken)
IBotData.PrivateConversationData
IBotData.UserData
IBotToUser.MakeMessage()
IBotToUser.PostAsync(IMessageActivity, CancellationToken)
IDialogStack.Call<R>(IDialog<R>, ResumeAfter<R>)
IDialogStack.Done<R>(R)
IDialogStack.Fail(Exception)
IDialogStack.Forward<R,T>(IDialog<R>, ResumeAfter<R>, T, CancellationToken)
IDialogStack.Frames
IDialogStack.Post<E>(E, ResumeAfter<E>)
IDialogStack.Reset()
IDialogStack.Wait<R>(ResumeAfter<R>)

扩展方法

名称 说明
EndConversation(IDialogContext, String)

发起 an EndConversationEvent 以重置会话状态和栈,并将 发送 an EndOfConversation 给连接器。

Forward<R>(IDialogStack, IDialog<R>, ResumeAfter<R>, IMessageActivity, CancellationToken)

调用一个子对话框,将其添加到栈顶部,并将消息发布到子对话框中。

GetSignInUrlAsync(IDialogContext, String)
GetUserTokenAsync(IDialogContext, String, String)
GetUserTokenAsync(IDialogContext, String)
PostAsync(IBotToUser, String, String, CancellationToken)

发布一条消息,利用之前的消息建立对话上下文。

SayAsync(IBotToUser, String, String, MessageOptions, String, CancellationToken)

发布一条消息,并选择发送给用户的SSML,利用之前的消息建立对话上下文。

SignOutUserAsync(IDialogContext, String)
Wait(IDialogStack, ResumeAfter<IMessageActivity>)

暂停当前对话,直到用户向机器人发送消息。

适用于