/// <summary> /// Returns a list of integers that represent the Ids of node completed in a previous run. /// For example, if the log file says "Node 1 has completed (Success)" then node 1 would be marked as previously run. /// </summary> /// <param name="di"></param> /// <returns></returns> internal static List <int> LogReader(DI di) { var completeIds = new List <int>(); if (File.Exists(di.LogFilePath())) { var lines = File.ReadAllLines(di.LogFilePath()); foreach (var line in lines) { if (line.Contains("(Success)")) { var token = line.Split(); int id; Int32.TryParse(token[1], out id); completeIds.Add(id); } } } return(completeIds); }
internal void WriteToFile() { File.WriteAllLines(di.LogFilePath(), report.ToArray()); }