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); }