OPCHDA.NET Reference Manual
BrowseHDATree Class Members
See Also  Fields  Properties  Methods  Send Feedback
OpcHDAWrapperUA.Net4 Assembly > OPCHDA.NET Namespace : BrowseHDATree Class

Glossary Item Box

The following tables list the members exposed by BrowseHDATree.

Public Constructors

 NameDescription
Public ConstructorBrowseHDATree ConstructorOverloaded.   
Top

Public Fields

 NameDescription
Public FieldImageIndexBranch Index of the image displayed for branches  
Public FieldImageIndexBranchSelected Index of the image displayed for the selected branch  
Public FieldImageIndexItem  
Public FieldItemCodeIndexCode used to identify items and branches in TreeNode.ImageIndex
Default: Item: >= 2
 
Top

Public Properties

 NameDescription
Public PropertyBrowseModeOneLevel Defines the browse mode. TRUE: The initial browse does browse only the root node FALSE: The initial browse does browse the complete server structure. With some servers this may take a long time and generate a huge structure. The constructor initializes this property to TRUE if a TreeView object is passed.  
Public PropertyImageList This readOnly property contains the ImageList with icons displayed in the TreeView with the items and branches.  
Top

Public Methods

 NameDescription
Public MethodBrowseOverloaded. Browse all branches/leafs from the defined branch and build a TreeNode structure.
The HDA browser assigned to this object is used. The browsing is done with the filters defined for this HDA browser.
If the OneLevelBrowseMode property is true, then only the specified branch is browsed. Otherwise the server is browsed recursively from the defined start branch.
The created TreeNode structure contains on each level all the items and sub-branches. Use the methods isItem() and isBranch() to determine what a specific TreeNode object represents.
The TreeNode Tag property contains the fully qualified name of this node (item or branch).  
Public MethodConvertToTreeListConvert the TreeNode structure into a TreeNode structue with branches only. The items are in a ListView structure that is referenced from the TreeNode Tag.
The TreeNode Tag property of branch nodes is changed to contain a tlNodeInfo object. This object contains the fully qualified name of the branch and a ListViewItem array with all items in this branch.  
Public MethodCreateTreeBrowse the server from the root and build a TreeNode structure with all branches and items.
Depending on the property OneLevelBrowseMode, this is done in the initial browse (when FALSE) or incrementally when a branch is selected for the first time (when TRUE). This method does the actual server browsing. It has to be called before any of the other methods can be used. The server is browsed from the root and the browse result is stored in a class internal TreeNode structure. Derived classes handle the browse result in different ways. Use the Root() method to get the created TreeNode[] object and handle is application specific.
The created TreeNode structure contains on each level all the items and sub-branches. Use the methods isItem() and isBranch() to determine what a specific TreeNode object represents.
The TreeNode Tag property contains the fully qualified name of this node (item or branch).  
Public MethodDispose This method must be called to uninstall the TreeView mouse event handler.  
Public MethodisBranch Checks if a node is a branch or a leaf.  
Public MethodisLeaf Checks if a node is a leaf or a branch  
Public MethodItemName

Get the full name of the item/branch in the specified branch.

This method is typically used to get the name of the node selected in a TreeView.

C# sample:

TreeNode sel = e.Node ;
string selItem = ItemTree.ItemName( sel ) ;

VB sample:

Dim sel As TreeNode
sel = e.Node
Dim selItem As String
selItem = ItemTree.ItemName(sel)

 
Public MethodRoot

Get the TreeNode structure with the browsed server structure.

C# sample:

OPCHDABrowser browser;
int[] err;
int rtc = OpcSrv.CreateBrowse( null, null, null, out browser, out err );
BrowseTree ItemTree = new BrowseTree( browser );
ItemTree.CreateTree(); // Browse server from root
treeviewItems.Nodes.AddRange( ItemTree.Root() );

VB sample:

Dim browser As OPCHDABrowser
Dim err as Int32()
Dim rtc As Int32 = OpcSrv.CreateBrowse( Nothing,Nothing,Nothing, browser, err )
Dim ItemTree As BrowseTree = New BrowseTree( browser )
ItemTree.CreateTree() ' Browse server from root
treeviewItems.Nodes.AddRange(ItemTree.Root())

 
Public MethodShowImageList Show all images defined in the BrowseTree ImageList  
Top

See Also

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.