TermsAttribute 类

定义

用于替代用于将字段、属性或枚举值与用户输入匹配的默认术语的属性。

[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
[System.Serializable]
public class TermsAttribute : Microsoft.Bot.Builder.FormFlow.FormFlowAttribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
[<System.Serializable>]
type TermsAttribute = class
    inherit FormFlowAttribute
Public Class TermsAttribute
Inherits FormFlowAttribute
继承
TermsAttribute
属性

注解

默认情况下,通过在字段、属性或枚举值的名称上调用 GenerateTerms(String, Int32) 最大短语长度为 3 的 方法来生成术语。 使用此属性,可以指定要匹配的自己的正则表达式,或者如果指定 MaxPhrase 属性,则可能导致 GenerateTerms(String, Int32) 对具有指定的最大短语长度的字符串调用。 如果你的术语是一个简单的字母数字,则它只会在单词边界上与 \b 匹配,除非以括号开头的表达式,在这种情况下,通过正则表达式控制边界匹配行为。

构造函数

TermsAttribute(String[])

匹配用户输入时使用的正则表达式或术语。

字段

Alternatives

用于匹配用户输入的正则表达式。

属性

IsLocalizable

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

(继承自 FormFlowAttribute)
MaxPhrase

根据提供的术语调用 GenerateTerms(String, Int32) 时要使用的最大 pharse 长度。

适用于