private IDictionary <string, string> MkAttributes(ModelEntity.Element e) { return(e.TaggedValues .Concat(new[] { new KeyValuePair <String, String>("Notes", e.Notes) }) .Where(p => p.Value != "") .ToDictionary()); }
public override Option <ModelEntity.Element> Instantiate(ModelEntity.Element classifier, ModelEntity.Package package, IEnumerable <EAAddInBase.MDGBuilder.ElementStereotype> stereotypes) { return(base.Instantiate(classifier, package, stereotypes).Select(instance => { instance.TryCast <AdEntity>().Do(adInstance => { adInstance.CopyDataFromClassifier(GetElement); }); return instance; })); }
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); } })); }
private Option <ModelEntity.Diagram> GetCurrentDiagramContaining(ModelEntity.Element element) { return(from diagram in Repo.GetCurrentDiagram() where diagram.GetObject(element).IsDefined select diagram); }
public ElementInstantiation Copy(ModelEntity.Element element = null, Option <ModelEntity.Element> instance = null, bool?selected = null) { return(new ElementInstantiation(element ?? Element, instance ?? Instance, selected ?? Selected)); }
public ElementInstantiation(ModelEntity.Element element, Option <ModelEntity.Element> instance = null, bool selected = false) { Element = element; Instance = instance ?? Options.None <ModelEntity.Element>(); Selected = selected; }
/// <summary> /// Use this method as edge filter to create a dependency tree consisting of all reachable elements. /// </summary> public static bool TraverseAllConnectors(ModelEntity.Element from, ModelEntity.Connector via, ModelEntity.Element to) { return(true); }
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)); }