Partager via


MenuActivity.DataBind Method

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.

Binds the MenuActivity to its DataSource.

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

Syntax

'Declaration
Public Sub DataBind
public void DataBind ()

Exceptions

Exception type Condition
InvalidOperationException

The MenuActivity is not in the idle state, and data cannot be bound to the MenuActivity.

ArgumentException

DataSource contains no data.

Example

This example demonstrates how a string array can serve as the data source for a MenuActivity instance named chooseSize. In the highlighted line of code, DataSource is set with the array variable, sizeChoices. The next line of code calls DataBind, which binds chooseSize to its data source.

private string[] sizeChoices = new string[3] { "small", "medium", "large" };
public Workflow1()
{
  InitializeComponent();
  this.chooseSize.DataSource = sizeChoices;
  this.chooseSize.DataBind();
}

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 Class
MenuActivity Members
Microsoft.SpeechServer.Dialog Namespace
DataSource
DataMember
DataField