Browse Source

wrapped dot call in a try catch block to catch exception when graphviz is not installed

pull/10/head
unknown 15 years ago
parent
commit
ba5522da6c
  1. 14
      ILSpy/MainWindow.xaml.cs

14
ILSpy/MainWindow.xaml.cs

@ -307,9 +307,17 @@ namespace ICSharpCode.ILSpy @@ -307,9 +307,17 @@ namespace ICSharpCode.ILSpy
foreach (char c in Path.GetInvalidFileNameChars())
name = name.Replace(c, '-');
string fileName = Path.Combine(Path.GetTempPath(), name);
graph.Save(fileName + ".gv");
Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit();
Process.Start(fileName + ".png");
graph.Save(fileName + ".gv");
try
{
Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit();
Process.Start(fileName + ".png");
}
catch (Win32Exception ex)
{
MessageBox.Show(String.Format("Unable to find Graphviz on your computer. Please install it. {0}", ex.Message), "ILSpy");
}
}
#endif
#endregion

Loading…
Cancel
Save