private static void WriteToFile( StreamWriter file, StatisticsDataLogger.StatData data, int height) { string str1 = ""; for (int index = 0; index < height; ++index) { str1 += "| "; } if (!data.Identifier.IsFiltered && data.Details.Count > 0) { string str2 = str1 + " -"; foreach (string detail in data.Details) { file.WriteLine(str2 + detail); } } foreach (StatisticsDataLogger.StatData child in data.Children) { file.WriteLine(str1 + child.Identifier.Description + " : " + (object)child.Number); StatisticsDataLogger.WriteToFile(file, child, height + 1); } }
public static void Save(StatisticsDataIdentifier mask = null, string header = "") { using (StreamWriter file = new StreamWriter(StatisticsDataLogger.GetFileName())) { file.WriteLine("Application Time: " + (DateTime.Now - StatisticsDataLogger._applicationStartTime).ToString("G")); file.WriteLine("------------------------------------------"); file.WriteLine(header); file.WriteLine("------------------------------------------"); file.WriteLine("------------------------------------------"); if (mask != null) { StatisticsDataLogger.WriteToFile(file, StatisticsDataLogger._logTypes[mask.UniqueId], 0); } else { StatisticsDataLogger.WriteToFile(file, StatisticsDataLogger._rootData, 0); } } }