author | moel.mich |
Mon, 01 Oct 2012 17:10:09 +0000 | |
changeset 381 | ed5d5fc482ed |
parent 370 | 8e4dedc41924 |
child 401 | c37f2b5ee55b |
permissions | -rw-r--r-- |
moel@370 | 1 |
/* |
moel@370 | 2 |
|
moel@370 | 3 |
This Source Code Form is subject to the terms of the Mozilla Public |
moel@370 | 4 |
License, v. 2.0. If a copy of the MPL was not distributed with this |
moel@370 | 5 |
file, You can obtain one at http://mozilla.org/MPL/2.0/. |
moel@370 | 6 |
|
moel@370 | 7 |
Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org> |
moel@370 | 8 |
|
moel@370 | 9 |
*/ |
moel@370 | 10 |
|
moel@372 | 11 |
using System; |
moel@372 | 12 |
|
moel@370 | 13 |
namespace OpenHardwareMonitor.Hardware.RAM { |
moel@370 | 14 |
internal class RAMGroup : IGroup { |
moel@370 | 15 |
|
moel@370 | 16 |
private IHardware[] hardware; |
moel@370 | 17 |
|
moel@370 | 18 |
public RAMGroup(SMBIOS smbios, ISettings settings) { |
moel@372 | 19 |
|
moel@372 | 20 |
// No implementation for RAM on Unix systems |
moel@372 | 21 |
int p = (int)Environment.OSVersion.Platform; |
moel@372 | 22 |
if ((p == 4) || (p == 128)) { |
moel@372 | 23 |
hardware = new IHardware[0]; |
moel@372 | 24 |
return; |
moel@372 | 25 |
} |
moel@372 | 26 |
|
moel@370 | 27 |
string name; |
moel@370 | 28 |
if (smbios.MemoryDevices.Length > 0) { |
moel@370 | 29 |
name = smbios.MemoryDevices[0].ManufacturerName + " " + |
moel@370 | 30 |
smbios.MemoryDevices[0].PartNumber; |
moel@370 | 31 |
} else { |
moel@370 | 32 |
name = "Generic Memory"; |
moel@370 | 33 |
} |
moel@370 | 34 |
|
moel@370 | 35 |
hardware = new IHardware[] { new GenericRAM(name, settings) }; |
moel@370 | 36 |
} |
moel@370 | 37 |
|
moel@370 | 38 |
public string GetReport() { |
moel@370 | 39 |
return null; |
moel@370 | 40 |
} |
moel@370 | 41 |
|
moel@370 | 42 |
public IHardware[] Hardware { |
moel@370 | 43 |
get { |
moel@370 | 44 |
return hardware; |
moel@370 | 45 |
} |
moel@370 | 46 |
} |
moel@370 | 47 |
|
moel@370 | 48 |
public void Close() { |
moel@370 | 49 |
|
moel@370 | 50 |
} |
moel@370 | 51 |
} |
moel@370 | 52 |
} |