Files
ReLibreHardwareMonitor/Hardware/HDD/HarddriveGroup.cs
T
Phyxion 66e69c4c25 Pr/30 (#32)
* Unified operating system type detection

* Revert "Unified operating system type detection"

This reverts commit 3edf0edfceaca259e041e23b9930d78531366fd5.

* Introduced OperatingSystem.IsLinux instead of constant check on Os version.

* Misc
2018-02-10 14:01:52 +01:00

57 lines
1.4 KiB
C#

/*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (C) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
Copyright (C) 2010 Paul Werelds
Copyright (C) 2011 Roland Reinl <roland-reinl@gmx.de>
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace OpenHardwareMonitor.Hardware.HDD {
internal class HarddriveGroup : IGroup {
private const int MAX_DRIVES = 32;
private readonly List<AbstractHarddrive> hardware =
new List<AbstractHarddrive>();
public HarddriveGroup(ISettings settings) {
if (Software.OperatingSystem.IsLinux) return;
ISmart smart = new WindowsSmart();
for (int drive = 0; drive < MAX_DRIVES; drive++) {
AbstractHarddrive instance =
AbstractHarddrive.CreateInstance(smart, drive, settings);
if (instance != null) {
this.hardware.Add(instance);
}
}
}
public IHardware[] Hardware {
get {
return hardware.ToArray();
}
}
public string GetReport() {
return null;
}
public void Close() {
foreach (AbstractHarddrive hdd in hardware)
hdd.Close();
}
}
}