public void SetPSMRepresentedClass(bool setnull) { if (setnull) { SetRepresentedPSMClassCommand c = (SetRepresentedPSMClassCommand)SetRepresentedPSMClassCommandFactory.Factory().Create(DiagramController); c.Set(null, Class); if (c.CanExecute()) { c.Execute(); } } else { SetRepresentedPSMClassCommand c = (SetRepresentedPSMClassCommand)SetRepresentedPSMClassCommandFactory.Factory().Create(DiagramController); c.Set(Class, DiagramController.Diagram as PSMDiagram); if (c.CanExecute()) { c.Execute(); } } }
void LinkSRs(I_PSMHasChildren D) { if (D is P_PSMClass) { P_PSMClass C = D as P_PSMClass; foreach (P_PSMClass SR in C.SRepresentedBy) { SetRepresentedPSMClassCommand c = SetRepresentedPSMClassCommandFactory.Factory().Create(DiagramController) as SetRepresentedPSMClassCommand; c.Set(C.Super as PSMClass, SR.Super as PSMClass); c.Execute(); } } foreach (I_PSMHasParent child in D.Children) { if (child is I_PSMHasChildren) { LinkSRs(child as I_PSMHasChildren); } } }