Small bits of refactoring.
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ using System.Windows.Forms;
|
||||
using Aga.Controls.Tree;
|
||||
using Aga.Controls.Tree.NodeControls;
|
||||
using OpenHardwareMonitor.Hardware;
|
||||
using OpenHardwareMonitor.Wmi;
|
||||
using OpenHardwareMonitor.WMI;
|
||||
|
||||
namespace OpenHardwareMonitor.GUI {
|
||||
public partial class MainForm : Form {
|
||||
|
||||
+3
-2
@@ -77,7 +77,8 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
||||
this.drive = drive;
|
||||
this.count = 0;
|
||||
this.lifeID = lifeID;
|
||||
this.lifeSensor = new Sensor("HDD", 0, SensorType.Level, this, settings);
|
||||
this.lifeSensor = new Sensor("Remaining life", 0, SensorType.Level,
|
||||
this, settings);
|
||||
|
||||
Update();
|
||||
}
|
||||
@@ -136,7 +137,7 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
||||
attributes.Exists(attr => (int)attr.ID == (int)lifeID))
|
||||
{
|
||||
lifeSensor.Value = attributes
|
||||
.Find(attr => (int)attr.ID == (int)temperatureID)
|
||||
.Find(attr => (int)attr.ID == (int)lifeID)
|
||||
.AttrValue;
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@
|
||||
using System.Management.Instrumentation;
|
||||
using OpenHardwareMonitor.Hardware;
|
||||
|
||||
namespace OpenHardwareMonitor.Wmi {
|
||||
namespace OpenHardwareMonitor.WMI {
|
||||
[InstrumentationClass(InstrumentationType.Instance)]
|
||||
public class Hardware : IWmiObject {
|
||||
#region WMI Exposed
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
|
||||
*/
|
||||
|
||||
namespace OpenHardwareMonitor.Wmi {
|
||||
namespace OpenHardwareMonitor.WMI {
|
||||
interface IWmiObject {
|
||||
// Both of these get exposed to WMI
|
||||
string Name { get; }
|
||||
|
||||
+1
-2
@@ -37,9 +37,8 @@
|
||||
|
||||
using System.Management.Instrumentation;
|
||||
using OpenHardwareMonitor.Hardware;
|
||||
using OpenHardwareMonitor.Wmi;
|
||||
|
||||
namespace OpenHardwareMonitor.Wmi {
|
||||
namespace OpenHardwareMonitor.WMI {
|
||||
[InstrumentationClass(InstrumentationType.Instance)]
|
||||
public class Sensor : IWmiObject {
|
||||
private ISensor sensor;
|
||||
|
||||
+1
-2
@@ -39,14 +39,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Management.Instrumentation;
|
||||
using OpenHardwareMonitor.Hardware;
|
||||
using OpenHardwareMonitor.Wmi;
|
||||
|
||||
[assembly: Instrumented("root/OpenHardwareMonitor")]
|
||||
|
||||
[System.ComponentModel.RunInstaller(true)]
|
||||
public class InstanceInstaller : DefaultManagementProjectInstaller { }
|
||||
|
||||
namespace OpenHardwareMonitor.Wmi {
|
||||
namespace OpenHardwareMonitor.WMI {
|
||||
/// <summary>
|
||||
/// The WMI Provider.
|
||||
/// This class is not exposed to WMI itself.
|
||||
|
||||
Reference in New Issue
Block a user