public static string AddHardware(this IHardware hardware, ConfigurationInformation configInfo) { var name = hardware.GetID(); var msg = configInfo.details; switch (hardware.HardwareType) { case HardwareType.CPU: configInfo.CPUtype = hardware.Name; break; case HardwareType.GpuAti: case HardwareType.GpuNvidia: configInfo.GPUType = hardware.Name; break; case HardwareType.Mainboard: configInfo.MainboardType = hardware.Name; break; } // add the object to the dictionary string descriptionString = String.Empty; descriptionString = hardware.GetReport(); msg.Add(name, descriptionString); return(name); }
private static void ReportHardware(IHardware hardware, TextWriter w) { string hardwareReport = hardware.GetReport(); if (!string.IsNullOrEmpty(hardwareReport)) { NewSection(w); w.Write(hardwareReport); } foreach (IHardware subHardware in hardware.SubHardware) ReportHardware(subHardware, w); }
private void ReportHardware(IHardware hardware, TextWriter w) { string hardwareReport = hardware.GetReport(); if (hardwareReport != null && hardwareReport != "") { NewSection(w); w.Write(hardwareReport); } foreach (IHardware subHardware in hardware.SubHardware) { ReportHardware(subHardware, w); } }