NativeTree

Class Overview
Provides operations on windows of WindowClass type SysTreeView32.



public NativeTree(WindowControl src)
Explanation
Constructor.

Parameter
         src             
                A WindowControl object for the target window.
 



public NativeTree(WindowsAppFriend app, IntPtr windowHandle)
Explanation
Constructor.

Parameters
app
Application manipulation object.
windowHandle
Window handle.



public IntPtr[] Nodes{get;}
Explanation
Returns the item handles of the top-level nodes.



public IntPtr SelectedItem{get;}
Explanation
Returns the item handle of the selected item.



public void EmulateCancelEdit()
Explanation
Cancels editing.


public void EmulateCancelEdit(Async async)
Explanation
Cancels editing asynchronously.

Parameter
async
Asynchronous execution object



public void EmulateChangeItem(TVITEMEX item)
Explanation
Sets the value of an item.
Produces TVN_ITEMCHANGING and TVN_ITEMCHANGED notifications when the information in connection with a state changes, depending on the setup of the control.

Parameter
item
Item information.



public void EmulateChangeItem(TVITEMEX item, Async async)
Explanation
Sets the value of an item asynchronously.
Produces TVN_ITEMCHANGING and TVN_ITEMCHANGED notifications when the information in connection with a state changes, depending on the setup of the control.
Parameters
item
Item information.
async
Asynchronous execution object.


public  void EmulateCheck(IntPtr hItem, bool check)
Explanation
Sets the check state of the indicated item.
Produces TVN_ITEMCHANGING and TVN_ITEMCHANGED notifications if the check state changes, depending on the setup of the control.

Parameters
hItem
Item handle.
check
True to check.



public bool EmulateCheck(IntPtr hItem, bool check, Async async)
Explanation
Sets the check state of the indicated item asynchronously.
Produces TVN_ITEMCHANGING and TVN_ITEMCHANGED notifications if the check state changes, depending on the setup of the control.
Return value
Success or failure.

Parameters
hItem
Item handle.
check
True to check.
async
Asynchronous execution object.



public void EmulateEdit(IntPtr hItem, string text)
Explanation
Edits the text of the indicated item.
Produces TVN_BEGINLABELEDIT and TVN_ENDLABELEDIT notifications.

Parameters
hItem
Item handle.
text
Text to set.

 


public void EmulateEdit(IntPtr hItem, string text, Async async)
Explanation
Edits the text of the indicated item asynchronously.
Produces TVN_BEGINLABELEDIT and TVN_ENDLABELEDIT notifications.
Parameters
hItem
Item handle.
text
Text.
async
Asynchronous execution object.



public void EmulateExpand(IntPtr hItem, bool isExpanded)
Explanation
Sets the expanded or collapsed state of an item.
Produces TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notifications if the state changes.

Parameters
hItem
Item handle.
          isExpanded                 
                    True to expand.



public void EmulateExpand(IntPtr hItem, bool isExpanded, Async async)
Explanation
Sets the expanded or collapsed state of an item asynchronously.
Produces TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notifications if the state changes.
Parameters
hItem
Item handle.
          isExpanded                 
                    True to expand.
async
Asynchronous execution object.



public void EmulateSelectItem(IntPtr hItem)
Explanation
Sets the selected item.
Produces TVN_SELCHANGING and TVN_SELCHANGED notifications if the selection state changes.

Parameter
hItem
Item handle.



public void EmulateSelectItem(IntPtr hItem, Async async)
Explanation
Sets the selected item asynchronously.
Produces TVN_SELCHANGING and TVN_SELCHANGED notifications if the selection state changes.

Parameters
hItem
Item handle.
async
Asynchronous execution object.


public void EnsureVisible(IntPtr hItem)
Explanation
Makes the indicated item visible.

Parameter
hItem
Item handle.



public IntPtr FindNode(params string[] nodeText)
Explanation
Searches for a node.

Return value
The item handle of the found node or IntPtr.Zero if it is not found.

Parameter
          nodeText
                    The text of each node



public IntPtr FindNode(params int[] nodeIndex)
Explanation
Searches for a node.

Return value
The item handle of the found node or IntPtr.Zero if it is not found.

Parameter
          nodeIndex
                    The index of each node


public IntPtr[] GetBrotherNodes(IntPtr hItem)
Explanation
Returns sibling nodes of the indicated node.

Return value
The item handles of the nodes at the same level as the indicated node.

Parameter
hItem
Item handle



public IntPtr[] GetChildNodes(IntPtr hParentItem)
Explanation
Returns the child nodes of the indicated node.

Return value
The item handles of the child nodes.

Parameter
hParentItem
Parent item handle.



public bool GetItem(TVITEMEX item)
Explanation
Obtains item information

Return value
Success or failure.

Parameter
item
Item information.



public IntPtr GetItemData(IntPtr hItem)
Explanation
Obtains item data for an indicated item.

Return value
Item data.

Parameter
hItem
Item handle.


public Rectangle GetItemRect(IntPtr hItem, bool isTextOnly)
Explanation
Obtains an item's bounds.

Return value
Item boundary rectangle.

Parameters
hItem
Item handle.
isTextOnly
True to obtain bounds of only the text portion .



public string GetItemText(IntPtr hItem)
Explanation
Obtains an item's text.

Return value
Item text.

Parameter
hItem
Item handle.



public IntPtr GetParentNode(IntPtr hItem)
Explanation
Returns an item's parent node.

Return value
The item handle of the parent node

Parameter
hItem
Item handle.



public bool IsChecked(IntPtr hItem)
Explanation
Returns the indicated item's check state.

Return value
True if checked, false if unchecked.

Parameter
hItem
Item handle.



public bool IsExpanded(IntPtr hItem)
Explanation
Returns the indicated item's collapse/expand state.

Return value
True if the item is expanded, false if not.

Parameter
hItem
Item handle.

JR