/// <summary> Initalizes a new instance. </summary> public WebTreeNode(string itemID, string text, string toolTip, IconInfo icon) { ValidateItemId(itemID); _itemID = itemID; _text = text ?? string.Empty; _toolTip = toolTip ?? string.Empty; _icon = icon; _children = new WebTreeNodeCollection(null); _children.SetParent(null, this); }
/// <summary> Sets this node's <see cref="WebTreeView"/> and parent <see cref="WebTreeNode"/>. </summary> protected internal void SetParent(WebTreeView treeView, WebTreeNode parentNode) { _treeView = treeView; if (_selectDesired == 1) { _selectDesired = 0; IsSelected = true; } else if (_selectDesired == -1) { _selectDesired = 0; IsSelected = false; } _parentNode = parentNode; _children.SetParent(_treeView, this); if (_treeView != null) { _treeView.EnsureTreeNodeMenuInitialized(this); } }
public WebTreeNode() { _children = new WebTreeNodeCollection(null); _children.SetParent(null, this); }