IFormBuilder<T> 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public interface IFormBuilder<T> where T : class
type IFormBuilder<'T (requires 'T : null)> = interface
Public Interface IFormBuilder(Of T)
类型参数
- 派生
-
一个表格由一系列步骤组成,这些步骤可以是以下之一:
默认情况下,步骤按 、 和 Field(IField<T>)Confirm(String, ActiveDelegate<T>, IEnumerable<String>) 调用的顺序Message(String, ActiveDelegate<T>, IEnumerable<String>)执行。 如果你没有明确控制,步骤将按照表单状态中定义的顺序执行,并最终确认。 这个界面允许你灵活地通过组合字段、消息和确认信息来构建表格。 流流构建块提供了常见的模式,比如字段基于你的状态类,但你也可以通过使用Advanced.IField来构建自己的表单定义。 如果你想用C#的反射在状态类上构建表单,可以用FormBuilder。 要通过 JSON Schema 声明式构建表单,可以使用 Json.FormBuilderJson。
表单对当前线程界面文化很敏感。 Microsoft。如果有,Bot.Builder字符串会本地化到该文化。 你也可以通过调用IForm.SaveResources,或者使用RView工具将该资源添加到你的项目中,将生成的字符串本地化。 对于动态字段、消息或确认中的字符串,你需要使用正常的C#机制来本地化它们。 请查看概览文档获取更多信息。
属性
方法
| 名称 |
说明 |
|
AddRemainingFields(IEnumerable<String>)
|
添加所有尚未添加到表单中的字段。
|
|
Build(Assembly, String)
|
根据建造者调用的方法构建表单。
|
|
Confirm(MessageDelegate<T>, ActiveDelegate<T>, IEnumerable<String>)
|
通过代理生成确认,动态构建消息。
|
|
Confirm(PromptAttribute, ActiveDelegate<T>, IEnumerable<String>)
|
添加确认步骤。
|
|
Confirm(String, ActiveDelegate<T>, IEnumerable<String>)
|
添加确认步骤。
|
|
Field(IField<T>)
|
通过提供你自己的场定义来细化场步骤。
|
|
Field(String, ActiveDelegate<T>, ValidateAsyncDelegate<T>)
|
定义一个步骤,用于在表单状态中填写特定值。
|
|
Field(String, PromptAttribute, ActiveDelegate<T>, ValidateAsyncDelegate<T>)
|
定义一个步骤,用于在表单状态中填写特定值。
|
|
Field(String, String, ActiveDelegate<T>, ValidateAsyncDelegate<T>)
|
定义一个步骤,用于在表单状态中填写特定值。
|
|
HasField(String)
|
检验是否已经存在 满足 name的字段。
|
|
Message(MessageDelegate<T>, ActiveDelegate<T>, IEnumerable<String>)
|
使用代理生成消息,动态构建消息。
|
|
Message(PromptAttribute, ActiveDelegate<T>, IEnumerable<String>)
|
展示一个格式控制更多且不需要回复的消息。
|
|
Message(String, ActiveDelegate<T>, IEnumerable<String>)
|
展示一条不需要回复的信息。
|
|
OnCompletion(OnCompletionAsyncDelegate<T>)
|
表格填写后请委托打电话。
|
|
Prompter(PromptAsyncDelegate<T>)
|
委托发送提示给用户。
|