private XmlExporter(XDocument document, XmlNamespaceManager namespaceManager, EA.Project projectInterface, ModelEntityRepository repo) { Document = document; NamespaceManager = namespaceManager; ProjectInterface = projectInterface; Repo = repo; }
public static Option <SolutionInstantiationGraph> Create(ModelEntityRepository repo, SolutionEntity solutionItem) { return(from classifier in solutionItem.GetClassifier(repo.GetElement) from problemSpaceEntity in classifier.TryCast <ProblemSpaceEntity>() let problemSpace = DependencyGraph.Create(repo, problemSpaceEntity, DependencyGraphFilter) let solution = DependencyGraph.Create(repo, solutionItem, DependencyGraphFilter) select new SolutionInstantiationGraph(repo, Merge(problemSpace, solution))); }
public ExportProblemSpaceCommand(ModelEntityRepository repo, TailorPackageExportForm form, XmlExporter.Factory exporterFactory, SelectExportPathDialog exportFileDialog) { Repo = repo; FilterForm = form; ExporterFactory = exporterFactory; ExportFileDialog = exportFileDialog; }
public DependencySelectorForm(ModelEntityRepository repo) { Repo = repo; InitializeComponent(); dependencyTreeView.CheckBoxes = true; dependencyTreeView.AfterCheck += dependencyTreeView_AfterCheck; }
public ProblemSpaceTree InstantiateSolutionElements(ModelEntityRepository repo) { var instantiations = from instantiation in ElementInstantiations select PackageInstance.Fold( (solutionPackage) => instantiation.CreateInstanceIfMissing(repo, solutionPackage), () => instantiation); var children = Children.Select(c => c.InstantiateSolutionElements(repo)); return(new ProblemSpaceTree(Package, PackageInstance, instantiations, Diagrams, children)); }
private void CreateSolutionDiagrams(ModelEntityRepository repo, IEnumerable <ElementInstantiation> instantiations) { PackageInstance.Do(solutionPackage => { Diagrams.ForEach(problemDiagram => { var solutionDiagram = repo.Create(problemDiagram.Name, DiagramTypes.SolutionOverview, solutionPackage, ADTechnology.Technologies.AD.ID); CopyDiagramObjects(problemDiagram, solutionDiagram, instantiations); }); }); Children.ForEach(c => c.CreateSolutionDiagrams(repo, instantiations)); }
public void InstantiateSolutionConnectors(ModelEntityRepository repo) { var allInstantiations = AllInstantiations().Run(); // connections between new instances var connections = from instantiation in allInstantiations from source in instantiation.Instance from connector in instantiation.Element.Connectors where connector.EaObject.ClientID == instantiation.Element.Id from connectorStype in connector.GetStereotype(ADTechnology.Technologies.AD.ConnectorStereotypes) from targetInstantiation in allInstantiations where connector.EaObject.SupplierID == targetInstantiation.Element.Id from target in targetInstantiation.Instance select Tuple.Create(source, connectorStype, target); // connections from new instances to referenced elements var referenceConnectionsFrom = from instantiation in allInstantiations from instance in instantiation.Instance from connector in instantiation.Element.Connectors where connector.EaObject.ClientID == instantiation.Element.Id from target in connector.Target(repo.GetElement) where !target.Is(ProblemSpace.Problem) && !target.Is(ProblemSpace.Option) select Tuple.Create(instance, connector.ReconstructStereotype(), target); // connections from referenced elements to new instances var referenceConnectionsTo = from instantiation in allInstantiations from instance in instantiation.Instance from connector in instantiation.Element.Connectors where connector.EaObject.SupplierID == instantiation.Element.Id from source in connector.Source(repo.GetElement) where !source.Is(ProblemSpace.Problem) && !source.Is(ProblemSpace.Option) select Tuple.Create(source, connector.ReconstructStereotype(), instance); connections .Concat(referenceConnectionsFrom) .Concat(referenceConnectionsTo) .ForEach((source, connectorStype, target) => { try { repo.Connect(source, target, connectorStype); } catch (Exception) { // TODO: proper error handling } }); }
private static DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> Create( ModelEntityRepository repo, ModelEntity.Element source, DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> dependencyGraph, Func <ModelEntity.Element, ModelEntity.Connector, ModelEntity.Element, bool> edgeFilter) { var targets = from connector in source.Connectors from target in connector.OppositeEnd(source, repo.GetElement) where edgeFilter(source, connector, target) select Tuple.Create(source, connector, target); return(targets.Aggregate(dependencyGraph, (graph, edge) => { var connected = graph.Connect(edge.Item1, edge.Item2, edge.Item3); if (graph.NodeLabels.Any(nl => nl.Guid == edge.Item3.Guid)) { return connected; } else { return Create(repo, edge.Item3, connected, edgeFilter); } })); }
public Factory(ModelEntityRepository repo, IReadableAtom <EA.Repository> eaRepo) { Repo = repo; EaRepo = eaRepo; }
public PasteTaggedValuesIntoChildrenCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo) { Clipboard = clipboard; Repo = repo; Form = new SelectDescendantsForm(); }
public UpdateMetadataOfNewElementsCommand(ModelEntityRepository repo) { Repo = repo; }
public UpdateProblemOccurrenceStateOnAlternativeRemoved(ModelEntityRepository repo) { Repo = repo; }
private SolutionInstantiationGraph(ModelEntityRepository repo, DirectedLabeledGraph <ElementInstantiation, ModelEntity.Connector> graph) { Repo = repo; Graph = graph; }
public InstantiateProblemSpaceCommand(ModelEntityRepository repo, InstantiateSolutionForm solutionNameForm) { Repo = repo; SolutionNameForm = solutionNameForm; }
public PopulateDependenciesCommand(ModelEntityRepository repo, IDependencySelector selector) { Repo = repo; Selector = selector; }
public ElementInstantiation CreateInstanceIfMissing(ModelEntityRepository repo, ModelEntity.Package package) { return(Instance.Fold( _ => this, () => Copy(instance: repo.Instantiate(Element, package, ADTechnology.Technologies.AD.ElementStereotypes)))); }
public void CreateSolutionDiagrams(ModelEntityRepository repo) { CreateSolutionDiagrams(repo, AllInstantiations()); }
public AnalysePackageCommand(ModelEntityRepository repo, DisplayMetricsForm displayMetricsForm) { Repository = repo; DisplayMetricsForm = displayMetricsForm; }
public PasteTaggedValuesCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo) { Clipboard = clipboard; Repo = repo; }
public ProblemSpaceTree InstantiateSolutionPackages(Option <ModelEntity.Package> parentPackage, ModelEntityRepository repo, Option <String> name) { var solutionPackageName = name.GetOrElse(Package.Name); var solutionPackage = repo.CreatePackage(solutionPackageName, parentPackage, SolutionSpace.SolutionSpacePackage.AsOption()); var children = Children.Select(c => c.InstantiateSolutionPackages(solutionPackage.AsOption(), repo, Options.None <String>())); return(new ProblemSpaceTree(Package, Options.Some(solutionPackage), ElementInstantiations, Diagrams, children)); }
public EaToAdRepoConverter(ModelEntityRepository repo) { this.repo = repo; }
public static DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> Create(ModelEntityRepository repo, ModelEntity.Element rootNode, Func <ModelEntity.Element, ModelEntity.Connector, ModelEntity.Element, bool> edgeFilter) { return(Create(repo, rootNode, new DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector>(rootNode), edgeFilter)); }