public static void RenderCompleteDiagramToView(VisualStudio visualStudio, ref ArchView view) { var modelGen = new DiagramGenerator(visualStudio.Solution); var tree = modelGen.GenerateDiagram(DiagramDefinition.RootDefault); var viewModel = LayerMapper.TreeModelToArchViewModel(tree,true,true); view.Diagram.RenderModel(viewModel); }
public void CreatesNewTreesForEachRequest() { var generator = new DiagramGenerator(DevArchSolution.FromPath(TestExtesions.TestSolutions.WithSolFolders)); var def1 = new DiagramDefinition("",new RootScope(), new OutputSettings(""), new List<Filter>{new MaxDepth(1)}); var def2 = new DiagramDefinition("", new RootScope(), new OutputSettings(""), new List<Filter> { new MaxDepth(2) }); var diagram1 = generator.GenerateDiagram(def1); var diagram2 = generator.GenerateDiagram(def2); //Assert diagram1.Should().NotBeSameAs(diagram2); diagram1.Height().Should().Be(1); diagram2.Height().Should().Be(2); }
public static async Task RenderAllArchDiagramsToFiles(VisualStudio visualStudio) { var modelGen = new DiagramGenerator(visualStudio.Solution); var parseResults = modelGen.GetDiagramDefinitions().ToList(); var resultLogger = new ParseResultLogger(visualStudio.DevArchOutputWindow(), parseResults); resultLogger.PrintErrors(); var definitions = parseResults.Where(x => x.Succeed).SelectList(x => x.Definition); foreach (var modelDef in definitions) { var tree = modelGen.GenerateDiagram(modelDef); if (!tree.Childs.Any()) throw new NoClassesFoundException(); await BitmapRenderer.RenderTreeToBitmapAsync(tree,modelDef.DependencyDown, modelDef.Output, modelDef.HideAnonymousLayers); resultLogger.PrintCreated(modelDef.Output.Path); } resultLogger.PrintSuccess(); }
public static void RenderDefaultDiagramDef(VisualStudio visualStudio) { var diagramGen = new DiagramGenerator(visualStudio.Solution); var diagramModel = diagramGen.GenerateDiagram(DiagramDefinition.RootDefault); BitmapRenderer.RenderTreeToBitmapAsync(diagramModel, true, new OutputSettings(visualStudio.Solution.Directory + "Complete.png")).Wait(); }