/// <summary> /// Return the bounds (relative to the diagram) for the specified person. /// </summary> public Rect GetNodeBounds(Person person) { Rect bounds = Rect.Empty; if (person != null && personLookup.ContainsKey(person)) { DiagramConnectorNode connector = personLookup[person]; bounds = new Rect(connector.TopLeft.X, connector.TopLeft.Y, connector.Node.ActualWidth, connector.Node.ActualHeight); } return(bounds); }
public MarriedDiagramConnector(bool isMarried, DiagramConnectorNode startConnector, DiagramConnectorNode endConnector) : base(startConnector, endConnector) { // Store if curretnly married or former. married = isMarried; // Get resources used to draw text. connectionTextSize = (double)Application.Current.TryFindResource("ConnectionTextSize"); connectionTextColor = (Color)Application.Current.TryFindResource("ConnectionTextColor"); connectionTextFont = (FontFamily)Application.Current.TryFindResource("ConnectionTextFont"); // Get resourced used to draw the connection line. this.ResourcePen = (Pen)Application.Current.TryFindResource( married ? "MarriedConnectionPen" : "FormerConnectionPen"); }
/// <summary> /// Add the spouses to the specified row and group. /// </summary> private void AddSpouseNodes(Person person, DiagramRow row, DiagramGroup group, Collection <Person> spouses, NodeType nodeType, double scale, bool married) { foreach (Person spouse in spouses) { if (!personLookup.ContainsKey(spouse)) { // Spouse node. DiagramNode node = CreateNode(spouse, nodeType, true, scale); group.Add(node); // Add connection. DiagramConnectorNode connectorNode = new DiagramConnectorNode(node, group, row); personLookup.Add(node.Person, connectorNode); connections.Add(new MarriedDiagramConnector(married, personLookup[person], connectorNode)); } } }
public ChildDiagramConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector) : base(startConnector, endConnector) { // Get the pen that is used to draw the connection line. this.ResourcePen = (Pen)Application.Current.TryFindResource("ChildConnectionPen"); }
/// <summary> /// Consturctor that specifies the two nodes that are connected. /// </summary> protected DiagramConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector) { this.start = startConnector; this.end = endConnector; }
/// <summary> /// Consturctor that specifies the two nodes that are connected. /// </summary> protected DiagramConnector(DiagramConnectorNode startConnector, DiagramConnectorNode endConnector) { start = startConnector; end = endConnector; }