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