Share via


QuestionAnswerActivity.TurnStarting Event

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Occurs after the QuestionAnswerActivity selects the prompt to play.

Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
<GlobalizedDescriptionAttribute("QuestionAnswerActivity_TurnStarting")> _
<GlobalizedCategoryAttribute("SpeechEventsCategory")> _
Public Event TurnStarting As EventHandler(Of TurnStartingEventArgs)
[GlobalizedDescriptionAttribute("QuestionAnswerActivity_TurnStarting")] 
[GlobalizedCategoryAttribute("SpeechEventsCategory")] 
public event EventHandler<TurnStartingEventArgs> TurnStarting

Example

The following code example shows the creation of a QuestionAnswerActivity instance, askDrink. After askDrink is created, a number of its properties are set. In the highlighted line of code, TurnStarting is registered to be handled by askDrink_TurnStarting, the event handler for this event.

this.askDrink = new Microsoft.SpeechServer.Dialog.QuestionAnswerActivity();
this.askDrink.CanBargeIn = true;
this.askDrink.CompleteTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.askDrink.InitialSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.askDrink.Name = "AskDrink";
this.askDrink.TurnStarting += new System.EventHandler<Microsoft.SpeechServer.Dialog.TurnStartingEventArgs>(this.askDrink_TurnStarting);
askDrink.Prompts.HelpPrompt.AppendText(GetPromptResource("askDrink_HelpPrompt"));
askDrink.MainPrompt.AppendText(GetPromptResource("askDrink_MainPrompt"));
askDrink.Grammars.Add(new Microsoft.SpeechServer.Recognition.Grammar(new System.Uri("Grammars\\Drinks.grxml", System.UriKind.RelativeOrAbsolute), "Drinks"));
askDrink.DtmfGrammars.Add(new Microsoft.SpeechServer.Recognition.Grammar(new System.Uri("Grammars\\DigitsDTMF.grxml", System.UriKind.RelativeOrAbsolute), "digit"));
this.Activities.Add(this.askDrink);

Remarks

The activity selects the prompt to play (such as main, silence, and escalated silence) before raising this event. This selection is based on the dialog history. The selection is available from the PromptType property on TurnStartingEventArgs.

Application developers can change the prompt by attaching an event handler to this event and providing the prompt in the event arguments.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

QuestionAnswerActivity Class
QuestionAnswerActivity Members
Microsoft.SpeechServer.Dialog Namespace
PromptType
TurnStartingEventArgs