///-------------------------------------------------------------------------------- /// <summary>This method adds a relationship to the view model.</summary> /// /// <param name="sourceEntity">The source entity of the relationship to add.</param> /// <param name="sinkEntity">The sink entity of the relationship to add.</param> /// <param name="entityRelationship">The associated entity relationship.</param> ///-------------------------------------------------------------------------------- public void AddRelationship(DiagramEntityViewModel sourceEntity, DiagramEntityViewModel sinkEntity, RelationshipViewModel entityRelationship) { // add diagram relationship to solution diagram DiagramRelationshipViewModel relationship = new DiagramRelationshipViewModel(sourceEntity, sinkEntity, sourceEntity.Diagram, entityRelationship); DiagramRelationships.Add(relationship); Items.Add(relationship); }
///-------------------------------------------------------------------------------- /// <summary>This method adds a relationship to the view model.</summary> /// /// <param name="relationship">The relationship to add.</param> ///-------------------------------------------------------------------------------- public void DeleteRelationship(DiagramRelationshipViewModel relationship) { // remove diagram relationship from solution diagram RemoveRelationship(relationship); // add to deleted relationship list ItemsToDelete.Add(relationship); Refresh(false); }
///-------------------------------------------------------------------------------- /// <summary>This method adds a relationship to the view model.</summary> /// /// <param name="relationship">The relationship to add.</param> ///-------------------------------------------------------------------------------- public void CreateRelationship(DiagramRelationshipViewModel relationship) { // add diagram relationship to solution diagram DiagramRelationships.Add(relationship); Items.Add(relationship); // add to diagram relationships to add list ItemsToAdd.Add(relationship); Refresh(false); }
///-------------------------------------------------------------------------------- /// <summary>This method adds a relationship to the view model.</summary> /// /// <param name="relationship">The relationship to add.</param> ///-------------------------------------------------------------------------------- public void RemoveRelationship(DiagramRelationshipViewModel relationship) { // remove diagram relationship from solution diagram DiagramRelationships.Remove(relationship); Items.Remove(relationship); }