public void CopyLayoutInformationFrom(View source) { if (PaperSize == null) { PaperSize = source.PaperSize; } foreach (ElementView sourceElementView in source.Elements) { ElementView destinationElementView = FindElementView(sourceElementView); if (destinationElementView != null) { destinationElementView.CopyLayoutInformationFrom(sourceElementView); } } foreach (RelationshipView sourceRelationshipView in source.Relationships) { RelationshipView destinationRelationshipView = FindRelationshipView(sourceRelationshipView); if (destinationRelationshipView != null) { destinationRelationshipView.CopyLayoutInformationFrom(sourceRelationshipView); } } }
public RelationshipView Add(Element source, string description, Element destination) { if (source == null) { throw new ArgumentException("A source element must be specified."); } if (destination == null) { throw new ArgumentException("A destination element must be specified."); } CheckElementCanBeAdded(source); CheckElementCanBeAdded(destination); // check that the relationship is in the model before adding it Relationship relationship = source.GetEfferentRelationshipWith(destination); if (relationship != null) { AddElement(source, false); AddElement(destination, false); RelationshipView relationshipView = AddRelationship(relationship, description, _sequenceNumber.GetNext()); return(relationshipView); } else { throw new ArgumentException("Relationship does not exist in model"); } }
public RelationshipView Add(Element source, string description, Element destination) { if (source != null && destination != null) { CheckElement(source); CheckElement(destination); // check that the relationship is in the model before adding it Relationship relationship = source.GetEfferentRelationshipWith(destination); if (relationship != null) { AddElement(source, false); AddElement(destination, false); RelationshipView relationshipView = AddRelationship(relationship, description, _sequenceNumber.GetNext()); return(relationshipView); } else { throw new ArgumentException("Relationship does not exist in model"); } } else { throw new ArgumentException("Source and destination must not be null"); } }
public void Remove(Relationship relationship) { if (relationship != null) { RelationshipView relationshipView = new RelationshipView(relationship); _relationships.Remove(relationshipView); } }
internal RelationshipView AddRelationship(Relationship relationship, string description, string order) { RelationshipView relationshipView = Add(relationship); if (relationshipView != null) { relationshipView.Description = description; relationshipView.Order = order; } return relationshipView; }
internal virtual RelationshipView FindRelationshipView(RelationshipView sourceRelationshipView) { foreach (RelationshipView relationshipView in Relationships) { if (relationshipView.Relationship.Equals(sourceRelationshipView.Relationship)) { return(relationshipView); } } return(null); }
internal RelationshipView AddRelationship(Relationship relationship, string description, string order, bool response) { RelationshipView relationshipView = Add(relationship); if (relationshipView != null) { relationshipView.Description = description; relationshipView.Order = order; relationshipView.Response = response; } return(relationshipView); }
public virtual RelationshipView Add(Relationship relationship) { if (relationship != null) { if (IsElementInView(relationship.Source) && IsElementInView(relationship.Destination)) { RelationshipView relationshipView = new RelationshipView(relationship); _relationships.Add(relationshipView); return(relationshipView); } } return(null); }
internal override RelationshipView FindRelationshipView(RelationshipView sourceRelationshipView) { foreach (RelationshipView relationshipView in Relationships) { if (relationshipView.Relationship.Equals(sourceRelationshipView.Relationship)) { if ((relationshipView.Description != null && relationshipView.Description.Equals(sourceRelationshipView.Description)) && relationshipView.Order.Equals(sourceRelationshipView.Order)) { return(relationshipView); } } } return(null); }
public virtual RelationshipView Add(Relationship relationship) { if (relationship == null) { throw new ArgumentException("A relationship must be specified."); } if (IsElementInView(relationship.Source) && IsElementInView(relationship.Destination)) { RelationshipView relationshipView = new RelationshipView(relationship); _relationships.Add(relationshipView); return(relationshipView); } return(null); }
private RelationshipView findRelationshipView(View view, RelationshipView relationshipWithoutLayoutInformation, Dictionary <Element, Element> elementMap) { if (!elementMap.ContainsKey(relationshipWithoutLayoutInformation.Relationship.Source) || !elementMap.ContainsKey(relationshipWithoutLayoutInformation.Relationship.Destination)) { return(null); } Element sourceElementWithLayoutInformation = elementMap[relationshipWithoutLayoutInformation.Relationship.Source]; Element destinationElementWithLayoutInformation = elementMap[relationshipWithoutLayoutInformation.Relationship.Destination]; foreach (RelationshipView rv in view.Relationships) { if ( rv.Relationship.Source.Equals(sourceElementWithLayoutInformation) && rv.Relationship.Destination.Equals(destinationElementWithLayoutInformation) && rv.Description.Equals(relationshipWithoutLayoutInformation.Description) && rv.Order.Equals(relationshipWithoutLayoutInformation.Order)) { return(rv); } } return(null); }
private int CompareAsString(RelationshipView x, RelationshipView y) { return(x.Order.CompareTo(y.Order)); }
private int CompareAsNumber(RelationshipView x, RelationshipView y) { return(double.Parse(x.Order).CompareTo(double.Parse(y.Order))); }