moel@122: /* moel@122: 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@122: moel@344: Copyright (C) 2009-2011 Michael Möller moel@344: moel@122: */ moel@122: moel@122: using System; moel@122: using System.Collections.Generic; moel@122: moel@122: namespace OpenHardwareMonitor.GUI { moel@122: moel@122: public enum TemperatureUnit { moel@299: Celsius = 0, moel@122: Fahrenheit = 1 moel@122: } moel@122: moel@122: public class UnitManager { moel@122: moel@165: private PersistentSettings settings; moel@165: private TemperatureUnit temperatureUnit; moel@122: moel@165: public UnitManager(PersistentSettings settings) { moel@165: this.settings = settings; moel@166: this.temperatureUnit = (TemperatureUnit)settings.GetValue("TemperatureUnit", moel@299: (int)TemperatureUnit.Celsius); moel@122: } moel@122: moel@165: public TemperatureUnit TemperatureUnit { moel@122: get { return temperatureUnit; } moel@122: set { moel@165: this.temperatureUnit = value; moel@166: this.settings.SetValue("TemperatureUnit", (int)temperatureUnit); moel@122: } moel@122: } moel@122: } moel@122: }