Compartir a través de


ListSelector Remarks for French (Canada)

  Microsoft Speech Technologies Homepage

Dynamically creates a grammar containing a list of text items and asks the user to select a single item from the list.

Implements IDtmf.

The ListSelector is a data-bound control, and must be initialized programmatically like any other data-bound control, such as the ASP.NET DataGrid control. For more information about ASP.NET data binding, see Accessing Data with ASP.NET.

If the DataSource of the ListSelector contains no items from which to choose, the control renders no client code.

Execution flow

QA controls in the ListSelector are activated in SpeechIndex order as follows:

SpeechIndex QA
1 Confirm
2 Question
3 Done

When RunSpeech activates the ListSelector control, it evaluates each internal QA control in the order of its SpeechIndex property, as shown in the preceding table, and determines if it should be activated. During the initial evaluation, the internal QA controls that perform confirmation typically have no data to confirm, and they are evaluated but not activated.

Default prompts

The following table shows the default prompts and suggested Help prompts corresponding to each phase of the ListSelector control's user interaction, as indicated by the value of the control's ActiveQAPhase property.

The default prompts shown in this table are built into the control, and the control plays them automatically. Authors can use the PromptSelectFunction routine to specify custom text that overrides the default prompts. By default these prompts play as TTS, which is not desirable if the other prompts in the application are recorded. For information on how to record the default prompts in this control, see Importing and Exporting Transcriptions.

The Help prompts shown in this table are suggestions only. It is the responsibility of application authors to create Command Dialog Speech Controls that play Help prompts more or less equivalent to those shown in the table. In order to play Help prompts, authors must define a Command control with a scope that includes the ListSelector control, a Type property of "Help" and an XPathTrigger property of "/SML/Help".

The QuestionPrompt property must be set by the application author, or the control will raise an exception.

Each Application Speech Control has one or more properties of the SemanticItem type, which contain text recognized from user responses. That text is included in certain default prompts.

Question QA control
Prompt: QuestionPrompt.value
Help: "Choose an item from the following list " + (list of items) + QuestionPrompt.value
Confirm QA control
Prompt: 1 "m'avez-vous dit " + SemanticItem.value + "?"
Prompt: 2 SemanticItem.value + "?"
Help: "s'il-vous-plaît, dites oui ou non, ou donnez-moi la bonne option."
All QA controls
Silence: "je ne vous ai pas entendue."
NoReco: "je ne vous ai pas compris."

1: Normal confirmation mode
2: Short time-out confirmation mode

Default grammar

The default grammar lists in parallel all the objects in the data source. The control puts the binding value that corresponds to the recognized value into the target element attribute.

The grammar can be expanded by providing a pipe-separated list of synonyms rather than a single element. Users can then select the list items using any of the synonym names. If the synonym list contains duplicates, the control throws an ArgumentException.

Authors can override the default grammar by providing a grammar template. This template is called with the data contained in the data source. This data can be used to create a specific grammar. The following example demonstrates how users can refer to a person in different ways. A person can be referenced as "Nancy," "Davolio," or "Nancy Davolio," assuming the data source contains a FirstName and LastName column:

<grammarTemplate>
  <%# DataBinder.Eval(Container.DataItem, "LastName") %>
  |
  <%# DataBinder.Eval(Container.DataItem, "FirstName") %>
  |
  <%# DataBinder.Eval(Container.DataItem, "FirstName") %>
  <%# DataBinder.Eval(Container.DataItem, "LastName") %>
</grammarTemplate>

The following example demonstrates how to retrieve the grammar from a resource, assuming that a resource manager has been initialized and the data source contains a LastName column:

<grammarTemplate>
  <%# ResourceManager.GetString(DataBinder.Eval(Container.DataItem, "LastName")) %>
</grammarTemplate>

Default commands

Application Speech Controls require Command Dialog Speech Controls to play help prompts. In order to play help prompts, the following conditions must be met:

  • the Application Speech Control must be within the scope of a Command control
  • the type of the Command control must be "Help"
  • the xPathTrigger property of the Command control must be "/SML/Help"

If these conditions are not met, the Application Speech Control cannot play help prompts.

Examples

Control: "veuillez choisir une garniture"
User: "champignons"
Control: "veuillez choisir une garniture"
User: "aide"
Control: "vous pouvez choisir parmi pepperoni, champignons et anchois"
User: "pepperoni"

See Also

ListSelector Class | ListSelector Constructor | ListSelector Members | ListSelector Properties | ListSelector Methods | ListSelector Events