TemplateAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
定义一个生成字符串的模板。
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true)]
[System.Serializable]
public class TemplateAttribute : Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true)>]
[<System.Serializable>]
type TemplateAttribute = class
inherit TemplateBaseAttribute
Public Class TemplateAttribute
Inherits TemplateBaseAttribute
- 继承
- 属性
注解
模板提供使用 \ref模式中定义的模板语言的模式。 请查看 TemplateUsage 所有不同类型模板的介绍。 你也可以查看 Templates 所有默认模板。 模板可以在字段级别的表单、类/结构处被覆盖。 他们还支持在模板间随机选择,这也是增加回答多样性的好方法。
构造函数
| 名称 | 说明 |
|---|---|
| TemplateAttribute(TemplateAttribute) |
从另一个模板初始化。 |
| TemplateAttribute(TemplateUsage, String[]) |
指定一组模板,随机选择用于特定用途。 |
字段
| 名称 | 说明 |
|---|---|
| Usage |
这是什么样的模板。 |
属性
| 名称 | 说明 |
|---|---|
| AllowDefault |
在处理 \ref模式字符串中的选择{||}时,如果存在默认值,请提供选项。 (继承自 TemplateBaseAttribute) |
| ChoiceCase |
在 \ref pattern字符串中显示{||}引用中的选择时,控制情况。 (继承自 TemplateBaseAttribute) |
| ChoiceFormat |
格式字符串用于在 \ref模式字符串中展示{||}选项时呈现每个选择。 (继承自 TemplateBaseAttribute) |
| ChoiceLastSeparator |
在构建使用 {||} 的 \ref pattern 字符串中的内联选择列表时,该字符串是最后一个选择之前使用的字符串。 (继承自 TemplateBaseAttribute) |
| ChoiceParens |
在 \r中构建 {||} 的内联选择列表时,EF 模式字符串控制是否在选择周围加括号。 (继承自 TemplateBaseAttribute) |
| ChoiceSeparator |
在构造内联列表时,使用 {||} 在 \ref 模式字符串中,即除最后一个外所有选项中使用的字符串。 (继承自 TemplateBaseAttribute) |
| ChoiceStyle |
如何在 \rEF 模式字符串中处理 {||} 选项时显示 {||} 。 (继承自 TemplateBaseAttribute) |
| Feedback |
控制用户在每次输入后获得的反馈类型。 (继承自 TemplateBaseAttribute) |
| FieldCase |
在 \rEF 模式字符串中显示 {&} 字段名引用时的控制情况。 (继承自 TemplateBaseAttribute) |
| IsLocalizable |
如果属性是可局部化的,则为真。 (继承自 FormFlowAttribute) |
| LastSeparator |
在构建列表中使用 {[]} 的 \ref patterns 字符串时,即列表中最后一个值之前使用的字符串。 (继承自 TemplateBaseAttribute) |
| Patterns |
所有可能的模板。 (继承自 TemplateBaseAttribute) |
| Separator |
在构造使用 {[]} 的列表时,\ref 模式字符串中,除了最后一个值外,所有值之间都用的字符串。 (继承自 TemplateBaseAttribute) |
| ValueCase |
在 EF patterns 字符串中显示 {} 值引用时的控制情况 \r (继承自 TemplateBaseAttribute) |
方法
| 名称 | 说明 |
|---|---|
| ApplyDefaults(TemplateBaseAttribute) |
模板中的任何默认值都会被提供的 |
| Pattern() |
生成字符串 IPrompt<T>时应采用的模式。 (继承自 TemplateBaseAttribute) |