コード例 #1
0
        public override bool VerifyConsistency(object superordinateObject, object candidate)
        {
            PIMSchema    pimSchema    = (PIMSchema)superordinateObject;
            PIMComponent pimComponent = (PIMComponent)candidate;

            return(pimSchema.SchemaComponents.Contains(pimComponent));
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: mff-uk/exolutio
 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.");
     }
 }
コード例 #3
0
        private void FocusPIMComponent(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement linkLabel = (FrameworkElement)sender;
            PIMComponent     component = (PIMComponent)linkLabel.DataContext;

            if (component == null)
            {
                return;
            }
            Current.MainWindow.FocusComponent(component);
        }
コード例 #4
0
        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
        }
コード例 #5
0
 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;
     }
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        public override void Execute(object parameter)
        {
            PIMComponent pimComponent = ((PSMComponent)ScopeObject).Interpretation;

            Current.MainWindow.FocusComponent(pimComponent);
        }
コード例 #10
0
 private void ProcessPIMComponent(PIMComponent pimComponent, ref TContext context)
 {
     ProcessComponent(pimComponent, ref context);
 }