共用方式為


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

如果屬性可當地語系化,則為 True。

(繼承來源 FormFlowAttribute)
MaxPhrase

在提供的字詞上呼叫 GenerateTerms(String, Int32) 時要使用的 pharse 長度上限。

適用於