/// <summary> /// Called whenever a relationship of type ModalDiagramReferencesDomainClass is added and /// the element hosted by this model is the source. /// </summary> /// <param name="args"></param> private void OnReferenceAdded(ElementAddedEventArgs args) { ModalDiagramReferencesDomainClass con = args.ModelElement as ModalDiagramReferencesDomainClass; if (con != null) { SetReference(con.DomainClass); } }
/// <summary> /// Called whenever a relationship of type DiagramClassViewHasRootDiagramNodes is deleted and /// the element hosted by this model is the source. /// </summary> /// <param name="args"></param> private void OnReferenceRemoved(ElementDeletedEventArgs args) { ModalDiagramReferencesDomainClass con = args.ModelElement as ModalDiagramReferencesDomainClass; if (con != null) { RemoveReference(con.DomainClass); } }
/// <summary> /// Called on a role player changing. /// </summary> /// <param name="args"></param> private void OnReferenceChanged(RolePlayerChangedEventArgs args) { ModalDiagramReferencesDomainClass con = args.ElementLink as ModalDiagramReferencesDomainClass; if (con != null) { if (args.DomainRole.Id == ModalDiagramReferencesDomainClass.DomainClassDomainRoleId) { if (con.ModalDiagram.Id == this.DiagramClassView.DiagramClass.Id) { if (this.ReferenceVM != null) { if (args.OldRolePlayerId == this.referenceVM.Element.Id) { RemoveReference(con.DomainClass); } } SetReference(con.DomainClass); } } } }