MenuActivity Class
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.
Gets and confirms a single selection from a short list of options.
Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)
Syntax
'Declaration
<GlobalizedDescriptionAttribute("MenuActivity")> _
<DesignerSerializerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.GenericSpeechCodeDomSerializer, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", GetType(CodeDomSerializer))> _
<DesignerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.SpeechExpandableDesigner, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", GetType(IDesigner))> _
<ToolboxBitmapAttribute(GetType(MenuActivity))> _
<ActivityValidatorAttribute(GetType(MenuActivityValidator))> _
<GlobalizedCategoryAttribute("MSSCategory")> _
<DesignerSerializerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.SpeechActivityMarkupSerializer, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", GetType(WorkflowMarkupSerializer))> _
Public NotInheritable Class MenuActivity
Inherits SpeechCompositeActivity
Implements IActivityEventListener(Of ActivityExecutionStatusChangedEventArgs)
[GlobalizedDescriptionAttribute("MenuActivity")]
[DesignerSerializerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.GenericSpeechCodeDomSerializer, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", typeof(CodeDomSerializer))]
[DesignerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.SpeechExpandableDesigner, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", typeof(IDesigner))]
[ToolboxBitmapAttribute(typeof(MenuActivity))]
[ActivityValidatorAttribute(typeof(MenuActivityValidator))]
[GlobalizedCategoryAttribute("MSSCategory")]
[DesignerSerializerAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.SpeechActivityMarkupSerializer, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", typeof(WorkflowMarkupSerializer))]
public sealed class MenuActivity : SpeechCompositeActivity, IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
Remarks
Using the MenuActivity class, you can select an option from a relatively short list of options. For longer option lists, consider using NavigableListActivity.
A MenuActivity consists of two phases: a recognition (or get) phase and a confirmation phase. The default get-phase grammars recognize "that one" and the menu options. The default confirmation-phase grammars recognize "yes" and "no" and perform dynamic correction based on the results from the get-phase recognition. Default grammars for the get phase and confirmation phase are generated automatically.
For an example of dynamic correction, suppose that the semantic value obtained in the get phase is "red," which generates a confirmation prompt of "Did you say red?" A user response of "No, blue" causes a denial of the semantic value "red" and resets the semantic value to "blue." If the confidence in this utterance is less than or equal to the value in ConfirmationThreshold, the confirmation phase restarts. If the confidence in this utterance is greater than the value in ConfirmationThreshold, MenuActivity exits with RecognitionResult reflecting the new semantic value.
The options available for the menu are bound from DataSource.
There are default grammars for MenuActivity for each language that ships with Speech Server. For information about the default grammars for a particular language, see:
Inheritance Hierarchy
System.Object
???? System.Workflow.ComponentModel.DependencyObject
???????? System.Workflow.ComponentModel.Activity
???????????? System.Workflow.ComponentModel.CompositeActivity
???????????????? Microsoft.SpeechServer.Dialog.SpeechCompositeActivity
????????????????????Microsoft.SpeechServer.Dialog.MenuActivity
Thread Safety
All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.
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
MenuActivity Members
Microsoft.SpeechServer.Dialog Namespace
NavigableListActivity
ConfirmationThreshold
RecognitionResult
DataSource