mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 14:25:16 +00:00
Changed the project files to Visual Studio 2010. Fixed some Code Analysis warnings.
This commit is contained in:
@@ -107,9 +107,9 @@ namespace OpenHardwareMonitor.GUI {
|
||||
nodeTextBoxText.EditorShowing += nodeTextBoxText_EditorShowing;
|
||||
|
||||
if (settings.Contains("mainForm.Location.X")) {
|
||||
int x = settings.Get("mainForm.Location.X", Location.X);
|
||||
int x = settings.GetValue("mainForm.Location.X", Location.X);
|
||||
x = x < 0 ? 0 : x;
|
||||
int y = settings.Get("mainForm.Location.Y", Location.Y);
|
||||
int y = settings.GetValue("mainForm.Location.Y", Location.Y);
|
||||
y = y < 0 ? 0 : y;
|
||||
this.Location = new Point(x, y);
|
||||
} else {
|
||||
@@ -117,12 +117,12 @@ namespace OpenHardwareMonitor.GUI {
|
||||
}
|
||||
|
||||
ClientSize = new Size(
|
||||
settings.Get("mainForm.Width", 470),
|
||||
settings.Get("mainForm.Height", 640));
|
||||
settings.GetValue("mainForm.Width", 470),
|
||||
settings.GetValue("mainForm.Height", 640));
|
||||
|
||||
foreach (TreeColumn column in treeView.Columns)
|
||||
column.Width = Math.Max(20, Math.Min(400,
|
||||
settings.Get("treeView.Columns." + column.Header + ".Width",
|
||||
settings.GetValue("treeView.Columns." + column.Header + ".Width",
|
||||
column.Width)));
|
||||
|
||||
treeModel = new TreeModel();
|
||||
@@ -317,14 +317,14 @@ namespace OpenHardwareMonitor.GUI {
|
||||
|
||||
private void SaveConfiguration() {
|
||||
if (WindowState != FormWindowState.Minimized) {
|
||||
settings.Set("mainForm.Location.X", Location.X);
|
||||
settings.Set("mainForm.Location.Y", Location.Y);
|
||||
settings.Set("mainForm.Width", ClientSize.Width);
|
||||
settings.Set("mainForm.Height", ClientSize.Height);
|
||||
settings.SetValue("mainForm.Location.X", Location.X);
|
||||
settings.SetValue("mainForm.Location.Y", Location.Y);
|
||||
settings.SetValue("mainForm.Width", ClientSize.Width);
|
||||
settings.SetValue("mainForm.Height", ClientSize.Height);
|
||||
}
|
||||
|
||||
foreach (TreeColumn column in treeView.Columns)
|
||||
settings.Set("treeView.Columns." + column.Header + ".Width",
|
||||
settings.SetValue("treeView.Columns." + column.Header + ".Width",
|
||||
column.Width);
|
||||
|
||||
settings.Save(Path.ChangeExtension(
|
||||
|
@@ -76,7 +76,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
case SensorType.Control: format = "{0:F1} %"; break;
|
||||
}
|
||||
|
||||
bool hidden = settings.Get(new Identifier(sensor.Identifier,
|
||||
bool hidden = settings.GetValue(new Identifier(sensor.Identifier,
|
||||
"hidden").ToString(), sensor.IsDefaultHidden);
|
||||
base.IsVisible = !hidden;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
get { return base.IsVisible; }
|
||||
set {
|
||||
base.IsVisible = value;
|
||||
settings.Set(new Identifier(sensor.Identifier,
|
||||
settings.SetValue(new Identifier(sensor.Identifier,
|
||||
"hidden").ToString(), !value);
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
if (sensor.SensorType == SensorType.Load) {
|
||||
defaultColor = Color.FromArgb(0xff, 0x70, 0x8c, 0xf1);
|
||||
}
|
||||
Color = settings.Get(new Identifier(sensor.Identifier,
|
||||
Color = settings.GetValue(new Identifier(sensor.Identifier,
|
||||
"traycolor").ToString(), defaultColor);
|
||||
|
||||
this.pen = new Pen(Color.FromArgb(96, Color.Black));
|
||||
@@ -95,7 +95,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
dialog.Color = Color;
|
||||
if (dialog.ShowDialog() == DialogResult.OK) {
|
||||
Color = dialog.Color;
|
||||
settings.Set(new Identifier(sensor.Identifier,
|
||||
settings.SetValue(new Identifier(sensor.Identifier,
|
||||
"traycolor").ToString(), Color);
|
||||
}
|
||||
};
|
||||
|
@@ -97,7 +97,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
}
|
||||
|
||||
private void SensorAdded(ISensor sensor) {
|
||||
if (settings.Get(new Identifier(sensor.Identifier,
|
||||
if (settings.GetValue(new Identifier(sensor.Identifier,
|
||||
"tray").ToString(), false))
|
||||
Add(sensor, false);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
} else {
|
||||
list.Add(new SensorNotifyIcon(this, sensor, balloonTip, settings));
|
||||
UpdateMainIconVisibilty();
|
||||
settings.Set(new Identifier(sensor.Identifier, "tray").ToString(), true);
|
||||
settings.SetValue(new Identifier(sensor.Identifier, "tray").ToString(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
|
||||
public UnitManager(PersistentSettings settings) {
|
||||
this.settings = settings;
|
||||
this.temperatureUnit = (TemperatureUnit)settings.Get("TemperatureUnit",
|
||||
this.temperatureUnit = (TemperatureUnit)settings.GetValue("TemperatureUnit",
|
||||
(int)TemperatureUnit.Celcius);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
get { return temperatureUnit; }
|
||||
set {
|
||||
this.temperatureUnit = value;
|
||||
this.settings.Set("TemperatureUnit", (int)temperatureUnit);
|
||||
this.settings.SetValue("TemperatureUnit", (int)temperatureUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.settings = settings;
|
||||
this.name = name;
|
||||
if (name != null)
|
||||
this.value = settings.Get(name, value);
|
||||
this.value = settings.GetValue(name, value);
|
||||
else
|
||||
this.value = value;
|
||||
this.menuItem = menuItem;
|
||||
@@ -72,7 +72,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
if (this.value != value) {
|
||||
this.value = value;
|
||||
if (this.name != null)
|
||||
settings.Set(name, value);
|
||||
settings.SetValue(name, value);
|
||||
this.menuItem.Checked = value;
|
||||
if (changed != null)
|
||||
changed(this, null);
|
||||
|
@@ -37,9 +37,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
internal class ATIGPU : Hardware {
|
||||
internal sealed class ATIGPU : Hardware {
|
||||
|
||||
private string name;
|
||||
private int adapterIndex;
|
||||
@@ -80,7 +81,10 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("atigpu", adapterIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("atigpu",
|
||||
adapterIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
@@ -55,7 +56,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
if (status == ADL.ADL_OK)
|
||||
report.AppendLine("OK");
|
||||
else
|
||||
report.AppendLine(status.ToString());
|
||||
report.AppendLine(status.ToString(CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
|
||||
if (status == ADL.ADL_OK) {
|
||||
@@ -63,7 +64,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
ADL.ADL_Adapter_NumberOfAdapters_Get(ref numberOfAdapters);
|
||||
|
||||
report.Append("Number of adapters: ");
|
||||
report.AppendLine(numberOfAdapters.ToString());
|
||||
report.AppendLine(numberOfAdapters.ToString(CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
|
||||
if (numberOfAdapters > 0) {
|
||||
@@ -78,25 +79,30 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
out adapterID);
|
||||
|
||||
report.Append("AdapterIndex: ");
|
||||
report.AppendLine(i.ToString());
|
||||
report.AppendLine(i.ToString(CultureInfo.InvariantCulture));
|
||||
report.Append("isActive: ");
|
||||
report.AppendLine(isActive.ToString());
|
||||
report.AppendLine(isActive.ToString(CultureInfo.InvariantCulture));
|
||||
report.Append("AdapterName: ");
|
||||
report.AppendLine(adapterInfo[i].AdapterName);
|
||||
report.Append("UDID: ");
|
||||
report.AppendLine(adapterInfo[i].UDID);
|
||||
report.Append("Present: ");
|
||||
report.AppendLine(adapterInfo[i].Present.ToString());
|
||||
report.AppendLine(adapterInfo[i].Present.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
report.Append("VendorID: ");
|
||||
report.AppendLine(adapterInfo[i].VendorID.ToString());
|
||||
report.AppendLine(adapterInfo[i].VendorID.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
report.Append("BusNumber: ");
|
||||
report.AppendLine(adapterInfo[i].BusNumber.ToString());
|
||||
report.AppendLine(adapterInfo[i].BusNumber.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
report.Append("DeviceNumber: ");
|
||||
report.AppendLine(adapterInfo[i].DeviceNumber.ToString());
|
||||
report.AppendLine(adapterInfo[i].DeviceNumber.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
report.Append("FunctionNumber: ");
|
||||
report.AppendLine(adapterInfo[i].FunctionNumber.ToString());
|
||||
report.AppendLine(adapterInfo[i].FunctionNumber.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
report.Append("AdapterID: 0x");
|
||||
report.AppendLine(adapterID.ToString("X"));
|
||||
report.AppendLine(adapterID.ToString("X", CultureInfo.InvariantCulture));
|
||||
|
||||
if (adapterID != 0 && adapterInfo[i].UDID != "" &&
|
||||
(adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID1 ||
|
||||
|
@@ -37,10 +37,11 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
internal class AMD0FCPU : Hardware, IHardware {
|
||||
internal sealed class AMD0FCPU : Hardware, IHardware {
|
||||
|
||||
private string name;
|
||||
|
||||
@@ -117,7 +118,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("amdcpu", processorIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("amdcpu",
|
||||
processorIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
|
@@ -37,12 +37,13 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
|
||||
internal class AMD10CPU : Hardware, IHardware {
|
||||
internal sealed class AMD10CPU : Hardware, IHardware {
|
||||
private string name;
|
||||
|
||||
private int processorIndex;
|
||||
@@ -101,7 +102,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("amdcpu", processorIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("amdcpu",
|
||||
processorIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
@@ -153,10 +154,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
private void AppendCpuidData(StringBuilder r, uint[,] data, uint offset) {
|
||||
for (int i = 0; i < data.GetLength(0); i++) {
|
||||
r.Append(" ");
|
||||
r.Append((i + offset).ToString("X8"));
|
||||
r.Append((i + offset).ToString("X8", CultureInfo.InvariantCulture));
|
||||
for (int j = 0; j < 4; j++) {
|
||||
r.Append(" ");
|
||||
r.Append(data[i, j].ToString("X8"));
|
||||
r.Append(data[i, j].ToString("X8", CultureInfo.InvariantCulture));
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
@@ -180,11 +181,14 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
r.AppendFormat("Processor Brand: {0}{1}", threads[i][0][0].BrandString,
|
||||
Environment.NewLine);
|
||||
r.AppendFormat("Family: 0x{0}{1}",
|
||||
threads[i][0][0].Family.ToString("X"), Environment.NewLine);
|
||||
threads[i][0][0].Family.ToString("X", CultureInfo.InvariantCulture),
|
||||
Environment.NewLine);
|
||||
r.AppendFormat("Model: 0x{0}{1}",
|
||||
threads[i][0][0].Model.ToString("X"), Environment.NewLine);
|
||||
threads[i][0][0].Model.ToString("X", CultureInfo.InvariantCulture),
|
||||
Environment.NewLine);
|
||||
r.AppendFormat("Stepping: 0x{0}{1}",
|
||||
threads[i][0][0].Stepping.ToString("X"), Environment.NewLine);
|
||||
threads[i][0][0].Stepping.ToString("X", CultureInfo.InvariantCulture),
|
||||
Environment.NewLine);
|
||||
r.AppendLine();
|
||||
|
||||
r.AppendLine("CPUID Return Values");
|
||||
|
@@ -127,10 +127,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
if (this.idleTimes == null)
|
||||
return;
|
||||
|
||||
long systemTime = DateTime.Now.Ticks;
|
||||
long[] idleTimes = GetIdleTimes();
|
||||
long localSystemTime = DateTime.Now.Ticks;
|
||||
long[] localIdleTimes = GetIdleTimes();
|
||||
|
||||
if (systemTime - this.systemTime < 10000)
|
||||
if (localSystemTime - this.systemTime < 10000)
|
||||
return;
|
||||
|
||||
float total = 0;
|
||||
@@ -139,28 +139,28 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
float value = 0;
|
||||
for (int j = 0; j < cpuid[i].Length; j++) {
|
||||
long index = cpuid[i][j].Thread;
|
||||
if (index < idleTimes.Length) {
|
||||
long delta = idleTimes[index] - this.idleTimes[index];
|
||||
if (index < localIdleTimes.Length) {
|
||||
long delta = localIdleTimes[index] - this.idleTimes[index];
|
||||
value += delta;
|
||||
total += delta;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
value = 1.0f - value / (cpuid[i].Length *
|
||||
(systemTime - this.systemTime));
|
||||
(localSystemTime - this.systemTime));
|
||||
value = value < 0 ? 0 : value;
|
||||
coreLoads[i] = value * 100;
|
||||
}
|
||||
if (count > 0) {
|
||||
total = 1.0f - total / (count * (systemTime - this.systemTime));
|
||||
total = 1.0f - total / (count * (localSystemTime - this.systemTime));
|
||||
total = total < 0 ? 0 : total;
|
||||
} else {
|
||||
total = 0;
|
||||
}
|
||||
this.totalLoad = total * 100;
|
||||
|
||||
this.systemTime = systemTime;
|
||||
this.idleTimes = idleTimes;
|
||||
this.systemTime = localSystemTime;
|
||||
this.idleTimes = localIdleTimes;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ using System.Threading;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
internal class IntelCPU : Hardware, IHardware {
|
||||
internal sealed class IntelCPU : Hardware, IHardware {
|
||||
|
||||
private int processorIndex;
|
||||
private CPUID[][] cpuid;
|
||||
@@ -243,7 +243,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("intelcpu", processorIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("intelcpu",
|
||||
processorIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
@@ -254,11 +257,11 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
uint eax, edx;
|
||||
if (WinRing0.RdmsrTx(msr, out eax, out edx, (UIntPtr)(1L << thread))) {
|
||||
r.Append(" ");
|
||||
r.Append((msr).ToString("X8"));
|
||||
r.Append((msr).ToString("X8", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
r.Append((edx).ToString("X8"));
|
||||
r.Append((edx).ToString("X8", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
r.Append((eax).ToString("X8"));
|
||||
r.Append((eax).ToString("X8", CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
}
|
||||
}
|
||||
|
@@ -196,7 +196,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
|
||||
public string GetReport() {
|
||||
|
||||
using (StringWriter w = new StringWriter()) {
|
||||
using (StringWriter w = new StringWriter(CultureInfo.InvariantCulture)) {
|
||||
|
||||
w.WriteLine();
|
||||
w.WriteLine("Open Hardware Monitor Report");
|
||||
@@ -266,6 +266,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
public event HardwareEventHandler HardwareRemoved;
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitComputer(this);
|
||||
}
|
||||
|
||||
@@ -281,9 +282,9 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Set(string name, string value) { }
|
||||
public void SetValue(string name, string value) { }
|
||||
|
||||
public string Get(string name, string value) {
|
||||
public string GetValue(string name, string value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.HDD {
|
||||
internal class HDD : IHardware {
|
||||
@@ -70,7 +71,10 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
||||
}
|
||||
|
||||
public Identifier Identifier {
|
||||
get { return new Identifier("hdd", drive.ToString()); }
|
||||
get {
|
||||
return new Identifier("hdd",
|
||||
drive.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public HardwareType HardwareType {
|
||||
@@ -113,6 +117,7 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
||||
#pragma warning restore 67
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitHardware(this);
|
||||
}
|
||||
|
||||
|
@@ -80,6 +80,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
public abstract void Update();
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitHardware(this);
|
||||
}
|
||||
|
||||
|
@@ -43,9 +43,9 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
|
||||
bool Contains(string name);
|
||||
|
||||
void Set(string name, string value);
|
||||
void SetValue(string name, string value);
|
||||
|
||||
string Get(string name, string value);
|
||||
string GetValue(string name, string value);
|
||||
|
||||
void Remove(string name);
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
@@ -84,7 +85,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
|
||||
r.AppendLine("LPC " + this.GetType().Name);
|
||||
r.AppendLine();
|
||||
r.Append("Base Adress: 0x"); r.AppendLine(address.ToString("X4"));
|
||||
r.Append("Base Adress: 0x");
|
||||
r.AppendLine(address.ToString("X4", CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
|
||||
if (!WinRing0.WaitIsaBusMutex(100))
|
||||
@@ -95,10 +97,13 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0xF; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X2", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
r.Append(" ");
|
||||
r.Append(ReadByte((byte)((i << 4) | j)).ToString("X2"));
|
||||
r.Append(ReadByte((byte)((i << 4) | j)).ToString("X2",
|
||||
CultureInfo.InvariantCulture));
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
@@ -114,8 +115,10 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
r.AppendLine("LPC " + this.GetType().Name);
|
||||
r.AppendLine();
|
||||
r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X"));
|
||||
r.Append("Chip Version: 0x"); r.AppendLine(version.ToString("X"));
|
||||
r.Append("Base Address: 0x"); r.AppendLine(address.ToString("X4"));
|
||||
r.Append("Chip Version: 0x"); r.AppendLine(
|
||||
version.ToString("X", CultureInfo.InvariantCulture));
|
||||
r.Append("Base Address: 0x"); r.AppendLine(
|
||||
address.ToString("X4", CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
|
||||
if (!WinRing0.WaitIsaBusMutex(100))
|
||||
@@ -126,13 +129,15 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0xA; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X2", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
r.Append(" ");
|
||||
bool valid;
|
||||
byte value = ReadByte((byte)((i << 4) | j), out valid);
|
||||
if (valid)
|
||||
r.Append(value.ToString("X2"));
|
||||
r.Append(value.ToString("X2", CultureInfo.InvariantCulture));
|
||||
else
|
||||
r.Append("??");
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
@@ -151,7 +152,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
voltageReaders[i].BaseStream.Seek(0, SeekOrigin.Begin);
|
||||
string s = voltageReaders[i].ReadLine();
|
||||
try {
|
||||
voltages[i] = 0.001f * long.Parse(s);
|
||||
voltages[i] = 0.001f *
|
||||
long.Parse(s, CultureInfo.InvariantCulture);
|
||||
} catch {
|
||||
voltages[i] = null;
|
||||
}
|
||||
@@ -161,7 +163,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
temperatureReaders[i].BaseStream.Seek(0, SeekOrigin.Begin);
|
||||
string s = temperatureReaders[i].ReadLine();
|
||||
try {
|
||||
temperatures[i] = 0.001f * long.Parse(s);
|
||||
temperatures[i] = 0.001f *
|
||||
long.Parse(s, CultureInfo.InvariantCulture);
|
||||
} catch {
|
||||
temperatures[i] = null;
|
||||
}
|
||||
@@ -171,7 +174,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
fanReaders[i].BaseStream.Seek(0, SeekOrigin.Begin);
|
||||
string s = fanReaders[i].ReadLine();
|
||||
try {
|
||||
fans[i] = long.Parse(s);
|
||||
fans[i] = long.Parse(s, CultureInfo.InvariantCulture);
|
||||
} catch {
|
||||
fans[i] = null;
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
@@ -238,7 +239,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
WinbondFintekExit();
|
||||
|
||||
report.Append("Chip ID: Unknown Winbond / Fintek with ID 0x");
|
||||
report.AppendLine(((id << 8) | revision).ToString("X"));
|
||||
report.AppendLine(((id << 8) | revision).ToString("X",
|
||||
CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
}
|
||||
} else {
|
||||
@@ -256,7 +258,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
report.Append("Chip ID: 0x");
|
||||
report.AppendLine(chip.ToString("X"));
|
||||
report.Append("Chip revision: 0x");
|
||||
report.AppendLine(revision.ToString("X"));
|
||||
report.AppendLine(revision.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine("Error: Address verification failed");
|
||||
report.AppendLine();
|
||||
return;
|
||||
@@ -270,9 +272,9 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
report.Append("Chip ID: 0x");
|
||||
report.AppendLine(chip.ToString("X"));
|
||||
report.Append("Chip revision: 0x");
|
||||
report.AppendLine(revision.ToString("X"));
|
||||
report.AppendLine(revision.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.Append("Error: Invalid address 0x");
|
||||
report.AppendLine(address.ToString("X"));
|
||||
report.AppendLine(address.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
return;
|
||||
}
|
||||
@@ -298,9 +300,9 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
report.Append("Chip ID: 0x");
|
||||
report.AppendLine(chip.ToString("X"));
|
||||
report.Append("Chip revision: 0x");
|
||||
report.AppendLine(revision.ToString("X"));
|
||||
report.AppendLine(revision.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.Append("Error: Invalid vendor ID 0x");
|
||||
report.AppendLine(vendorID.ToString("X"));
|
||||
report.AppendLine(vendorID.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
return;
|
||||
}
|
||||
@@ -328,7 +330,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
IT87Exit();
|
||||
|
||||
report.Append("Chip ID: Unknown ITE with ID 0x");
|
||||
report.AppendLine(chipID.ToString("X"));
|
||||
report.AppendLine(chipID.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
}
|
||||
} else {
|
||||
@@ -345,7 +347,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
report.Append("Chip ID: 0x");
|
||||
report.AppendLine(chip.ToString("X"));
|
||||
report.Append("Error: Invalid address 0x");
|
||||
report.AppendLine(address.ToString("X"));
|
||||
report.AppendLine(address.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
return;
|
||||
}
|
||||
@@ -366,7 +368,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
SMSCExit();
|
||||
|
||||
report.Append("Chip ID: Unknown SMSC with ID 0x");
|
||||
report.AppendLine(chipID.ToString("X"));
|
||||
report.AppendLine(chipID.ToString("X", CultureInfo.InvariantCulture));
|
||||
report.AppendLine();
|
||||
}
|
||||
} else {
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
@@ -291,8 +292,10 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
r.AppendLine("LPC " + this.GetType().Name);
|
||||
r.AppendLine();
|
||||
r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X"));
|
||||
r.Append("Chip revision: 0x"); r.AppendLine(revision.ToString("X"));
|
||||
r.Append("Base Adress: 0x"); r.AppendLine(address.ToString("X4"));
|
||||
r.Append("Chip revision: 0x");
|
||||
r.AppendLine(revision.ToString("X", CultureInfo.InvariantCulture));
|
||||
r.Append("Base Adress: 0x");
|
||||
r.AppendLine(address.ToString("X4", CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
|
||||
if (!WinRing0.WaitIsaBusMutex(100))
|
||||
@@ -303,21 +306,26 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0x7; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X2", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
r.Append(" ");
|
||||
r.Append(ReadByte(0, (byte)((i << 4) | j)).ToString("X2"));
|
||||
r.Append(ReadByte(0, (byte)((i << 4) | j)).ToString(
|
||||
"X2", CultureInfo.InvariantCulture));
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
for (int k = 1; k <= 15; k++) {
|
||||
r.AppendLine("Bank " + k);
|
||||
for (int i = 0x5; i < 0x6; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X2", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
r.Append(" ");
|
||||
r.Append(ReadByte((byte)(k),
|
||||
(byte)((i << 4) | j)).ToString("X2"));
|
||||
r.Append(ReadByte((byte)(k), (byte)((i << 4) | j)).ToString(
|
||||
"X2", CultureInfo.InvariantCulture));
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
|
@@ -131,6 +131,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
|
||||
#pragma warning restore 67
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitHardware(this);
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using OpenHardwareMonitor.Hardware.LPC;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.Mainboard {
|
||||
@@ -593,7 +594,10 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
|
||||
get {
|
||||
return new Identifier("lpc",
|
||||
superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
@@ -115,7 +116,10 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
}
|
||||
|
||||
public override Identifier Identifier {
|
||||
get { return new Identifier("nvidiagpu", adapterIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("nvidiagpu",
|
||||
adapterIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override HardwareType HardwareType {
|
||||
@@ -136,12 +140,12 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
}
|
||||
|
||||
private uint[] GetClocks() {
|
||||
NvClocks clocks = new NvClocks();
|
||||
clocks.Version = NVAPI.GPU_CLOCKS_VER;
|
||||
clocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
|
||||
NvClocks allClocks = new NvClocks();
|
||||
allClocks.Version = NVAPI.GPU_CLOCKS_VER;
|
||||
allClocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
|
||||
if (NVAPI.NvAPI_GPU_GetAllClocks != null &&
|
||||
NVAPI.NvAPI_GPU_GetAllClocks(handle, ref clocks) == NvStatus.OK) {
|
||||
return clocks.Clock;
|
||||
NVAPI.NvAPI_GPU_GetAllClocks(handle, ref allClocks) == NvStatus.OK) {
|
||||
return allClocks.Clock;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -235,7 +239,7 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
r.Append("Driver Version: ");
|
||||
r.Append(driverVersion.DriverVersion / 100);
|
||||
r.Append(".");
|
||||
r.Append((driverVersion.DriverVersion % 100).ToString("00"));
|
||||
r.Append((driverVersion.DriverVersion % 100).ToString("00", CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
r.Append("Driver Branch: ");
|
||||
r.AppendLine(driverVersion.BuildBranch);
|
||||
@@ -275,17 +279,17 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
}
|
||||
|
||||
if (NVAPI.NvAPI_GPU_GetAllClocks != null) {
|
||||
NvClocks clocks = new NvClocks();
|
||||
clocks.Version = NVAPI.GPU_CLOCKS_VER;
|
||||
clocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
|
||||
NvStatus status = NVAPI.NvAPI_GPU_GetAllClocks(handle, ref clocks);
|
||||
NvClocks allClocks = new NvClocks();
|
||||
allClocks.Version = NVAPI.GPU_CLOCKS_VER;
|
||||
allClocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
|
||||
NvStatus status = NVAPI.NvAPI_GPU_GetAllClocks(handle, ref allClocks);
|
||||
|
||||
r.AppendLine("Clocks");
|
||||
r.AppendLine();
|
||||
if (status == NvStatus.OK) {
|
||||
for (int i = 0; i < clocks.Clock.Length; i++)
|
||||
if (clocks.Clock[i] > 0) {
|
||||
r.AppendFormat(" Clock[{0}]: {1}{2}", i, clocks.Clock[i],
|
||||
for (int i = 0; i < allClocks.Clock.Length; i++)
|
||||
if (allClocks.Clock[i] > 0) {
|
||||
r.AppendFormat(" Clock[{0}]: {1}{2}", i, allClocks.Clock[i],
|
||||
Environment.NewLine);
|
||||
}
|
||||
} else {
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
@@ -104,7 +105,7 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
}
|
||||
|
||||
report.Append("Number of GPUs: ");
|
||||
report.AppendLine(count.ToString());
|
||||
report.AppendLine(count.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
NvDisplayHandle displayHandle;
|
||||
|
@@ -36,6 +36,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware {
|
||||
@@ -75,9 +76,9 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
this.isDefault = !settings.Contains(Identifier.ToString());
|
||||
this.value = description.DefaultValue;
|
||||
if (!this.isDefault) {
|
||||
if (!float.TryParse(settings.Get(Identifier.ToString(), "0"),
|
||||
System.Globalization.NumberStyles.Float,
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
if (!float.TryParse(settings.GetValue(Identifier.ToString(), "0"),
|
||||
NumberStyles.Float,
|
||||
CultureInfo.InvariantCulture,
|
||||
out this.value))
|
||||
this.value = description.DefaultValue;
|
||||
}
|
||||
@@ -92,7 +93,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
public Identifier Identifier {
|
||||
get {
|
||||
return new Identifier(sensor.Identifier, "parameter",
|
||||
Name.Replace(" ", "").ToLower());
|
||||
Name.Replace(" ", "").ToLowerInvariant());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +108,8 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
set {
|
||||
this.isDefault = false;
|
||||
this.value = value;
|
||||
this.settings.Set(Identifier.ToString(), value.ToString(
|
||||
System.Globalization.CultureInfo.InvariantCulture.NumberFormat));
|
||||
this.settings.SetValue(Identifier.ToString(), value.ToString(
|
||||
CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +129,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
}
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitParameter(this);
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using OpenHardwareMonitor.Collections;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware {
|
||||
@@ -88,7 +89,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
|
||||
this.settings = settings;
|
||||
this.defaultName = name;
|
||||
this.name = settings.Get(
|
||||
this.name = settings.GetValue(
|
||||
new Identifier(Identifier, "name").ToString(), name);
|
||||
}
|
||||
|
||||
@@ -103,7 +104,8 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
public Identifier Identifier {
|
||||
get {
|
||||
return new Identifier(hardware.Identifier,
|
||||
sensorType.ToString().ToLower(), index.ToString());
|
||||
sensorType.ToString().ToLowerInvariant(),
|
||||
index.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +118,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
name = value;
|
||||
else
|
||||
name = defaultName;
|
||||
settings.Set(new Identifier(Identifier, "name").ToString(), name);
|
||||
settings.SetValue(new Identifier(Identifier, "name").ToString(), name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +177,7 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
}
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitSensor(this);
|
||||
}
|
||||
|
||||
|
@@ -38,6 +38,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
@@ -276,7 +277,10 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
}
|
||||
|
||||
public Identifier Identifier {
|
||||
get { return new Identifier("bigng", this.portIndex.ToString()); }
|
||||
get {
|
||||
return new Identifier("bigng",
|
||||
this.portIndex.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public IHardware[] SubHardware {
|
||||
@@ -292,7 +296,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
|
||||
r.AppendLine("T-Balancer bigNG");
|
||||
r.AppendLine();
|
||||
r.Append("Port Index: "); r.AppendLine(portIndex.ToString());
|
||||
r.Append("Port Index: ");
|
||||
r.AppendLine(portIndex.ToString(CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
|
||||
r.AppendLine("Primary System Information Answer");
|
||||
@@ -300,12 +305,14 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0x11; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X3")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X3", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
int index = ((i << 4) | j);
|
||||
if (index < primaryData.Length) {
|
||||
r.Append(" ");
|
||||
r.Append(primaryData[index].ToString("X2"));
|
||||
r.Append(primaryData[index].ToString("X2", CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
r.AppendLine();
|
||||
@@ -318,12 +325,14 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0x11; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X3")); r.Append(" ");
|
||||
r.Append(" ");
|
||||
r.Append((i << 4).ToString("X3", CultureInfo.InvariantCulture));
|
||||
r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
int index = ((i << 4) | j);
|
||||
if (index < alternativeData.Length) {
|
||||
r.Append(" ");
|
||||
r.Append(alternativeData[index].ToString("X2"));
|
||||
r.Append(alternativeData[index].ToString("X2", CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
r.AppendLine();
|
||||
@@ -367,6 +376,7 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
public event SensorEventHandler SensorRemoved;
|
||||
|
||||
public void Accept(IVisitor visitor) {
|
||||
if (visitor != null)
|
||||
visitor.VisitHardware(this);
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Ports;
|
||||
using System.Text;
|
||||
@@ -62,7 +63,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
FTD2XX.FT_GetDeviceInfoList(info, ref numDevices);
|
||||
|
||||
for (int i = 0; i < numDevices; i++) {
|
||||
report.Append("Device Index: "); report.AppendLine(i.ToString());
|
||||
report.Append("Device Index: ");
|
||||
report.AppendLine(i.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
FT_HANDLE handle;
|
||||
FT_STATUS status;
|
||||
@@ -112,7 +114,8 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
protocolVersion = data[274];
|
||||
if (!isValid) {
|
||||
report.Append("Status: Wrong Protocol Version: 0x");
|
||||
report.AppendLine(protocolVersion.ToString("X"));
|
||||
report.AppendLine(
|
||||
protocolVersion.ToString("X", CultureInfo.InvariantCulture));
|
||||
}
|
||||
} else {
|
||||
report.AppendLine("Status: Wrong Message Length: " + length);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -15,6 +15,25 @@
|
||||
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
|
||||
<ApplicationManifest>Resources\app.manifest</ApplicationManifest>
|
||||
<StartupObject>OpenHardwareMonitor.Program</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -25,6 +44,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
@@ -34,17 +54,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Merge|AnyCPU' ">
|
||||
<OutputPath>bin\Merge\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<OutputType>Module</OutputType>
|
||||
<DebugType>none</DebugType>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
@@ -94,6 +104,7 @@
|
||||
<Compile Include="GUI\UnitManager.cs" />
|
||||
<Compile Include="GUI\UpdateVisitor.cs" />
|
||||
<Compile Include="GUI\UserOption.cs" />
|
||||
<Compile Include="Properties\AssemblyVersion.cs" />
|
||||
<Compile Include="Utilities\PersistentSettings.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="GUI\AboutBox.cs">
|
||||
@@ -169,6 +180,23 @@
|
||||
<Name>OpenHardwareMonitorLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio AllowExistingFolder="true" />
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHardwareMonitorLib", "OpenHardwareMonitorLib.csproj", "{B0397530-545A-471D-BB74-027AE456DF1A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHardwareMonitor", "OpenHardwareMonitor.csproj", "{F5E0C1F7-9E9B-46F2-AC88-8C9C1C923880}"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -12,8 +12,25 @@
|
||||
<AssemblyName>OpenHardwareMonitorLib</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkSubset>
|
||||
</TargetFrameworkSubset>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -23,6 +40,7 @@
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
@@ -31,6 +49,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
@@ -83,12 +102,30 @@
|
||||
<Compile Include="Hardware\TBalancer\TBalancerGroup.cs" />
|
||||
<Compile Include="Hardware\WinRing0.cs" />
|
||||
<Compile Include="Hardware\ISettings.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Hardware\HexStringArray.cs" />
|
||||
<Compile Include="Collections\IReadOnlyArray.cs" />
|
||||
<Compile Include="Collections\ListSet.cs" />
|
||||
<Compile Include="Hardware\PInvokeDelegateFactory.cs" />
|
||||
<Compile Include="Collections\ReadOnlyArray.cs" />
|
||||
<Compile Include="Properties\AssemblyLibInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyVersion.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
@@ -35,13 +35,11 @@
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Open Hardware Monitor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
@@ -51,23 +49,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f7a1c873-0bec-4762-8707-2edce3a6444d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.37.3")]
|
||||
[assembly: AssemblyFileVersion("0.1.37.3")]
|
||||
|
53
Properties/AssemblyLibInfo.cs
Normal file
53
Properties/AssemblyLibInfo.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the License.
|
||||
|
||||
The Original Code is the Open Hardware Monitor code.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Michael Möller <m.moeller@gmx.ch>.
|
||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Open Hardware Monitor Library")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Open Hardware Monitor Library")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009-2010 Michael Möller")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: CLSCompliant(true)]
|
42
Properties/AssemblyVersion.cs
Normal file
42
Properties/AssemblyVersion.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the License.
|
||||
|
||||
The Original Code is the Open Hardware Monitor code.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Michael Möller <m.moeller@gmx.ch>.
|
||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.1.37.3")]
|
||||
[assembly: AssemblyFileVersion("0.1.37.3")]
|
@@ -95,11 +95,11 @@ namespace OpenHardwareMonitor {
|
||||
return settings.ContainsKey(name);
|
||||
}
|
||||
|
||||
public void Set(string name, string value) {
|
||||
public void SetValue(string name, string value) {
|
||||
settings[name] = value;
|
||||
}
|
||||
|
||||
public string Get(string name, string value) {
|
||||
public string GetValue(string name, string value) {
|
||||
string result;
|
||||
if (settings.TryGetValue(name, out result))
|
||||
return result;
|
||||
@@ -111,11 +111,11 @@ namespace OpenHardwareMonitor {
|
||||
settings.Remove(name);
|
||||
}
|
||||
|
||||
public void Set(string name, int value) {
|
||||
public void SetValue(string name, int value) {
|
||||
settings[name] = value.ToString();
|
||||
}
|
||||
|
||||
public int Get(string name, int value) {
|
||||
public int GetValue(string name, int value) {
|
||||
string str;
|
||||
if (settings.TryGetValue(name, out str)) {
|
||||
int parsedValue;
|
||||
@@ -128,11 +128,11 @@ namespace OpenHardwareMonitor {
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(string name, bool value) {
|
||||
public void SetValue(string name, bool value) {
|
||||
settings[name] = value ? "true" : "false";
|
||||
}
|
||||
|
||||
public bool Get(string name, bool value) {
|
||||
public bool GetValue(string name, bool value) {
|
||||
string str;
|
||||
if (settings.TryGetValue(name, out str)) {
|
||||
return str == "true";
|
||||
@@ -141,11 +141,11 @@ namespace OpenHardwareMonitor {
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(string name, Color color) {
|
||||
public void SetValue(string name, Color color) {
|
||||
settings[name] = color.ToArgb().ToString("X8");
|
||||
}
|
||||
|
||||
public Color Get(string name, Color value) {
|
||||
public Color GetValue(string name, Color value) {
|
||||
string str;
|
||||
if (settings.TryGetValue(name, out str)) {
|
||||
int parsedValue;
|
||||
|
Reference in New Issue
Block a user