Browses the server and displays all branches in the TreeView control
and the items of the selected branch in the ListView control.
Browses the server and displays all branches in the TreeView control
and the items of the selected branch in the ListView control.
Object Model
Syntax
C# | |
---|
public class ShowBrowseTreeList |
Example
This class contains methods to browse the XML-DA server and display the branches in a TreeView control and the item of the selected branch in a ListView Control. In the ListView control multiple items can be selected, what's not possible in a TreeView control. |
 |
C# | Copy Code |
---|
string serverUrl = "http://tswinc.us/XMLDADemo/ts_sim/OpcDaGateway.asmx";
private void btnBrowseTreeList_Click(object sender, System.EventArgs e)
{
XmlServer Srv = new XmlServer( serverUrl );
try
{
OPCError[] err ;
ShowBrowseTreeList sbtl = new ShowBrowseTreeList( Srv, tvTree, lvItems );
//sbtl.BrowseModeOneLevel = false ; // force full initial browse
err = sbtl.Show( serverUrl ); // Url as root node name
if( (err != null) && (err.Length>0) )
MessageBox.Show( err[0].Text, "Error at Browse" );
}
catch( Exception ex )
{
MessageBox.Show( ex.Message, "Error at Browse" );
}
} |
Visual Basic | Copy Code |
---|
Dim serverUrl As String = "http://tswinc.us/XMLDADemo/ts_sim/OpcDaGateway.asmx"
Private Sub btnBrowseTreeList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnBrowseTreeList.Click
Dim Srv As XmlServer = New XmlServer(serverUrl)
Dim err As OPCError()
Try
Dim sbtl As ShowBrowseTreeList = New ShowBrowseTreeList(Srv, tvTree, lvItems)
' sbtl.BrowseModeOneLevel = False 'force full initial browse
err = sbtl.Show(serverUrl) ' Url as root node name
If Not err Is Nothing Then
If err.Length > 0 Then
MessageBox.Show(err(0).Text, "Error at Browse")
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "Error at Browse")
End Try
End Sub |
Inheritance Hierarchy
Requirements
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family
See Also