Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
3/12/2014
Constructs a Generic Data Acceptor that will fill a ListView control.
Namespace: Microsoft.RemoteToolSdk.PluginComponents
Assembly: Microsoft.RemoteToolSdk (in microsoft.remotetoolsdk.dll)
Syntax
public GenericDataAcceptor (
ListView listView
)
'Declaration
Public Sub New ( _
listView As ListView _
)
Parameters
- listView
ListView control to populate with the data passed into this object.
Remarks
If the ListView has two columns, the Description and Value fields from each call to AddItem() will be used.
If the ListView has three columns, the Category, Description and Value fields will be used.
Example
The following example function populates a ListView control with data from a plugin data object.
void FillListViewFromDataObject(
ListView lv,
PluginData data
)
{
//
// Suspend drawing for flicker free fun
//
lv.BeginUpdate();
//
// Set up auto-sizing columns
//
lv.View = View.Details;
lv.Columns.Clear();
lv.Columns.Add("Category", -1);
lv.Columns.Add("Description", -1);
lv.Columns.Add("Value", -2);
//
// Be sure to use the ClearItems() method in case the ListView
// already had something in it, unless you wanted to add the
// enumerated data to the end of the list.
//
lv.ClearItems();
//
// Build a Generic Data Acceptor that receives the data from
// the data object. The acceptor is given the ListView control,
// and the acceptor knows how to fill the control.
//
GenericDataAcceptor acceptor = new GenericDataAcceptor(lv);
//
// Call upon the data to feed the strings to the data acceptor.
//
data.RenderGeneric(acceptor);
//
// Resume drawing.
//
lv.EndUpdate();
}
See Also
Reference
GenericDataAcceptor Class
GenericDataAcceptor Members
Microsoft.RemoteToolSdk.PluginComponents Namespace