Class TreeView<T>
- Namespace
- Skyline.DataMiner.Utils.InteractiveAutomationScript
- Assembly
- Skyline.DataMiner.Utils.InteractiveAutomationScriptToolkit.dll
A generic tree view structure that allows attaching custom metadata to each item.
public class TreeView<T> : TreeViewBase, ITreeView<T>, ITreeViewBase, IIsReadonlyWidget
Type Parameters
TThe type of the value associated with each tree view item.
- Inheritance
-
TreeView<T>
- Implements
-
ITreeView<T>
- Inherited Members
- Extension Methods
Constructors
- TreeView()
Initializes a new instance of the TreeView<T> class.
- TreeView(IEnumerable<TreeViewItem<T>>)
Initializes a new instance of the TreeView<T> class.
Properties
- CheckedItems
Gets all items in the tree view that are selected.
- CheckedLeafValues
Gets the values of all leaves in the tree view that are selected.
- CheckedLeaves
Gets all leaves (= items without children) in the tree view that are selected.
- CheckedNodeValues
Gets the values of all nodes in the tree view that are selected.
- CheckedNodes
Gets all nodes (= items with children) in the tree view that are selected.
- CheckedValues
Gets the values of all items in the tree view that are selected.
- Items
Gets or sets the top-level items in the tree view. The TreeViewItem.ChildItems property can be used to navigate further down the tree.
Methods
- Collapse()
Sets the IsCollapsed state for all items in the tree view to true, causing the entire tree view to be collapsed.
- Expand()
Sets the IsCollapsed state for all items in the tree view to false, causing the entire tree view to be expanded.
- GetAllItems()
Iterates over all items in the tree and returns them in a flat collection.
- GetItems(int)
Returns all items in the tree view that are located at the provided depth. Whenever the requested depth is greater than the longest branch in the tree, an empty collection will be returned.
- LoadResult(IUIResults, ILogger)
Load any changes made through user interaction.
- RaiseResultEvents(ILogger)
Raises zero or more events of the widget. This method is called after LoadResult(IUIResults, ILogger) was called on all widgets.
- TryFindTreeViewItem(string, out TreeViewItem<T>)
Can be used to retrieve an item from the tree view based on its key value.
- UpdateItemCache()
This method is used to update the cached TreeViewItems and lookup table. This is done after loading the results from the UI Block, after handling the Events or when setting the Items. This method should only be called from outside the TreeView if you are checking or collapsing items from outside of the TreeView and need to access the CheckedItems or CollapsedItems.
Events
- Changed
Triggered when a different item is selected or no longer selected. WantsOnChange will be set to true when this event is subscribed to.
- Checked
Triggered whenever an item is selected. WantsOnChange will be set to true when this event is subscribed to.
- Collapsed
Triggered whenever an item is collapsed. Will be triggered whenever a node with SupportsLazyLoading set to true is collapsed.
- Expanded
Triggered whenever an item is expanded. Can be used for lazy loading. Will be triggered whenever a node with SupportsLazyLoading set to true is expanded.
- Unchecked
Triggered whenever an item is no longer selected. WantsOnChange will be set to true when this event is subscribed to.