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. 8
      ILSpy/MainWindow.xaml.cs

8
ILSpy/MainWindow.xaml.cs

@ -308,9 +308,17 @@ namespace ICSharpCode.ILSpy
name = name.Replace(c, '-'); name = name.Replace(c, '-');
string fileName = Path.Combine(Path.GetTempPath(), name); string fileName = Path.Combine(Path.GetTempPath(), name);
graph.Save(fileName + ".gv"); graph.Save(fileName + ".gv");
try
{
Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit(); Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit();
Process.Start(fileName + ".png"); 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 #endif
#endregion #endregion

Loading…
Cancel
Save