Release version 0.1.7. Improved report writer.
2 using System.Collections.Generic;
6 namespace OpenHardwareMonitor.Hardware {
7 public class ReportWriter {
9 private static void NewSection(TextWriter writer) {
10 for (int i = 0; i < 8; i++)
11 writer.Write("----------");
16 public static void Save(List<IGroup> groupList, Version version) {
19 new StreamWriter("OpenHardwareMonitor.Report.txt")) {
22 w.WriteLine("Open Hardware Monitor Report");
26 w.Write("Version: "); w.WriteLine(version.ToString());
30 foreach (IGroup group in groupList) {
31 foreach (IHardware hardware in group.Hardware) {
33 w.WriteLine("+-+ {0} ({1})",
34 new object[] { hardware.Name, hardware.Identifier });
35 foreach (ISensor sensor in hardware.Sensors) {
36 w.WriteLine("| +- {0} : {1} : {2} : {3}",
37 new object[] { sensor.SensorType, sensor.Index, sensor.Name,
44 foreach (IGroup group in groupList) {
45 string report = group.GetReport();
51 IHardware[] hardwareArray = group.Hardware;
52 foreach (IHardware hardware in hardwareArray) {
53 string hardwareReport = hardware.GetReport();
54 if (hardwareReport != null) {
56 w.Write(hardwareReport);