Partager via


MenuActivity.DataSource Property

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 or sets the data source from which menu options are drawn.

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

Syntax

'Declaration
<ReadOnlyAttribute(True)> _
<DefaultValueAttribute(Nothing)> _
<TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.EditFromCodeBesideStringConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")> _
<GlobalizedCategoryAttribute("DataBindingCategory")> _
<GlobalizedDescriptionAttribute("DataBindingCommon_DataSource")> _
Public Property DataSource As Object
[ReadOnlyAttribute(true)] 
[DefaultValueAttribute(null)] 
[TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.EditFromCodeBesideStringConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")] 
[GlobalizedCategoryAttribute("DataBindingCategory")] 
[GlobalizedDescriptionAttribute("DataBindingCommon_DataSource")] 
public Object DataSource { get; set; }

Property Value

The data source from which menu options are drawn. The default value is null.

Remarks

DataSource should implement System.Collections.IEnumerable or System.ComponentModel.IListSource.

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
MenuActivity.DataBind Method
MenuActivity.DataSourceProperty Field