Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openhardwaremonitor/openhardwaremonitor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Möller <mmoeller@openhardwaremonitor.org>2010-02-13 01:46:31 +0300
committerMichael Möller <mmoeller@openhardwaremonitor.org>2010-02-13 01:46:31 +0300
commitac6d7f818ad4415ebfa27417565dbedce8b27f67 (patch)
treeeed4a2f7fc556858d036c4c9e94a8283aced13e8 /Utilities
parent1b965a3ab3b68bbd96e9c182ea20fe1ccfe1fca2 (diff)
Tray sensor display default color is black and color can be changed now. Fixed CPU load reading for AMD CPUs and added additional misc device for AMD core temperature reading.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/Configuration.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Utilities/Configuration.cs b/Utilities/Configuration.cs
index 9f33257..6f378a4 100644
--- a/Utilities/Configuration.cs
+++ b/Utilities/Configuration.cs
@@ -37,6 +37,7 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
using System.IO;
namespace OpenHardwareMonitor.Utilities {
@@ -133,5 +134,25 @@ namespace OpenHardwareMonitor.Utilities {
return value;
}
}
+
+ public static void Set(string name, Color color) {
+ instance[name] = color.ToArgb().ToString("X8");
+ }
+
+ public static Color Get(string name, Color value) {
+ System.Configuration.KeyValueConfigurationElement element =
+ instance.config.AppSettings.Settings[name];
+ if (element == null)
+ return value;
+ else {
+ int parsedValue;
+ if (int.TryParse(element.Value,
+ System.Globalization.NumberStyles.HexNumber,
+ System.Globalization.CultureInfo.InvariantCulture, out parsedValue))
+ return Color.FromArgb(parsedValue);
+ else
+ return value;
+ }
+ }
}
}