/// <summary> /// Creates a <see cref="BinaryRelationshipDiagramConnector"/> from a given <see cref="BinaryRelationship"/>. /// </summary> /// <param name="relationship">The <see cref="BinaryRelationship"/> that defines this connector.</param> /// <param name="connector">The dummy <see cref="DiagramConnector"/> that was used as defenition for this connector.</param> private void CreateBinaryRelationshipDiagramConnector(BinaryRelationship relationship, DiagramConnector connector) { var newConnector = new BinaryRelationshipDiagramConnector(relationship, connector); this.Behavior.AddConnector(newConnector); this.SelectedItem = newConnector; }
/// <summary> /// Creates a <see cref="BinaryRelationshipDiagramConnector"/> from a given <see cref="BinaryRelationship"/>. /// </summary> /// <param name="relationship">The <see cref="BinaryRelationship"/> that defines this connector.</param> /// <param name="connector">The dummy <see cref="DiagramConnector"/> that was used as defenition for this connector.</param> private void CreateBinaryRelationshipDiagramConnector(BinaryRelationship relationship, DiagramConnector connector) { var sourceItem = this.ThingDiagramItems.OfType <NamedThingDiagramContentItem>().First( x => x.Thing == relationship.Source); var targetItem = this.ThingDiagramItems.OfType <NamedThingDiagramContentItem>().First( x => x.Thing == relationship.Target); var newConnector = new BinaryRelationshipDiagramConnector(relationship, sourceItem, targetItem, connector); this.ThingDiagramItems.Add(newConnector); this.SelectedItem = newConnector; }