private void OnPaint(AddressesNode addressesNode) { if ((this.TreeSource != null) && (addressesNode != null)) { LocalAddress address = (LocalAddress) addressesNode.get_Tag(); if (address.Level == AddressLevel.Жилье) { addressesNode.set_ForeColor(DefaultColor); } else if (!this.IsExists(this.TreeSource, addressesNode)) { addressesNode.SetColor(); } else { addressesNode.set_ForeColor(DefaultColor); addressesNode.Expand(); foreach (System.Windows.Forms.TreeNode node in addressesNode.Nodes) { this.OnPaint((AddressesNode) node); } } } }
public void Load(ObjectList<LocalAddress> localAddresses, bool mark) { base.Nodes.Clear(); if (localAddresses != null) { foreach (LocalAddress address in localAddresses) { AddressesNode node = new AddressesNode(address); this.AddNode(node); if (mark) { node.SetColor(); } } this.OnPaintRoots(); } if (this.OnChangeSelectAddresses != null) { this.OnChangeSelectAddresses(); } }