Exemple #1
0
        private Dictionary <Tags, DownwardEdges> GenerateEdges(List <TagOrdering> orderings)
        {
            var result = new EdgeGraph();

            lock (Tags.Registry)
                foreach (var ordering in orderings)
                {
                    result.Connect(ordering.Higher, ordering.Lower);

                    foreach (var kvp in Tags.Registry)
                    {
                        var containsLower  = kvp.Value.Contains(ordering.Lower);
                        var containsHigher = kvp.Value.Contains(ordering.Higher);

                        if (containsLower && containsHigher)
                        {
                            continue;
                        }
                        else if (containsLower)
                        {
                            result.Connect(ordering.Higher, kvp.Value);
                        }
                        else if (containsHigher)
                        {
                            result.Connect(kvp.Value, ordering.Lower);
                        }
                    }
                }

            return(result.Finalize());
        }
Exemple #2
0
        private Dictionary <Tags, DownwardEdges> GenerateEdges(List <TagOrdering> orderings)
        {
            var result = new EdgeGraph();

            lock (Tags.Registry)
                foreach (var ordering in orderings)
                {
                    result.Connect(ordering.Higher, ordering.Lower);

                    foreach (var kvp in Tags.Registry)
                    {
                        GenerateEdge(result, kvp.Value, ordering);
                    }

                    foreach (var kvp in TagSet.Registry)
                    {
                        GenerateEdge(result, kvp.Value, ordering);
                    }
                }

            return(result.Finalize());
        }