public void GenereteDotFileOfSna pshot int ind DirectoryInfo directory

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public void GenereteDotFileOfSnapshot(int ind) {
DirectoryInfo directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory());
for (int i = 0; i < 4; i++) {
directoryInfo = directoryInfo.Parent;
}
String dotFilePath = directoryInfo.FullName + "\\dotFiles";
if (!Directory.Exists(dotFilePath)) {
Directory.CreateDirectory(dotFilePath);
}
//String projectPath = Directory.GetParent( Directory.GetParent(Environment.CurrentDirectory).FullName).FullName;
string dotFile = dotFilePath + "\\snapshot"+ind+".dot";
using (System.IO.StreamWriter file = new System.IO.StreamWriter(dotFile, false)) {
file.WriteLine("digraph snapshot {");
foreach (CEDescr<HRegion, HEdge> e in this.AllEdges) {
string name1, name2;
name1 = e.VBegin.props.Name.Replace(",", "").Replace(":", "").Replace("(", "").Replace(")", "").Replace(" ", "");
name2 = e.VEnd.props.Name.Replace(",", "").Replace(":", "").Replace("(", "").Replace(")", "").Replace(" ", "");
file.WriteLine("\t" + name1 + " -> " + name2 + ";");
}
file.WriteLine("labelloc = \"t\"");
file.WriteLine("label = \"snapshot\"");
file.WriteLine("}");
}