private string CreateImageFile(object o, GraphvizImageType imageType, string imageFileName) { var graph = FactoryProvider.CreateStringGraph(); FactoryProvider.CreateGraphCreator().Create(o, graph); var graphviz = new GraphvizAlgorithm <string, TaggedEdge <string, string> >(graph.ToQuickGraph()) { ImageType = imageType }; graphviz.FormatVertex += FormatVertexHandler; // ReSharper disable AssignNullToNotNullAttribute string outputfile = Path.Combine(Path.GetDirectoryName(Environment.CurrentDirectory), imageFileName); // ReSharper restore AssignNullToNotNullAttribute graphviz.Generate(new FileDotEngine(), outputfile); return(outputfile); }