Microsoft.Bot.Builder.FormFlow.Advanced.IField< T > Interface Template Reference

Interface for all the information about a specific field. More...

Inheritance diagram for Microsoft.Bot.Builder.FormFlow.Advanced.IField< T >:

## Public Member Functions

bool Active (T state)
Test to see if field is currently active based on the current state. More...

Task< bool > DefineAsync (T state)
Build the prompt and recognizer for dynamically defined fields. More...

object GetValue (T state)
Get this field value from form state. More...

bool IsUnknown (T state)
Test to see if the field value form state has a value. More...

bool Limits (out double min, out double max)
Limits of numeric values. More...

void Localize ()
Loads any string resources from the form localizer. More...

NextStep Next (object value, T state)
Next step to execute. More...

void SaveResources ()
Adds any string resources to form localizer. More...

void SetUnknown (T state)
Set this field value in form state to unknown. More...

void SetValue (T state, object value)
Set this field value in form state. More...

TemplateAttribute Template (TemplateUsage usage)
Return a template for building a prompt. More...

IEnumerable< string > Terms (object value)
Given a value return terms that can be used in a dialog to match the object. More...

Task< ValidateResultValidateAsync (T state, object value)
Validate value to be set on state and return feedback if not valid. More...

DescribeAttribute ValueDescription (object value)
Return the description of a specific value. More...

## Properties

bool AllowDefault [get]
Allow the default value as an option. More...

bool AllowNumbers [get]
Allow user input to match numbers shown with enumerated choices. More...

bool AllowsMultiple [get]
Are multiple matches allowed. More...

IEnumerable< string > Dependencies [get]
Returns the other fields this one depends on. More...

DescribeAttribute FieldDescription [get]
Description of the field itself. More...

IEnumerable< string > FieldTerms [get]
Terms for matching this field. More...

IForm< T > Form [get, set]
Form that owns this field More...

IPrompt< T > Help [get]
Return the help description for this field. More...

bool IsNullable [get]
Test to see if field is nullable. More...

string Name [get]
Name of this field. More...

bool Optional [get]
Test to see if field is optional which means that an unknown value is legal. More...

string Pattern [get]
Regular expression for validating a string. More...

IPrompt< T > Prompt [get]
Returns the prompt description. More...

FieldRole Role [get]
Role field plays in a form. More...

Type Type [get]
Gets the type of the field. More...

IEnumerable< DescribeAttributeValueDescriptions [get]
Return all possible value descriptions in order to support enumeration. More...

IEnumerable< object > Values [get]
All possible values or null if it is a data type like number. More...

## Detailed Description

Interface for all the information about a specific field.

Template Parameters
 T Form state interface applies to.
Type Constraints
 T : class

Definition at line 404 of file IField.cs.

## Member Function Documentation

 bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldPrompt< T >.Active ( T state )
inherited

Test to see if field is currently active based on the current state.

Returns
True if field is active.

One way to control this is to supply a ActiveDelegate<T> to the IFormBuilder<T>.Field or IFormBuilder<T>.Confirm steps.

inherited

Build the prompt and recognizer for dynamically defined fields.

Returns
True if field is defined.

This method is called before asking for Prompt. This provides an opportunity to dynamically define the field based on the current state or external information. The IFieldState<T>.Dependencies method identifies fields that this one depends on. All of them will be complete before the field will be shown to the user, but this method might be called earlier in order to define the field for things like status and initial matching or validation.

 object Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.GetValue ( T state )
inherited

Get this field value from form state.

Parameters
 state Form state to get field value from.
Returns
Current value found in state.
 bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.IsUnknown ( T state )
inherited

Test to see if the field value form state has a value.

Parameters
 state Form state to check.
Returns
True if value is unknown.

For value types (numbers, bools, date time) a value is unknown only if the field is nullable and it is null. For enum based values (both simple and enumerated) they can also be nullable or the 0 enum value if not nullable. For non value types like string the test is to see if the field is actually null.

 bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.Limits ( out double min, out double max )
inherited

Limits of numeric values.

Parameters
 min Minimum possible value. max Maximum possible value.
Returns
True if limits limit the underlying data type.

This typically reflects the result of setting NumericAttribute limits on the possible values.

inherited

Loads any string resources from the form localizer.

 NextStep Microsoft.Bot.Builder.FormFlow.Advanced.IFieldPrompt< T >.Next ( object value, T state )
inherited

Next step to execute.

Parameters
 value Value in response to prompt. state Current form state.
Returns
Next step to execute.
inherited

Adds any string resources to form localizer.

 void Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.SetUnknown ( T state )
inherited

Set this field value in form state to unknown.

Parameters
 state Form state with field value to set to unknown.

For value types (numbers, bools, date time) the value is set to null if nullable. For enum types it is set to null if nullable or 0 if not. For non value types like string set the value to null.

 void Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.SetValue ( T state, object value )
inherited

Set this field value in form state.

Parameters
 state Form state to set field value in. value New value.
 TemplateAttribute Microsoft.Bot.Builder.FormFlow.Advanced.IFieldPrompt< T >.Template ( TemplateUsage usage )
inherited

Return a template for building a prompt.

Parameters
 usage Kind of template we are looking for.
Returns
NULL if no template, otherwise a template annotation.

 IEnumerable Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.Terms ( object value )
inherited

Given a value return terms that can be used in a dialog to match the object.

Parameters
 value Value that would result from a match.
Returns
Enumeration of regex.

inherited

Validate value to be set on state and return feedback if not valid.

Parameters
 state State before setting value. value Value to be set in field.
Returns
Result including feedback and if valid.

One way to control this is to supply a ValidateAsyncDelegate<T> to the IFormBuilder<T>.Field or IFormBuilder<T>.Confirm steps.

 DescribeAttribute Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.ValueDescription ( object value )
inherited

Return the description of a specific value.

Parameters
 value Value being described.
Returns
Description of value.

## Property Documentation

getinherited

Allow the default value as an option.

Returns
True if default values are allowed.

Definition at line 217 of file IField.cs.

getinherited

Allow user input to match numbers shown with enumerated choices.

Returns
True if numbers are allowed as input.

Definition at line 223 of file IField.cs.

getinherited

Are multiple matches allowed.

Returns
True if more than one value is allowed.

This is true is you have a list of enumerated values.

Definition at line 211 of file IField.cs.

getinherited

Returns the other fields this one depends on.

Returns
List of field names this one depends on.

This is mainly useful for Advanced.Confirmation<T> fields.

Definition at line 123 of file IField.cs.

getinherited

Description of the field itself.

Returns
Field description.

This is the value that will be used in Pattern Language by {&}, choices with {||} or buttons.

Definition at line 172 of file IField.cs.

getinherited

Terms for matching this field.

Returns
List of term regex for matching the field name.

Definition at line 178 of file IField.cs.

getset

Form that owns this field

Definition at line 420 of file IField.cs.

 getinherited

Return the help description for this field.

Returns
The prompt to use for generating help.

Help is a mixture of field specific help, what a recognizer understands and available commands.

Definition at line 389 of file IField.cs.

getinherited

Test to see if field is nullable.

Returns
True if field is nullable.

Definition at line 99 of file IField.cs.

get

Name of this field.

Returns
Name of this field.

For a value field this is the path in the form state that leads to the value being filled in. For a confirm field this is a randomly generated name.

Definition at line 415 of file IField.cs.

getinherited

Test to see if field is optional which means that an unknown value is legal.

Returns
True if field is optional.

Definition at line 93 of file IField.cs.

getinherited

Regular expression for validating a string.

Returns
Validation regular expression.

This typically reflects the result of setting PatternAttribute.

Definition at line 116 of file IField.cs.

getinherited

Returns the prompt description.

Returns
An IPrompt<T> describing prompt and recognizer.

If a prompt is dynamically computed this should be null until DefineAsync(T) is called.

Definition at line 354 of file IField.cs.

getinherited

Role field plays in a form.

Returns
Role field plays in form.

Definition at line 163 of file IField.cs.

getinherited

Gets the type of the field.

The type.

Definition at line 87 of file IField.cs.

getinherited

Return all possible value descriptions in order to support enumeration.

Returns
All possible value descriptions.

Definition at line 191 of file IField.cs.

 IEnumerable
getinherited

All possible values or null if it is a data type like number.

Returns
All possible values.

Definition at line 204 of file IField.cs.

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