public override bool VerifyConsistency(object superordinateObject, object candidate) { PIMSchema pimSchema = (PIMSchema)superordinateObject; PIMComponent pimComponent = (PIMComponent)candidate; return(pimSchema.SchemaComponents.Contains(pimComponent)); }
public void FocusComponent(IEnumerable <PIMDiagram> pimDiagrams, PIMComponent component, bool activateDiagramTab = true) { if (pimDiagrams.Count() == 1) { DiagramTabManager.ActivateDiagramWithElement(pimDiagrams.First(), component, activateDiagramTab); } else { throw new NotImplementedException("Focus component not implemented for the case where the component is present in zero or more than one diagram."); } }
private void FocusPIMComponent(object sender, MouseButtonEventArgs e) { FrameworkElement linkLabel = (FrameworkElement)sender; PIMComponent component = (PIMComponent)linkLabel.DataContext; if (component == null) { return; } Current.MainWindow.FocusComponent(component); }
private static void CheckPIMComponent(PIMComponent pimComponent) { CheckComponent(pimComponent); Assert.IsNotNull(pimComponent.PIMSchema); #if SKIP #else foreach (PSMComponent interpretedComponent in pimComponent.InterpretedComponents) { Assert.AreEqual(interpretedComponent.Interpretation, pimComponent); } #endif }
private void DisplayInterpretedComponents(PIMComponent pimComponent) { if (pimComponent != null) { lvDerivedComponents.ItemsSource = pimComponent.GetInterpretedComponents(); spDerivedComponents.Visibility = System.Windows.Visibility.Visible; } else { lvDerivedComponents.ItemsSource = null; spDerivedComponents.Visibility = System.Windows.Visibility.Collapsed; } }
internal override PropagationMacroCommand PostPropagation() { PropagationMacroCommand command = new PropagationMacroCommand(Controller) { CheckFirstOnlyInCanExecute = true }; ExolutioObject component = Project.TranslateComponent(NamedComponentGuid); if (component is PIMComponent) { PIMComponent pimComponent = (PIMComponent)component; foreach (PSMComponent psmComponent in pimComponent.GetInterpretedComponents()) { if (psmComponent.IsNamed && psmComponent.Name == oldname) { command.Commands.Add(new acmdRenameComponent(Controller, psmComponent, NewName)); } } } return(command); }
public override bool VerifyConsistency(object superordinateObject, object candidate) { PSMComponent psmComponent = (PSMComponent)superordinateObject; PIMComponent component = (PIMComponent)candidate; if (psmComponent is PSMAssociation && component is PIMAssociation) { return(true); } if (psmComponent is PSMAttribute && component is PIMAttribute) { return(true); } if (psmComponent is PSMClass && component is PIMClass) { return(true); } return(false); }
internal override void CommandOperation() { PSMComponent c = Project.TranslateComponent <PSMComponent>(PSMComponentGuid); PIMComponent oldInterpretation = c.Interpretation; if (c.Interpretation == null) { oldPimComponentGuid = Guid.Empty; } else { oldPimComponentGuid = c.Interpretation; } if (PIMComponentGuid != Guid.Empty) { c.Interpretation = Project.TranslateComponent <PIMComponent>(PIMComponentGuid); } else { c.Interpretation = null; } Report = new CommandReport(CommandReports.SET_INTERPRETATION, c, oldInterpretation, c.Interpretation); }
public override void Execute(object parameter) { PIMComponent pimComponent = ((PSMComponent)ScopeObject).Interpretation; Current.MainWindow.FocusComponent(pimComponent); }
private void ProcessPIMComponent(PIMComponent pimComponent, ref TContext context) { ProcessComponent(pimComponent, ref context); }