using System; using System.ComponentModel; namespace DevComponents.Tree { /// /// Represents a description of linked node and any connector points that link nodes. /// public class LinkedNode { #region Private Variables private ConnectorPointsCollection m_ConnectorPoints=null; private Node m_Node=null; private Node m_Parent=null; #endregion #region Internal Implementation /// /// Creates new instance of the object. /// public LinkedNode() { m_ConnectorPoints=new ConnectorPointsCollection(); } /// /// Creates new instance of the object. /// /// Linkded node to initialize new instace with. public LinkedNode(Node linkedNode) : this() { this.Node = linkedNode; } /// /// Creates new instance of the object. /// /// Linkded node to initialize new instace with. /// Connector points collection to initialize new instance with. public LinkedNode(Node linkedNode, ConnectorPointsCollection connectorPoints) : this() { this.Node = linkedNode; if(connectorPoints!=null) { m_ConnectorPoints = connectorPoints; m_ConnectorPoints.SetParentNode(m_Parent); } } /// /// Gets or sets reference to linked node. /// /// /// Linked nodes are nodes that are related to given node but do not have strict /// parent child relationship with the node. Each linked node must be already added as /// child node to some other node or it will not be displayed. Linked nodes are used in Map /// and Diagram layout styles to indicates relationships between nodes. Also See TreeGX.LinkConnector property. /// [Browsable(true), DefaultValue(null)] public Node Node { get { return m_Node;} set { m_Node = value;} } /// /// Gets the collection of the link connector line relative points. If a node has a link to this node through LinkedNodes collection /// this these points outline the path connector will be drawn through from this node to it's parent linked node. By default this collection is empty which indicates that /// connector line is drawn using predefined path. Points added here are the points through which the connector line will travel to the /// parent node. The point coordinates added to this collection are relative from the top-left corner of this node. /// [Browsable(true),Category("Connectors"),DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public ConnectorPointsCollection ConnectorPoints { get {return m_ConnectorPoints;} } /// /// Gets the Node this linked node description is attached to. /// [Browsable(false)] public Node Parent { get { return m_Parent;} } /// /// Sets the parent node. /// /// Reference to parent node. internal void SetParent(Node node) { m_Parent = node; m_ConnectorPoints.SetParentNode(node); } #endregion } }