語言

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 來匹配,除非你用括號開頭,這時你就可以透過正則表達式來控制邊界匹配行為。

建構函式

名稱 Description
TermsAttribute(String[])

用來匹配使用者輸入時使用的正則表達式或術語。

欄位

名稱 Description
Alternatives

用來匹配使用者輸入的正則表達式。

屬性

名稱 Description
IsLocalizable

如果屬性是可局部化的,那就成立。

(繼承來源 FormFlowAttribute)
MaxPhrase

在你提供的條款下, GenerateTerms(String, Int32) 應使用的最大通話長度。

適用於