public Unit Execute(ModelEntity e)
        {
            var selectedInCurrentDiagram = Repo.GetCurrentDiagram()
                                           .SelectMany(currentDiagram => currentDiagram.SelectedEntities(Repo))
                                           .ToList();

            if (selectedInCurrentDiagram.IsEmpty())
            {
                Clipboard.Val.PasteInto(e);
                Repo.PropagateChanges(e);
            }
            else
            {
                selectedInCurrentDiagram.ForEach(selected =>
                {
                    Clipboard.Val.PasteInto(selected);
                    Repo.PropagateChanges(selected);
                });
            }

            return(Unit.Instance);
        }
        public EntityModified Execute(ModelEntity.Connector c)
        {
            (from source in c.Source(Repo.GetElement)
             from problemOcc in source.TryCast <ProblemOccurrence>()
             select problemOcc)
            .Do(problemOccurrence =>
            {
                problemOccurrence.State = problemOccurrence.DeduceState(problemOccurrence.Alternatives(Repo.GetElement));
                Repo.PropagateChanges(problemOccurrence);
            });

            return(EntityModified.NotModified);
        }
        public Unit Execute(ModelEntity.Package p)
        {
            var content = PackageTreeNode(p).Value;

            Form.Select(content).Do(selectedEntities =>
            {
                selectedEntities.ForEach(e => {
                    Clipboard.Val.PasteInto(e);
                    Repo.PropagateChanges(e);
                });
            });

            return(Unit.Instance);
        }
Beispiel #4
0
        public Unit Execute(OptionOccurrence optionOcc)
        {
            var problemOccs = from problemOcc in optionOcc.AssociatedProblemOccurrences(Repo.GetElement)
                              select problemOcc;

            problemOccs.ForEach(problemOcc =>
            {
                var alternatives = problemOcc.Alternatives(Repo.GetElement);
                problemOcc.State = problemOcc.DeduceState(alternatives);
                Repo.PropagateChanges(problemOcc);
            });

            return(Unit.Instance);
        }
        public DeleteEntity Execute(OptionOccurrence alternative)
        {
            alternative.AssociatedProblemOccurrences(Repo.GetElement).ForEach(problemOccurrence =>
            {
                var alternatives = from alt in problemOccurrence.Alternatives(Repo.GetElement)
                                   where !alt.Equals(alternative)
                                   select alt;

                problemOccurrence.State = problemOccurrence.DeduceState(alternatives);

                Repo.PropagateChanges(problemOccurrence);
            });

            return(DeleteEntity.Delete);
        }