Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T > Class Template Referenceabstract

Abstract base class for Form Builders. More...

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

Public Member Functions

abstract IFormBuilder< T > AddRemainingFields (IEnumerable< string > exclude=null)
 Add all fields not already added to the form. More...
 
virtual IForm< T > Build (Assembly resourceAssembly=null, string resourceName=null)
 Build the form based on the methods called on the builder. More...
 
virtual IFormBuilder< T > Confirm (string prompt, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Add a confirmation step. More...
 
virtual IFormBuilder< T > Confirm (PromptAttribute prompt, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Add a confirmation step. More...
 
virtual IFormBuilder< T > Confirm (MessageDelegate< T > generateMessage, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Generate a confirmation using a delegate to dynamically build the message. More...
 
virtual IFormBuilder< T > Field (IField< T > field)
 Derfine a field step by supplying your own field definition. More...
 
abstract IFormBuilder< T > Field (string name, ActiveDelegate< T > active=null, ValidateAsyncDelegate< T > validate=null)
 Define a step for filling in a particular value in the form state. More...
 
abstract IFormBuilder< T > Field (string name, string prompt, ActiveDelegate< T > active=null, ValidateAsyncDelegate< T > validate=null)
 Define a step for filling in a particular value in the form state. More...
 
abstract IFormBuilder< T > Field (string name, PromptAttribute prompt, ActiveDelegate< T > active=null, ValidateAsyncDelegate< T > validate=null)
 Define a step for filling in a particular value in the form state. More...
 
bool HasField (string name)
 Test to see if there is already a field with name . More...
 
virtual IFormBuilder< T > Message (string message, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Show a message that does not require a response. More...
 
virtual IFormBuilder< T > Message (PromptAttribute prompt, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Show a message with more format control that does not require a response. More...
 
virtual IFormBuilder< T > Message (MessageDelegate< T > generateMessage, ActiveDelegate< T > condition=null, IEnumerable< string > dependencies=null)
 Generate a message using a delegate to dynamically build the message. More...
 
virtual IFormBuilder< T > OnCompletion (OnCompletionAsyncDelegate< T > callback)
 Delegate to call when form is completed. More...
 
virtual IFormBuilder< T > Prompter (PromptAsyncDelegate< T > prompter)
 Delegate to send prompt to user. More...
 

Properties

FormConfiguration Configuration [get]
 

Detailed Description

Abstract base class for Form Builders.

Template Parameters
TForm state class.
Type Constraints
T :class 

Definition at line 55 of file FormBuilder.cs.

Member Function Documentation

abstract IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.AddRemainingFields ( IEnumerable< string >  exclude = null)
pure virtual

Add all fields not already added to the form.

Parameters
excludeFields not to include.
Returns
Modified IFormBuilder.

This will add all fields defined in your form that have not already been added if the fields are supported.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Implemented in Microsoft.Bot.Builder.FormFlow.FormBuilder< T >, and Microsoft.Bot.Builder.FormFlow.Json.FormBuilderJson.

virtual IForm<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Build ( Assembly  resourceAssembly = null,
string  resourceName = null 
)
inlinevirtual

Build the form based on the methods called on the builder.

Parameters
resourceAssemblyAssembly for localization resources.
resourceNameName of resources to use for localization.
Returns
The constructed form.

The default assembly is the one that contains T and the default resourceName if the name of that type.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Reimplemented in Microsoft.Bot.Builder.FormFlow.FormBuilder< T >, and Microsoft.Bot.Builder.FormFlow.Json.FormBuilderJson.

Definition at line 58 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Confirm ( string  prompt,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Add a confirmation step.

Parameters
promptPrompt to use for confirmation.
conditionDelegate to test if confirmation applies to the current form state.
dependenciesWhat fields this confirmation depends on.
Returns
Modified IFormBuilder.

If prompt is not supplied the Pattern Language element {*} will be used to confirm. Dependencies will by default be all active steps defined before this confirmation.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 141 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Confirm ( PromptAttribute  prompt,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Add a confirmation step.

Parameters
promptPrompt to use for confirmation.
conditionDelegate to test if confirmation applies to the current form state.
dependenciesWhat fields this confirmation depends on.
Returns
Modified IFormBuilder.

Dependencies will by default be all active steps defined before this confirmation.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 146 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Confirm ( MessageDelegate< T >  generateMessage,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Generate a confirmation using a delegate to dynamically build the message.

Parameters
generateMessageDelegate for building message.
conditionWhether or not this step is active.
dependenciesWhat fields this confirmation depends on.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 157 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Field ( IField< T >  field)
inlinevirtual

Derfine a field step by supplying your own field definition.

Parameters
fieldField definition to use.
Returns
Modified IFormBuilder.

You can provide your own implementation of IField<T> or you can use the Field<T> class to provide fluent values, FieldReflector<T> to use reflection or Json.FieldJson to use JSON Schema.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 136 of file FormBuilder.cs.

abstract IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Field ( string  name,
ActiveDelegate< T >  active = null,
ValidateAsyncDelegate< T >  validate = null 
)
pure virtual

Define a step for filling in a particular value in the form state.

Parameters
namePath in the form state to the value being filled in.
activeDelegate to test form state to see if step is active.
validateDelegate to validate the field value.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Implemented in Microsoft.Bot.Builder.FormFlow.FormBuilder< T >.

abstract IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Field ( string  name,
string  prompt,
ActiveDelegate< T >  active = null,
ValidateAsyncDelegate< T >  validate = null 
)
pure virtual

Define a step for filling in a particular value in the form state.

Parameters
namePath in the form state to the value being filled in.
promptSimple Pattern Language to describe prompt for field.
activeDelegate to test form state to see if step is active.n
validateDelegate to validate the field value.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Implemented in Microsoft.Bot.Builder.FormFlow.FormBuilder< T >.

abstract IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Field ( string  name,
PromptAttribute  prompt,
ActiveDelegate< T >  active = null,
ValidateAsyncDelegate< T >  validate = null 
)
pure virtual

Define a step for filling in a particular value in the form state.

Parameters
namePath in the form state to the value being filled in.
promptPrompt pattern with more formatting control to describe prompt for field.
activeDelegate to test form state to see if step is active.n
validateDelegate to validate the field value.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Implemented in Microsoft.Bot.Builder.FormFlow.FormBuilder< T >.

bool Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.HasField ( string  name)
inline

Test to see if there is already a field with name .

Parameters
name
Returns
True if field is already present.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 113 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Message ( string  message,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Show a message that does not require a response.

Parameters
messageA Pattern Language string to fill in and send.
conditionWhether or not this step is active.
dependenciesFields message depends on.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 118 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Message ( PromptAttribute  prompt,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Show a message with more format control that does not require a response.

Parameters
promptMessage to fill in and send.
conditionWhether or not this step is active.
dependenciesFields message depends on.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 124 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Message ( MessageDelegate< T >  generateMessage,
ActiveDelegate< T >  condition = null,
IEnumerable< string >  dependencies = null 
)
inlinevirtual

Generate a message using a delegate to dynamically build the message.

Parameters
generateMessageDelegate for building message.
conditionWhether or not this step is active.
dependenciesFields message depends on.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 130 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.OnCompletion ( OnCompletionAsyncDelegate< T >  callback)
inlinevirtual

Delegate to call when form is completed.

Parameters
callbackDelegate to call on completion.
Returns
Modified IFormBuilder.

This should only be used for side effects such as calling your service with the form state results. In any case the completed form state will be passed to the parent dialog.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 168 of file FormBuilder.cs.

virtual IFormBuilder<T> Microsoft.Bot.Builder.FormFlow.FormBuilderBase< T >.Prompter ( PromptAsyncDelegate< T >  prompter)
inlinevirtual

Delegate to send prompt to user.

Parameters
prompterDelegate.
Returns
Modified IFormBuilder.

Implements Microsoft.Bot.Builder.FormFlow.IFormBuilder< T >.

Definition at line 174 of file FormBuilder.cs.

Property Documentation

Definition at line 111 of file FormBuilder.cs.


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