Skip to content

Commit 65b2ad6

Browse files
committed
Added app.config to specify location of graphviz folder
1 parent b3224e8 commit 65b2ad6

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<appSettings>
4+
<add key="graphVizLocation" value="c:\Graphviz"/>
5+
</appSettings>
6+
</configuration>

src/GraphVizWrapper.Tests/GraphVizWrapper.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<Compile Include="Tests.cs" />
5757
</ItemGroup>
5858
<ItemGroup>
59+
<None Include="App.config" />
5960
<None Include="packages.config" />
6061
</ItemGroup>
6162
<ItemGroup>

src/GraphVizWrapper/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<appSettings>
4+
<add key="graphVizLocation" value="c:\Graphviz"/>
5+
</appSettings>
6+
</configuration>

src/GraphVizWrapper/GraphGeneration.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ namespace GraphVizWrapper
1111
{
1212
using System;
1313
using System.Collections.Generic;
14+
using System.Configuration;
1415
using System.IO;
1516
using System.Reflection;
16-
17-
using GraphVizWrapper.Commands;
18-
using GraphVizWrapper.Queries;
17+
18+
using Commands;
19+
using Queries;
1920

2021
/// <summary>
2122
/// The main entry class for the wrapper.
@@ -36,6 +37,8 @@ public GraphGeneration(IGetStartProcessQuery startProcessQuery, IGetProcessStart
3637
this.startProcessQuery = startProcessQuery;
3738
this.getProcessStartInfoQuery = getProcessStartInfoQuery;
3839
this.registerLayoutPlugincommand = registerLayoutPlugincommand;
40+
41+
this.graphvizPath = ConfigurationManager.AppSettings["graphVizLocation"];
3942
}
4043

4144
#region Properties
@@ -110,6 +113,7 @@ private string FilePath
110113
/// </returns>
111114
public byte[] GenerateGraph(string dotFile, Enums.GraphReturnType returnType)
112115
{
116+
113117
byte[] output;
114118

115119
if (!ConfigExists)

src/GraphVizWrapper/GraphVizWrapper.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
</PropertyGroup>
3333
<ItemGroup>
3434
<Reference Include="System" />
35+
<Reference Include="System.configuration" />
3536
<Reference Include="System.Core" />
3637
<Reference Include="System.Xml.Linq" />
3738
<Reference Include="System.Data.DataSetExtensions" />
@@ -55,7 +56,9 @@
5556
<Compile Include="Queries\IGetProcessStartInfoQuery.cs" />
5657
<Compile Include="Queries\IGetStartProcessQuery.cs" />
5758
</ItemGroup>
58-
<ItemGroup />
59+
<ItemGroup>
60+
<None Include="App.config" />
61+
</ItemGroup>
5962
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6063
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
6164
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)