Changed the project files to Visual Studio 2010. Fixed some Code Analysis warnings.

This commit is contained in:
Michael Möller
2010-08-12 20:53:27 +00:00
parent a2650ba983
commit 2ec18bf862
37 changed files with 401 additions and 179 deletions
+10 -10
View File
@@ -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(
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
};
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
}
}
+2 -2
View File
@@ -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);