TermsAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
属性覆盖用于匹配字段、属性或枚举值与用户输入匹配的默认术语。
[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
- 继承
- 属性
注解
默认情况下,术语通过调用 GenerateTerms(String, Int32) 该方法,在字段、属性或枚举值的名称上,短语长度为3。 利用该属性,你可以指定自己的正则表达式以匹配,或者如果你指定属性, MaxPhrase 可以使 GenerateTerms(String, Int32) 字符串被调用,使用你指定的最大短语长度。 如果你的术语是简单的字母数字,那么只有在词边界上用\b匹配,除非你用括号开头表达式,否则你通过正则表达式控制边界匹配行为。
构造函数
| 名称 | 说明 |
|---|---|
| TermsAttribute(String[]) |
匹配用户输入时使用的正则表达式或术语。 |
字段
| 名称 | 说明 |
|---|---|
| Alternatives |
正则表达式用于匹配用户输入。 |
属性
| 名称 | 说明 |
|---|---|
| IsLocalizable |
如果属性是可局部化的,则为真。 (继承自 FormFlowAttribute) |
| MaxPhrase |
在你提供的条款下拨打电话 GenerateTerms(String, Int32) 时,最长的时长是多少。 |