public RAMGroup(SMBIOS smbios, ISettings settings) { // No implementation for RAM on Unix systems int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { hardware = new Hardware[0]; return; } string name; if (smbios.MemoryDevices.Length > 0) { name = smbios.MemoryDevices[0].ManufacturerName + " " + smbios.MemoryDevices[0].PartNumber; } else { name = "Generic Memory"; } hardware = new Hardware[] { new GenericRAM(name, settings) }; }
public Mainboard(SMBIOS smbios, ISettings settings) { this.settings = settings; this.smbios = smbios; Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown : Identification.GetManufacturer(smbios.Board.ManufacturerName); Model model = smbios.Board == null ? Model.Unknown : Identification.GetModel(smbios.Board.ProductName); if (smbios.Board != null) { if (!string.IsNullOrEmpty(smbios.Board.ProductName)) { if (manufacturer == Manufacturer.Unknown) { this.name = smbios.Board.ProductName; } else { this.name = manufacturer + " " + smbios.Board.ProductName; } } else { this.name = manufacturer.ToString(); } } else { this.name = Manufacturer.Unknown.ToString(); } this.customName = settings.GetValue( new Identifier(Identifier, "name").ToString(), name); ISuperIO[] superIO; int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { this.lmSensors = new LMSensors(); superIO = lmSensors.SuperIO; } else { this.lpcio = new LPCIO(); superIO = lpcio.SuperIO; } superIOHardware = new Hardware[superIO.Length]; for (int i = 0; i < superIO.Length; i++) { superIOHardware[i] = new SuperIOHardware(this, superIO[i], manufacturer, model, settings); } }
public RAMGroup(SMBIOS smbios, ISettings settings) { // No implementation for RAM on Unix systems if (Software.OperatingSystem.IsLinux) { hardware = new Hardware[0]; return; } hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) }; }
public RAMGroup(SMBIOS smbios, ISettings settings) { // No implementation for RAM on Unix systems int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { hardware = new Hardware[0]; return; } hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) }; }
private void SetCpuClocks(GenericCPU cp, SMBIOS hwBios, CpuClocks cpuClocks) { cpuClocks.CoreSpeed = (float)(Math.Round(cp.TimeStampCounterFrequency, 2)); cpuClocks.BusSpeed = hwBios?.Processor.ExternalClock ?? 0; if (cpuClocks.BusSpeed > 0) { cpuClocks.Multiplier = Convert.ToDecimal(Math.Round(cpuClocks.CoreSpeed / cpuClocks.BusSpeed, MidpointRounding.ToEven)); cpuClocks.BusSpeed = (float)Math.Round(cpuClocks.CoreSpeed / (float)cpuClocks.Multiplier, 2); } }
/// <inheritdoc /> /// <summary> /// Initialize a new instance of the <see cref = "T:iTin.Core.Hardware.Specification.Dmi.DmiClassCollection" /> class. /// </summary> /// <param name="parent">Estructura.</param> internal DmiClassCollection(DmiStructure parent) : base(new List <DmiClass>()) { SMBIOS smbios = DmiHelper.Smbios; int smbiosVersion = smbios.Version; SmbiosStructureCollection structures = smbios.Get((SmbiosStructure)(int)parent.Class); foreach (var structure in structures) { Items.Add(new DmiClass(DmiStructureFactory.Create(structure, smbiosVersion))); } }
public void funcPopulateSMBIOSes() { SelectQuery QuerySMBIOSes = new SelectQuery("SELECT * FROM Win32_SMBIOSMemory"); ManagementObjectCollection moc = new ManagementObjectSearcher(QuerySMBIOSes).Get(); Parallel.ForEach(moc.Cast <ManagementObject>(), mo => { SMBIOS temp = new SMBIOS(mo); listSMBIOS.Add(temp); }); }
/// <inheritdoc/> /// <summary> /// Initialize a new instance of the <see cref="DmiStructureCollection"/> class. /// </summary> /// <param name="context">a <see cref="SMBIOS"/> reference.</param> internal DmiStructureCollection(SMBIOS context) : base(new List <DmiStructure>()) { if (context.Version == 0 && context.ImplementedStructures.Count == 0 && context.Lenght == 0) { return; } foreach (var smbiosStructure in context.ImplementedStructures) { Items.Add(new DmiStructure((DmiStructureClass)(int)smbiosStructure, context)); } }
public MainboardGroup(SMBIOS smbios, ISettings settings) { mainboards = new Mainboard[1]; mainboards[0] = new Mainboard(smbios, settings); }
/// <summary> /// Initializes a new instance of the <see cref="SmbiosStructureInfo"/> struct. /// </summary> /// <param name="context">The <see cref="SMBIOS"/> context.</param> /// <param name="structureType">Type of the structure.</param> public SmbiosStructureInfo(SMBIOS context, SmbiosStructure structureType) { Context = context; StructureType = structureType; SmbiosVersion = context.Version; }
public Mainboard(SMBIOS smbios, ISettings settings) { this.settings = settings; this.smbios = smbios; Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown : Identification.GetManufacturer(smbios.Board.ManufacturerName); Model model = smbios.Board == null ? Model.Unknown : Identification.GetModel(smbios.Board.ProductName); if (smbios.Board != null) { if (!string.IsNullOrEmpty(smbios.Board.ProductName)) { this.model = smbios.Board.ProductName; if (manufacturer == Manufacturer.Unknown) { this.manufacturer = String.Empty; } else { this.manufacturer = manufacturer.ToString(); } } else { this.manufacturer = manufacturer.ToString(); this.model = String.Empty; } } else { this.manufacturer = String.Empty; this.model = String.Empty; } String name; if (this.manufacturer == String.Empty) name = Manufacturer.Unknown.ToString(); else name = this.manufacturer; if (this.model != String.Empty) name += " " + this.model; this.name = name; this.customName = settings.GetValue( new Identifier(Identifier, "name").ToString(), name); ISuperIO[] superIO; int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { this.lmSensors = new LMSensors(); superIO = lmSensors.SuperIO; } else { this.lpcio = new LPCIO(); superIO = lpcio.SuperIO; } superIOHardware = new Hardware[superIO.Length]; for (int i = 0; i < superIO.Length; i++) superIOHardware[i] = new SuperIOHardware(this, superIO[i], manufacturer, model, settings); }
public Mainboard(SMBIOS smbios, ISettings settings) { this.settings = settings; this.smbios = smbios; Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown : Identification.GetManufacturer(smbios.Board.ManufacturerName); Model model = smbios.Board == null ? Model.Unknown : Identification.GetModel(smbios.Board.ProductName); if (smbios.Board != null) { if (!string.IsNullOrEmpty(smbios.Board.ProductName)) { this.model = smbios.Board.ProductName; if (manufacturer == Manufacturer.Unknown) { this.manufacturer = String.Empty; } else { this.manufacturer = manufacturer.ToString(); } } else { this.manufacturer = manufacturer.ToString(); this.model = String.Empty; } } else { this.manufacturer = String.Empty; this.model = String.Empty; } String name; if (this.manufacturer == String.Empty) { name = Manufacturer.Unknown.ToString(); } else { name = this.manufacturer; } if (this.model != String.Empty) { name += " " + this.model; } this.name = name; this.customName = settings.GetValue( new Identifier(Identifier, "name").ToString(), name); ISuperIO[] superIO; int p = (int)Environment.OSVersion.Platform; if ((p == 4) || (p == 128)) { this.lmSensors = new LMSensors(); superIO = lmSensors.SuperIO; } else { } }
/// <summary> /// Initialize a new instance of the class <see cref="DmiStructure"/>. /// </summary> /// <param name="class">Structure.</param> /// <param name="context">a <see cref="SMBIOS"/> reference.</param> internal DmiStructure(DmiStructureClass @class, SMBIOS context) { Class = @class; Context = context; }