コード例 #1
0
        private DelegateVertexAndEdgeListGraph<IType, SEquatableEdge<IType>> CreateGraph()
        {
            var graphDictionary = new TypeReferenceCountDict(typeReferenceCountDict.Keys);
            foreach (var names in typeReferenceCountDict.Values.Select(v => v.Keys))
            {
                foreach (var name in names.Where(name => !graphDictionary.ContainsKey(name)))
                {
                    graphDictionary.Add(name);
                }
            }
            foreach (var assembly in typeReferenceCountDict)
            {
                graphDictionary[assembly.Key] = assembly.Value;
            }

            var graph =
                graphDictionary.ToVertexAndEdgeListGraph(
                    kv => kv.Value.Select(v => new SEquatableEdge<IType>(kv.Key, v.Key)));
            return graph;
        }
コード例 #2
0
        public string GetReferencedTypesGraph()
        {
            var types = Assembly.GetTypes();

            var referencedTypes = new TypeReferenceCountDict();
            var typereferences = types.Select(x => x.GetReferencedTypes()).ToList();
            foreach (var typeref in typereferences)
            {
                foreach (var type in typeref)
                {
                    if (!referencedTypes.ContainsKey(type.Key))
                    {
                        referencedTypes.Add(type.Key, type.Key.GetReferencedTypes());
                    }
                }
            }
            var typeReferenceGraph = new TypeReferenceCountDictGraphConverter(referencedTypes);
            var graphMarkup = typeReferenceGraph.Convert();

            return graphMarkup;
        }
コード例 #3
0
 public TypeReferenceCountDictGraphConverter(TypeReferenceCountDict typeReferenceCountDict, IGraphMarkup<IType> markup = null)
 {
     this.typeReferenceCountDict = typeReferenceCountDict;
     this.markup = markup;
 }