1
Vote

Generate svg and Generate png options are ignored

description

The configuration options Generate SVG and Generate PNG are ignored. If you unselect either option both files are created anyway. I've changed the following lines in DependencyVisualizer.cs :
{{
svg = new GraphvizAlgorithm(graph, Resources.Dependencies, GraphvizImageType.Svg);
png = new GraphvizAlgorithm(graph, Resources.Dependencies, GraphvizImageType.Png);

foreach (Project project in solution.Projects.Values)
{
this.AddProjectToGraph(project, graph);
}

Tracer.Info(
"Added {0} vertices to graph ...",
(graph.VertexProvider as ReferenceVertexProvider).VertexCount);
svg.WriteVertex += this.GraphvizAlgorithm_WriteVertex;
svg.Write(Path.GetFileNameWithoutExtension(solutionPath));

png.WriteVertex += this.GraphvizAlgorithm_WriteVertex;
png.Write(Path.GetFileNameWithoutExtension(solutionPath));
}}
to :
{{
if (Settings.Default.GenerateSvg)
svg = new GraphvizAlgorithm(graph, Resources.Dependencies, GraphvizImageType.Svg);
if (Settings.Default.GeneratePng)
png = new GraphvizAlgorithm(graph, Resources.Dependencies, GraphvizImageType.Png);
foreach (Project project in solution.Projects.Values)
{
this.AddProjectToGraph(project, graph);
}

Tracer.Info(
"Added {0} vertices to graph ...",
(graph.VertexProvider as ReferenceVertexProvider).VertexCount);
if (svg != null)
{
svg.WriteVertex += this.GraphvizAlgorithm_WriteVertex;
svg.Write(Path.GetFileNameWithoutExtension(solutionPath));
}
if (png != null)
{
png.WriteVertex += this.GraphvizAlgorithm_WriteVertex;
png.Write(Path.GetFileNameWithoutExtension(solutionPath));
}
}}

comments