Microsoft.Bot.Builder.FormFlow.TermsAttribute Class Reference

Attribute to override the default terms used to match a field, property or enum value to user input. More...

Inheritance diagram for Microsoft.Bot.Builder.FormFlow.TermsAttribute:

Public Member Functions

 TermsAttribute (params string[] alternatives)
 Regular expressions or terms used when matching user input. More...
 

Public Attributes

string[] Alternatives
 Regular expressions for matching user input. More...
 

Properties

bool IsLocalizable [get, set]
 True if attribute is localizable. More...
 
int MaxPhrase [get, set]
 The maximum pharse length to use when calling Advanced.Language.GenerateTerms(string, int) on your supplied terms. More...
 

Detailed Description

Attribute to override the default terms used to match a field, property or enum value to user input.

By default terms are generated by calling the Advanced.Language.GenerateTerms(string, int) method with a max phrase length of 3 on the name of the field, property or enum value. Using this attribute you can specify your own regular expressions to match or if you specify the MaxPhrase attribute you can cause Advanced.Language.GenerateTerms(string, int) to be called on your strings with the maximum phrase length you specify. If your term is a simple alphanumeric one, then it will only be matched on word boundaries with unless you start your expression with parentheses in which case you control the boundary matching behavior through your regular expression.

Definition at line 119 of file Attributes.cs.

Constructor & Destructor Documentation

Microsoft.Bot.Builder.FormFlow.TermsAttribute.TermsAttribute ( params string[]  alternatives)
inline

Regular expressions or terms used when matching user input.

If MaxPhrase is specified the supplied alternatives will be passed to Advanced.Language.GenerateTerms(string, int) to generate regular expressions with a maximum phrase size of MaxPhrase.

Parameters
alternativesRegular expressions or terms.

Definition at line 151 of file Attributes.cs.

Member Data Documentation

string [] Microsoft.Bot.Builder.FormFlow.TermsAttribute.Alternatives

Regular expressions for matching user input.

Definition at line 124 of file Attributes.cs.

Property Documentation

bool Microsoft.Bot.Builder.FormFlow.FormFlowAttribute.IsLocalizable
getsetinherited

True if attribute is localizable.

Attributes that are used on classes, fields and properties should have this set. That way those attributes will be in the localization files that are generated.

Definition at line 54 of file Attributes.cs.

int Microsoft.Bot.Builder.FormFlow.TermsAttribute.MaxPhrase
getset

The maximum pharse length to use when calling Advanced.Language.GenerateTerms(string, int) on your supplied terms.

Definition at line 131 of file Attributes.cs.


The documentation for this class was generated from the following file: