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
TForm 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 ( 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.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >.

Task<bool> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldPrompt< T >.DefineAsync ( state)
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.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

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

Get this field value from form state.

Parameters
stateForm state to get field value from.
Returns
Current value found in state.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.FieldReflector< T >.

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.IsUnknown ( state)
inherited

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

Parameters
stateForm 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.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.FieldReflector< T >, Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >.

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

Limits of numeric values.

Parameters
minMinimum possible value.
maxMaximum possible value.
Returns
True if limits limit the underlying data type.

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

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

void Microsoft.Bot.Builder.FormFlow.Advanced.IFieldResources.Localize ( )
inherited

Loads any string resources from the form localizer.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

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

Next step to execute.

Parameters
valueValue in response to prompt.
stateCurrent form state.
Returns
Next step to execute.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >.

void Microsoft.Bot.Builder.FormFlow.Advanced.IFieldResources.SaveResources ( )
inherited

Adds any string resources to form localizer.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

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

Set this field value in form state to unknown.

Parameters
stateForm 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.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.FieldReflector< T >, Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >.

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

Set this field value in form state.

Parameters
stateForm state to set field value in.
valueNew value.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >, Microsoft.Bot.Builder.FormFlow.Advanced.Confirmation< T >, and Microsoft.Bot.Builder.FormFlow.Advanced.FieldReflector< T >.

Return a template for building a prompt.

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

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

IEnumerable<string> 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
valueValue that would result from a match.
Returns
Enumeration of regex.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

Task<ValidateResult> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldPrompt< T >.ValidateAsync ( state,
object  value 
)
inherited

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

Parameters
stateState before setting value.
valueValue 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.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

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

Return the description of a specific value.

Parameters
valueValue being described.
Returns
Description of value.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Field< T >.

Property Documentation

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.AllowDefault
getinherited

Allow the default value as an option.

Returns
True if default values are allowed.

Definition at line 217 of file IField.cs.

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.AllowNumbers
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.

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.AllowsMultiple
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.

IEnumerable<string> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.Dependencies
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.

DescribeAttribute Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.FieldDescription
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.

IEnumerable<string> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.FieldTerms
getinherited

Terms for matching this field.

Returns
List of term regex for matching the field name.

Definition at line 178 of file IField.cs.

Form that owns this field

Definition at line 420 of file IField.cs.

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.

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.IsNullable
getinherited

Test to see if field is nullable.

Returns
True if field is nullable.

Definition at line 99 of file IField.cs.

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.

bool Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.Optional
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.

string Microsoft.Bot.Builder.FormFlow.Advanced.IFieldState< T >.Pattern
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.

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.

FieldRole Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.Role
getinherited

Role field plays in a form.

Returns
Role field plays in form.

Definition at line 163 of file IField.cs.

Gets the type of the field.

The type.

Definition at line 87 of file IField.cs.

IEnumerable<DescribeAttribute> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.ValueDescriptions
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<object> Microsoft.Bot.Builder.FormFlow.Advanced.IFieldDescription.Values
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: