コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: AdRepository.cs プロジェクト: yjstyle/ADMentor
 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;
     }));
 }
コード例 #3
0
ファイル: DependencyGraph.cs プロジェクト: yjstyle/ADMentor
        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);
                }
            }));
        }
コード例 #4
0
 private Option <ModelEntity.Diagram> GetCurrentDiagramContaining(ModelEntity.Element element)
 {
     return(from diagram in Repo.GetCurrentDiagram()
            where diagram.GetObject(element).IsDefined
            select diagram);
 }
コード例 #5
0
 public ElementInstantiation Copy(ModelEntity.Element element = null, Option <ModelEntity.Element> instance = null, bool?selected = null)
 {
     return(new ElementInstantiation(element ?? Element, instance ?? Instance, selected ?? Selected));
 }
コード例 #6
0
 public ElementInstantiation(ModelEntity.Element element, Option <ModelEntity.Element> instance = null, bool selected = false)
 {
     Element  = element;
     Instance = instance ?? Options.None <ModelEntity.Element>();
     Selected = selected;
 }
コード例 #7
0
ファイル: DependencyGraph.cs プロジェクト: yjstyle/ADMentor
 /// <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);
 }
コード例 #8
0
ファイル: DependencyGraph.cs プロジェクト: yjstyle/ADMentor
 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));
 }