Microsoft.Bot.Builder.FormFlow.TemplateAttribute Class Reference

Define a template for generating strings. More...

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

Public Member Functions

 TemplateAttribute (TemplateUsage usage, params string[] patterns)
 Specify a set of templates to randomly choose between for a particular usage. More...
 
 TemplateAttribute (TemplateAttribute other)
 Initialize from another template. More...
 
void ApplyDefaults (TemplateBaseAttribute defaultTemplate)
 Any default values in this template will be overridden by the supplied defaultTemplate . More...
 
string Pattern ()
 The pattern to use when generating a string using Advanced.IPrompt<T>. More...
 

Public Attributes

readonly TemplateUsage Usage
 What kind of template this is. More...
 

Properties

BoolDefault AllowDefault [get, set]
 When processing choices {||} in a Pattern Language string, provide a choice for the default value if present. More...
 
CaseNormalization ChoiceCase [get, set]
 Control case when showing choices in {||} references in a Pattern Language string. More...
 
string ChoiceFormat [get, set]
 Format string used for presenting each choice when showing {||} choices in a Pattern Language string. More...
 
string ChoiceLastSeparator [get, set]
 When constructing inline lists of choices using {||} in a Pattern Language string, the string used before the last choice. More...
 
BoolDefault ChoiceParens [get, set]
 When constructing inline choice lists for {||} in a Pattern Language string controls whether to include parentheses around choices. More...
 
string ChoiceSeparator [get, set]
 When constructing inline lists using {||} in a Pattern Language string, the string used between all choices except the last. More...
 
ChoiceStyleOptions ChoiceStyle [get, set]
 How to display choices {||} when processed in a Pattern Language string. More...
 
FeedbackOptions Feedback [get, set]
 Control what kind of feedback the user gets after each input. More...
 
CaseNormalization FieldCase [get, set]
 Control case when showing {&} field name references in a Pattern Language string. More...
 
bool IsLocalizable [get, set]
 True if attribute is localizable. More...
 
string LastSeparator [get, set]
 When constructing lists using {[]} in a Pattern Language string, the string used before the last value in the list. More...
 
string[] Patterns [get, set]
 All possible templates. More...
 
string Separator [get, set]
 When constructing lists using {[]} in a Pattern Language string, the string used between all values except the last. More...
 
CaseNormalization ValueCase [get, set]
 Control case when showing {} value references in a Pattern Language string. More...
 

Detailed Description

Define a template for generating strings.

Templates provide a pattern that uses the template language defined in Pattern Language. See TemplateUsage to see a description of all the different kinds of templates. You can also look at FormConfiguration.Templates to see all the default templates that are provided. Templates can be overriden at the form, class/struct of field level. They also support randomly selecting between templates which is a good way to introduce some variation in your responses.

Definition at line 571 of file Attributes.cs.

Constructor & Destructor Documentation

Microsoft.Bot.Builder.FormFlow.TemplateAttribute.TemplateAttribute ( TemplateUsage  usage,
params string[]  patterns 
)
inline

Specify a set of templates to randomly choose between for a particular usage.

Parameters
usageHow the template will be used.
patternsThe set of Pattern Language to randomly choose from.

Definition at line 583 of file Attributes.cs.

Microsoft.Bot.Builder.FormFlow.TemplateAttribute.TemplateAttribute ( TemplateAttribute  other)
inline

Initialize from another template.

Parameters
otherThe other template.

Definition at line 593 of file Attributes.cs.

Member Function Documentation

void Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ApplyDefaults ( TemplateBaseAttribute  defaultTemplate)
inlineinherited

Any default values in this template will be overridden by the supplied defaultTemplate .

Parameters
defaultTemplateDefault template to use to override default values.

Definition at line 779 of file Attributes.cs.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.Pattern ( )
inlineinherited

The pattern to use when generating a string using Advanced.IPrompt<T>.

If multiple patterns were specified, then each call to this function will return a random pattern.

Returns
Pattern to use.

Definition at line 756 of file Attributes.cs.

Member Data Documentation

readonly TemplateUsage Microsoft.Bot.Builder.FormFlow.TemplateAttribute.Usage

What kind of template this is.

Definition at line 576 of file Attributes.cs.

Property Documentation

BoolDefault Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.AllowDefault
getsetinherited

When processing choices {||} in a Pattern Language string, provide a choice for the default value if present.

Definition at line 684 of file Attributes.cs.

CaseNormalization Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceCase
getsetinherited

Control case when showing choices in {||} references in a Pattern Language string.

Definition at line 689 of file Attributes.cs.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceFormat
getsetinherited

Format string used for presenting each choice when showing {||} choices in a Pattern Language string.

The choice format is passed two arguments, {0} is the number of the choice and {1} is the field name.

Definition at line 695 of file Attributes.cs.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceLastSeparator
getsetinherited

When constructing inline lists of choices using {||} in a Pattern Language string, the string used before the last choice.

Definition at line 700 of file Attributes.cs.

BoolDefault Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceParens
getsetinherited

When constructing inline choice lists for {||} in a Pattern Language string controls whether to include parentheses around choices.

Definition at line 705 of file Attributes.cs.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceSeparator
getsetinherited

When constructing inline lists using {||} in a Pattern Language string, the string used between all choices except the last.

Definition at line 710 of file Attributes.cs.

ChoiceStyleOptions Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ChoiceStyle
getsetinherited

How to display choices {||} when processed in a Pattern Language string.

Definition at line 715 of file Attributes.cs.

FeedbackOptions Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.Feedback
getsetinherited

Control what kind of feedback the user gets after each input.

Definition at line 720 of file Attributes.cs.

CaseNormalization Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.FieldCase
getsetinherited

Control case when showing {&} field name references in a Pattern Language string.

Definition at line 725 of file Attributes.cs.

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.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.LastSeparator
getsetinherited

When constructing lists using {[]} in a Pattern Language string, the string used before the last value in the list.

Definition at line 730 of file Attributes.cs.

string [] Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.Patterns
getsetinherited

All possible templates.

Returns
The possible templates.

Definition at line 773 of file Attributes.cs.

string Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.Separator
getsetinherited

When constructing lists using {[]} in a Pattern Language string, the string used between all values except the last.

Definition at line 735 of file Attributes.cs.

CaseNormalization Microsoft.Bot.Builder.FormFlow.Advanced.TemplateBaseAttribute.ValueCase
getsetinherited

Control case when showing {} value references in a Pattern Language string.

Definition at line 740 of file Attributes.cs.


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