TemplateAttribute 类

定义

定义用于生成字符串的模板。

[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 patterns 字符串中显示 {||} 引用中的选项时,控制大小写。

(继承自 TemplateBaseAttribute)
ChoiceFormat

在 \ref 模式字符串中显示 {||} 选项时,用于显示每个选项的格式字符串。

(继承自 TemplateBaseAttribute)
ChoiceLastSeparator

在 \ref 模式字符串中使用 {||} 构造内联选项列表时,在最后一个选项之前使用的字符串。

(继承自 TemplateBaseAttribute)
ChoiceParens

在 \ref 模式中为 {||} 构造内联选项列表时,字符串控制是否在选项周围包含括号。

(继承自 TemplateBaseAttribute)
ChoiceSeparator

在 \ref 模式字符串中使用 {||} 构造内联列表时,在除最后一个选项之外的所有选项之间使用的字符串。

(继承自 TemplateBaseAttribute)
ChoiceStyle

在 \ref 模式字符串中处理时如何显示选项 {|}。

(继承自 TemplateBaseAttribute)
Feedback

控制用户在每次输入后获得的反馈类型。

(继承自 TemplateBaseAttribute)
FieldCase

在 \ref 模式字符串中显示 {&} 字段名称引用时,控制大小写。

(继承自 TemplateBaseAttribute)
IsLocalizable

如此 如果属性是可本地化的。

(继承自 FormFlowAttribute)
LastSeparator

在 \ref 模式字符串中使用 {[]} 构造列表时,在列表中的最后一个值之前使用的字符串。

(继承自 TemplateBaseAttribute)
Patterns

所有可能的模板。

(继承自 TemplateBaseAttribute)
Separator

在 \ref 模式字符串中使用 {[]} 构造列表时,在除最后一个之外的所有值之间使用的字符串。

(继承自 TemplateBaseAttribute)
ValueCase

在 \ref 模式字符串中显示 {} 值引用时的控制用例。

(继承自 TemplateBaseAttribute)

方法

ApplyDefaults(TemplateBaseAttribute)

提供的 将覆盖 defaultTemplate此模板中的任何默认值。

(继承自 TemplateBaseAttribute)
Pattern()

使用 IPrompt<T>生成字符串时要使用的模式。

(继承自 TemplateBaseAttribute)

适用于