moel@370: /* moel@370: moel@370: This Source Code Form is subject to the terms of the Mozilla Public moel@370: License, v. 2.0. If a copy of the MPL was not distributed with this moel@370: file, You can obtain one at http://mozilla.org/MPL/2.0/. moel@370: moel@370: Copyright (C) 2012 Michael Möller moel@370: moel@370: */ moel@370: moel@372: using System; moel@372: moel@370: namespace OpenHardwareMonitor.Hardware.RAM { moel@370: internal class RAMGroup : IGroup { moel@370: moel@370: private IHardware[] hardware; moel@370: moel@370: public RAMGroup(SMBIOS smbios, ISettings settings) { moel@372: moel@372: // No implementation for RAM on Unix systems moel@372: int p = (int)Environment.OSVersion.Platform; moel@372: if ((p == 4) || (p == 128)) { moel@372: hardware = new IHardware[0]; moel@372: return; moel@372: } moel@372: moel@370: string name; moel@370: if (smbios.MemoryDevices.Length > 0) { moel@370: name = smbios.MemoryDevices[0].ManufacturerName + " " + moel@370: smbios.MemoryDevices[0].PartNumber; moel@370: } else { moel@370: name = "Generic Memory"; moel@370: } moel@370: moel@370: hardware = new IHardware[] { new GenericRAM(name, settings) }; moel@370: } moel@370: moel@370: public string GetReport() { moel@370: return null; moel@370: } moel@370: moel@370: public IHardware[] Hardware { moel@370: get { moel@370: return hardware; moel@370: } moel@370: } moel@370: moel@370: public void Close() { moel@370: moel@370: } moel@370: } moel@370: }