using System; using System.Collections.Generic; using System.Drawing; namespace Core.Common.Controls { /// /// Interface for tree nodes /// public interface ITreeNode : IDisposable { /// /// Returns the object bound to this node /// object Tag { get; set; } /// /// Returns the label for this node /// string Text { get; set; } /// /// The icon of this node /// Image Image { get; set; } /// /// Gets or sets a value that indicates whether a check box is displayed next to the node /// bool ShowCheckBox { get; set; } /// /// Gets or sets a value indicating whether the tree node is in a checked state /// bool Checked { get; set; } /// /// Node can be hidden in the tree view /// bool IsVisible { get; set; } /// /// Font bold setting /// bool Bold { get; set; } /// /// Background color of tree node /// Color BackgroundColor { set; get; } /// /// Font color of tree node. /// Color ForegroundColor { set; get; } /// /// The tree view that holds the node /// ITreeView TreeView { get; } /// /// Node presenter used to visualize this node. /// ITreeNodePresenter Presenter { get; set; } /// /// Returns a list of child nodes for this node /// IList Nodes { get; } /// /// Parent node of the current node /// ITreeNode Parent { get; } /// /// Indicates whether child nodes have been created /// bool IsLoaded { get; } /// /// Drawing bounds of node /// Rectangle Bounds { get; } /// /// Gets the path from the root node to this node /// string FullPath { get; } /// /// Previous sibling tree node /// ITreeNode PreviousNode { get; } /// /// Previous visible tree node /// ITreeNode PreviousVisibleNode { get; } /// /// Next sibling tree node /// ITreeNode NextNode { get; } /// /// Next visible tree node /// ITreeNode NextVisibleNode { get; } /// /// Gets the zero-based depth of the tree node in the TreeView control /// int Level { get; } /// /// Gets a value indicating whether the tree node is in the expanded state /// bool IsExpanded { get; } bool IsUpdating { get; } bool IsEditing { get; } /// /// Expands the tree node /// void Expand(); /// /// Collapses the tree node /// void Collapse(bool ignoreChildren = true); /// /// Updates node and all it's sub-nodes based on their tag properties /// /// /// Use it only in case if you tag objects do not implement INotifyPropertyChanged interface. /// When object in tag of the root node implements this interface - tree node will call ITreeViewNodePresenter.OnNotifyPropertyChanged() /// /// /// TODO: rename to Refresh(bool refreshChildren = true) void Update(); /// /// Initiates the editing of the tree node label /// void BeginEdit(); /// /// Returns child node of the current node by tag /// /// ITreeNode GetNodeByTag(object item); /// /// Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary /// void ScrollTo(); /// /// Gets the parent of the node on the supplied (nesting) level /// /// Nesting level ITreeNode GetParentOfLevel(int level); void ShowContextMenu(Point location); void EnsureVisible(); } }