语言

TurnContextStateCollection 类

定义

值在回合的整个生命周期内都保持不变,作为 ITurnContext。

public class TurnContextStateCollection : System.Collections.Generic.Dictionary<string,object>, IDisposable
type TurnContextStateCollection = class
    inherit Dictionary<string, obj>
    interface IDisposable
Public Class TurnContextStateCollection
Inherits Dictionary(Of String, Object)
Implements IDisposable
继承
TurnContextStateCollection
实现

注解

这里存储的典型值是需要在回合生命周期内的对象,如IStorage、BotState、ConversationState、ILanguageGenerator、ResourceExplorer等。

构造函数

名称 说明
TurnContextStateCollection()

初始化 TurnContextStateCollection 类的新实例。

方法

名称 说明
Add<T>(String, T)

将值添加到轮次上下文中。

Add<T>(T)

将值添加到轮次上下文中。

Dispose()

执行与释放、释放或重置非托管资源关联的应用程序定义任务。

Dispose(Boolean)

如果抛弃参数设置为true,则释放资源。

Get<T>()

从回合上下文中获取类型默认值。

Get<T>(String)

从回合上下文中按名称获取缓存值。

Set<T>(String, T)

将值设定为回合的上下文。

Set<T>(T)

将值设定为回合的上下文。

适用于