Beispiel #1
0
        private static TypeGraph CreateGraph(TypeViewModel typeViewModel, bool adjustExpansion)
        {
            var graph = new TypeGraph(true);

            if (adjustExpansion)
            {
                ExpandAll(typeViewModel);
                if (typeViewModel.DescendantsCount > 100)
                {
                    AdjustExpansion(typeViewModel);
                }
            }
            else
            {
                typeViewModel.IsExpanded = true;
                if (typeViewModel.DescendantsCount <= 100)
                {
                    ExpandAll(typeViewModel);
                }
            }
            var flattenedHierarchy = typeViewModel.FlattenedHierarchy;

            graph.AddVertexRange(flattenedHierarchy);
            foreach (var viewModel in flattenedHierarchy)
            {
                if (viewModel.BaseType == null || viewModel == typeViewModel)
                {
                    continue;
                }
                graph.AddEdge(new Edge <TypeViewModel>(viewModel, viewModel.BaseType));
            }
            return(graph);
        }
        private static TypeGraph CreateGraph(TypeViewModel typeViewModel, bool adjustExpansion)
        {
            var graph = new TypeGraph(true);

            if (adjustExpansion)
            {
                ExpandAll(typeViewModel);
                if (typeViewModel.DescendantsCount > 100)
                {
                    AdjustExpansion(typeViewModel);
                }
            }
            else
            {
                typeViewModel.IsExpanded = true;
                if (typeViewModel.DescendantsCount <= 100)
                {
                    ExpandAll(typeViewModel);
                }
            }
            var flattenedHierarchy = typeViewModel.FlattenedHierarchy;
            graph.AddVertexRange(flattenedHierarchy);
            foreach (var viewModel in flattenedHierarchy)
            {
                if (viewModel.BaseType == null || viewModel == typeViewModel)
                {
                    continue;
                }
                graph.AddEdge(new Edge<TypeViewModel>(viewModel, viewModel.BaseType));
            }
            return graph;
        }
 private static TypeGraph CreateGraph(TypeViewModel typeViewModel)
 {
     var graph = new TypeGraph(true);
     var flattededHierarchy = typeViewModel.FlattenedHierarchy;
     graph.AddVertexRange(flattededHierarchy);
     foreach (var viewModel in flattededHierarchy)
     {
         if (viewModel.BaseType == null || viewModel == typeViewModel)
         {
             continue;
         }
         graph.AddEdge(new Edge<TypeViewModel>(viewModel, viewModel.BaseType));
     }
     return graph;
 }