Hardware/Parameter.cs
changeset 166 fa9dfbfc4145
parent 165 813d8bc3192f
child 167 b7cc9d09aefe
     1.1 --- a/Hardware/Parameter.cs	Sun Aug 08 13:57:26 2010 +0000
     1.2 +++ b/Hardware/Parameter.cs	Thu Aug 12 20:53:27 2010 +0000
     1.3 @@ -36,6 +36,7 @@
     1.4  */
     1.5  
     1.6  using System;
     1.7 +using System.Globalization;
     1.8  using System.Collections.Generic;
     1.9  
    1.10  namespace OpenHardwareMonitor.Hardware {
    1.11 @@ -75,9 +76,9 @@
    1.12        this.isDefault = !settings.Contains(Identifier.ToString());
    1.13        this.value = description.DefaultValue;
    1.14        if (!this.isDefault) {
    1.15 -        if (!float.TryParse(settings.Get(Identifier.ToString(), "0"),
    1.16 -          System.Globalization.NumberStyles.Float,
    1.17 -          System.Globalization.CultureInfo.InvariantCulture,
    1.18 +        if (!float.TryParse(settings.GetValue(Identifier.ToString(), "0"),
    1.19 +          NumberStyles.Float,
    1.20 +          CultureInfo.InvariantCulture,
    1.21            out this.value))
    1.22            this.value = description.DefaultValue;
    1.23        }
    1.24 @@ -91,8 +92,8 @@
    1.25  
    1.26      public Identifier Identifier {
    1.27        get {
    1.28 -        return new Identifier(sensor.Identifier, "parameter", 
    1.29 -          Name.Replace(" ", "").ToLower());
    1.30 +        return new Identifier(sensor.Identifier, "parameter",
    1.31 +          Name.Replace(" ", "").ToLowerInvariant());
    1.32        }
    1.33      }
    1.34  
    1.35 @@ -107,8 +108,8 @@
    1.36        set {
    1.37          this.isDefault = false;
    1.38          this.value = value;
    1.39 -        this.settings.Set(Identifier.ToString(), value.ToString(
    1.40 -          System.Globalization.CultureInfo.InvariantCulture.NumberFormat));
    1.41 +        this.settings.SetValue(Identifier.ToString(), value.ToString(
    1.42 +          CultureInfo.InvariantCulture));
    1.43        }
    1.44      }
    1.45  
    1.46 @@ -128,7 +129,8 @@
    1.47      }
    1.48  
    1.49      public void Accept(IVisitor visitor) {
    1.50 -      visitor.VisitParameter(this);
    1.51 +      if (visitor != null)
    1.52 +        visitor.VisitParameter(this);
    1.53      }
    1.54  
    1.55      public void Traverse(IVisitor visitor) { }