Fixed some Code Analysis warnings.
authormoel.mich
Wed, 08 Sep 2010 19:29:58 +0000
changeset 1824801e9eaf979
parent 181 9901dbb25f18
child 183 3096735e99b2
Fixed some Code Analysis warnings.
Hardware/ATI/ADL.cs
Hardware/ATI/ATIGPU.cs
Hardware/CPU/AMD0FCPU.cs
Hardware/CPU/CPUGroup.cs
Hardware/CPU/CPUID.cs
Hardware/CPU/CPULoad.cs
Hardware/CPU/IntelCPU.cs
Hardware/Computer.cs
Hardware/Hardware.cs
Hardware/Heatmaster/Heatmaster.cs
Hardware/Heatmaster/HeatmasterGroup.cs
Hardware/HexStringArray.cs
Hardware/IComputer.cs
Hardware/IElement.cs
Hardware/IGroup.cs
Hardware/IHardware.cs
Hardware/IParameter.cs
Hardware/ISettings.cs
Hardware/IVisitor.cs
Hardware/Identifier.cs
Hardware/LPC/Chip.cs
Hardware/LPC/ISuperIO.cs
Hardware/LPC/IT87XX.cs
Hardware/LPC/LMSensors.cs
Hardware/LPC/W836XX.cs
Hardware/Mainboard/Mainboard.cs
Hardware/Mainboard/MainboardGroup.cs
Hardware/Mainboard/SuperIOHardware.cs
Hardware/Nvidia/NVAPI.cs
Hardware/Nvidia/NvidiaGPU.cs
Hardware/Nvidia/NvidiaGroup.cs
Hardware/Parameter.cs
Hardware/SensorVisitor.cs
Hardware/TBalancer/FTD2XX.cs
Hardware/TBalancer/TBalancer.cs
Hardware/TBalancer/TBalancerGroup.cs
Hardware/WinRing0.cs
     1.1 --- a/Hardware/ATI/ADL.cs	Tue Sep 07 22:15:02 2010 +0000
     1.2 +++ b/Hardware/ATI/ADL.cs	Wed Sep 08 19:29:58 2010 +0000
     1.3 @@ -36,7 +36,6 @@
     1.4  */
     1.5  
     1.6  using System;
     1.7 -using System.Collections.Generic;
     1.8  using System.Runtime.InteropServices;
     1.9  
    1.10  namespace OpenHardwareMonitor.Hardware.ATI {
     2.1 --- a/Hardware/ATI/ATIGPU.cs	Tue Sep 07 22:15:02 2010 +0000
     2.2 +++ b/Hardware/ATI/ATIGPU.cs	Wed Sep 08 19:29:58 2010 +0000
     2.3 @@ -36,7 +36,6 @@
     2.4  */
     2.5  
     2.6  using System;
     2.7 -using System.Collections.Generic;
     2.8  using System.Globalization;
     2.9  
    2.10  namespace OpenHardwareMonitor.Hardware.ATI {
     3.1 --- a/Hardware/CPU/AMD0FCPU.cs	Tue Sep 07 22:15:02 2010 +0000
     3.2 +++ b/Hardware/CPU/AMD0FCPU.cs	Wed Sep 08 19:29:58 2010 +0000
     3.3 @@ -36,9 +36,7 @@
     3.4  */
     3.5  
     3.6  using System;
     3.7 -using System.Collections.Generic;
     3.8  using System.Globalization;
     3.9 -using System.Text;
    3.10  
    3.11  namespace OpenHardwareMonitor.Hardware.CPU {
    3.12    internal sealed class AMD0FCPU : Hardware, IHardware {
     4.1 --- a/Hardware/CPU/CPUGroup.cs	Tue Sep 07 22:15:02 2010 +0000
     4.2 +++ b/Hardware/CPU/CPUGroup.cs	Wed Sep 08 19:29:58 2010 +0000
     4.3 @@ -38,7 +38,6 @@
     4.4  using System;
     4.5  using System.Collections.Generic;
     4.6  using System.Globalization;
     4.7 -using System.Diagnostics;
     4.8  using System.Text;
     4.9  
    4.10  namespace OpenHardwareMonitor.Hardware.CPU {
     5.1 --- a/Hardware/CPU/CPUID.cs	Tue Sep 07 22:15:02 2010 +0000
     5.2 +++ b/Hardware/CPU/CPUID.cs	Wed Sep 08 19:29:58 2010 +0000
     5.3 @@ -36,7 +36,6 @@
     5.4  */
     5.5  
     5.6  using System;
     5.7 -using System.Collections.Generic;
     5.8  using System.Text;
     5.9  
    5.10  namespace OpenHardwareMonitor.Hardware.CPU {
     6.1 --- a/Hardware/CPU/CPULoad.cs	Tue Sep 07 22:15:02 2010 +0000
     6.2 +++ b/Hardware/CPU/CPULoad.cs	Wed Sep 08 19:29:58 2010 +0000
     6.3 @@ -36,9 +36,7 @@
     6.4  */
     6.5  
     6.6  using System;
     6.7 -using System.Collections.Generic;
     6.8  using System.Runtime.InteropServices;
     6.9 -using System.Text;
    6.10  
    6.11  namespace OpenHardwareMonitor.Hardware.CPU {
    6.12    internal class CPULoad {
     7.1 --- a/Hardware/CPU/IntelCPU.cs	Tue Sep 07 22:15:02 2010 +0000
     7.2 +++ b/Hardware/CPU/IntelCPU.cs	Wed Sep 08 19:29:58 2010 +0000
     7.3 @@ -39,10 +39,8 @@
     7.4  using System.Collections.Generic;
     7.5  using System.Diagnostics;
     7.6  using System.Globalization;
     7.7 -using System.Reflection;
     7.8 -using System.Runtime.InteropServices;
     7.9 +using System.Text;
    7.10  using System.Threading;
    7.11 -using System.Text;
    7.12  
    7.13  namespace OpenHardwareMonitor.Hardware.CPU {
    7.14    internal sealed class IntelCPU : Hardware, IHardware {
     8.1 --- a/Hardware/Computer.cs	Tue Sep 07 22:15:02 2010 +0000
     8.2 +++ b/Hardware/Computer.cs	Wed Sep 08 19:29:58 2010 +0000
     8.3 @@ -37,14 +37,10 @@
     8.4  
     8.5  using System;
     8.6  using System.Collections.Generic;
     8.7 +using System.Globalization;
     8.8  using System.IO;
     8.9 -using System.Globalization;
    8.10 -using System.Text;
    8.11 -using System.Threading;
    8.12 -using System.Security;
    8.13  using System.Security.Permissions;
    8.14  
    8.15 -
    8.16  namespace OpenHardwareMonitor.Hardware {
    8.17  
    8.18    public class Computer : IComputer {
     9.1 --- a/Hardware/Hardware.cs	Tue Sep 07 22:15:02 2010 +0000
     9.2 +++ b/Hardware/Hardware.cs	Wed Sep 08 19:29:58 2010 +0000
     9.3 @@ -36,7 +36,6 @@
     9.4  */
     9.5  
     9.6  using System;
     9.7 -using System.Collections.Generic;
     9.8  using OpenHardwareMonitor.Collections;
     9.9  
    9.10  namespace OpenHardwareMonitor.Hardware {
    10.1 --- a/Hardware/Heatmaster/Heatmaster.cs	Tue Sep 07 22:15:02 2010 +0000
    10.2 +++ b/Hardware/Heatmaster/Heatmaster.cs	Wed Sep 08 19:29:58 2010 +0000
    10.3 @@ -36,7 +36,7 @@
    10.4  */
    10.5  
    10.6  using System;
    10.7 -using System.Collections.Generic;
    10.8 +using System.Globalization;
    10.9  using System.IO;
   10.10  using System.IO.Ports;
   10.11  using System.Text;
   10.12 @@ -44,7 +44,7 @@
   10.13  using System.Threading;
   10.14  
   10.15  namespace OpenHardwareMonitor.Hardware.Heatmaster {
   10.16 -  internal class Heatmaster : Hardware {
   10.17 +  internal class Heatmaster : Hardware, IDisposable {
   10.18  
   10.19      private string portName;
   10.20      private SerialPort serialPort;
   10.21 @@ -85,8 +85,9 @@
   10.22        serialPort.WriteLine("[0:" + device + "]R" + field);
   10.23        for (int i = 0; i < 5; i++) {
   10.24          string s = ReadLine(200);
   10.25 -        Match match = Regex.Match(s, @"-\[0:" + device.ToString() + @"\]R" +
   10.26 -          Regex.Escape(field.ToString()) + ":(.*)");
   10.27 +        Match match = Regex.Match(s, @"-\[0:" + 
   10.28 +          device.ToString(CultureInfo.InvariantCulture) + @"\]R" +
   10.29 +          Regex.Escape(field.ToString(CultureInfo.InvariantCulture)) + ":(.*)");
   10.30          if (match.Success) 
   10.31            return match.Groups[1].Value;
   10.32        }
   10.33 @@ -114,8 +115,10 @@
   10.34        serialPort.WriteLine("[0:" + device + "]W" + field + ":" + value);
   10.35        for (int i = 0; i < 5; i++) {
   10.36          string s = ReadLine(200);
   10.37 -        Match match = Regex.Match(s, @"-\[0:" + device.ToString() + @"\]W" + 
   10.38 -          Regex.Escape(field.ToString()) + ":" + value);
   10.39 +        Match match = Regex.Match(s, @"-\[0:" + 
   10.40 +          device.ToString(CultureInfo.InvariantCulture) + @"\]W" + 
   10.41 +          Regex.Escape(field.ToString(CultureInfo.InvariantCulture)) +
   10.42 +          ":" + value);
   10.43          if (match.Success)
   10.44            return true;
   10.45        }
   10.46 @@ -123,7 +126,8 @@
   10.47      }
   10.48  
   10.49      private bool WriteInteger(int device, char field, int value) {
   10.50 -      return WriteField(device, field, value.ToString());
   10.51 +      return WriteField(device, field, 
   10.52 +        value.ToString(CultureInfo.InvariantCulture));
   10.53      }
   10.54  
   10.55      private bool WriteString(int device, char field, string value) {
   10.56 @@ -233,7 +237,7 @@
   10.57              string[] strings = s.Split(':');
   10.58              int[] ints = new int[strings.Length];
   10.59              for (int i = 0; i < ints.Length; i++)
   10.60 -              ints[i] = int.Parse(strings[i]);
   10.61 +              ints[i] = int.Parse(strings[i], CultureInfo.InvariantCulture);
   10.62              switch (device) {
   10.63                case 32:
   10.64                  if (ints.Length == 3 && ints[0] <= fans.Length) {
   10.65 @@ -282,11 +286,11 @@
   10.66        r.Append("Port: ");
   10.67        r.AppendLine(portName);
   10.68        r.Append("Hardware Revision: ");
   10.69 -      r.AppendLine(hardwareRevision.ToString());
   10.70 +      r.AppendLine(hardwareRevision.ToString(CultureInfo.InvariantCulture));
   10.71        r.Append("Firmware Revision: ");
   10.72 -      r.AppendLine(firmwareRevision.ToString());
   10.73 +      r.AppendLine(firmwareRevision.ToString(CultureInfo.InvariantCulture));
   10.74        r.Append("Firmware CRC: ");
   10.75 -      r.AppendLine(firmwareCRC.ToString());
   10.76 +      r.AppendLine(firmwareCRC.ToString(CultureInfo.InvariantCulture));
   10.77        r.AppendLine();
   10.78  
   10.79        return r.ToString();
   10.80 @@ -294,6 +298,15 @@
   10.81  
   10.82      public void Close() {
   10.83        serialPort.Close();
   10.84 +      serialPort.Dispose();
   10.85 +      serialPort = null;
   10.86 +    }
   10.87 +
   10.88 +    public void Dispose() {
   10.89 +      if (serialPort != null) {
   10.90 +        serialPort.Dispose();
   10.91 +        serialPort = null;
   10.92 +      }
   10.93      }
   10.94    }
   10.95  }
    11.1 --- a/Hardware/Heatmaster/HeatmasterGroup.cs	Tue Sep 07 22:15:02 2010 +0000
    11.2 +++ b/Hardware/Heatmaster/HeatmasterGroup.cs	Wed Sep 08 19:29:58 2010 +0000
    11.3 @@ -37,6 +37,7 @@
    11.4  
    11.5  using System;
    11.6  using System.Collections.Generic;
    11.7 +using System.Globalization;
    11.8  using System.IO.Ports;
    11.9  using System.Security;
   11.10  using System.Text;
   11.11 @@ -99,77 +100,77 @@
   11.12  
   11.13        string[] portNames = GetRegistryPortNames();      
   11.14        for (int i = portNames.Length - 1; i >= 0; i--) {
   11.15 -        try {
   11.16 +        bool isValid = false;
   11.17 +        try {        
   11.18 +          using (SerialPort serialPort =
   11.19 +            new SerialPort(portNames[i], 38400, Parity.None, 8, StopBits.One)) {
   11.20 +            serialPort.NewLine = ((char)0x0D).ToString();            
   11.21 +            report.Append("Port Name: "); report.AppendLine(portNames[i]);
   11.22  
   11.23 -          SerialPort serialPort =
   11.24 -            new SerialPort(portNames[i], 38400, Parity.None, 8, StopBits.One);
   11.25 -          serialPort.NewLine = ((char)0x0D).ToString();
   11.26 +            try {
   11.27 +              serialPort.Open();
   11.28 +            } catch (UnauthorizedAccessException) {
   11.29 +              report.AppendLine("Exception: Access Denied");
   11.30 +            }
   11.31  
   11.32 -          bool isValid = false;
   11.33 -          report.Append("Port Name: "); report.AppendLine(portNames[i]);
   11.34 +            if (serialPort.IsOpen) {
   11.35 +              serialPort.DiscardInBuffer();
   11.36 +              serialPort.DiscardOutBuffer();
   11.37 +              serialPort.Write(new byte[] { 0xAA }, 0, 1);
   11.38  
   11.39 -          try {
   11.40 -            serialPort.Open();
   11.41 -          } catch (UnauthorizedAccessException) {
   11.42 -            report.AppendLine("Exception: Access Denied");
   11.43 -          }
   11.44 -
   11.45 -          if (serialPort.IsOpen) {
   11.46 -            serialPort.DiscardInBuffer();
   11.47 -            serialPort.DiscardOutBuffer(); 
   11.48 -            serialPort.Write(new byte[] { 0xAA }, 0, 1);
   11.49 -
   11.50 -            int j = 0;
   11.51 -            while (serialPort.BytesToRead == 0 && j < 10) {
   11.52 -              Thread.Sleep(20);
   11.53 -              j++;
   11.54 -            }
   11.55 -            if (serialPort.BytesToRead > 0) {
   11.56 -              bool flag = false;
   11.57 -              while (serialPort.BytesToRead > 0 && !flag) {
   11.58 -                flag |= (serialPort.ReadByte() == 0xAA);
   11.59 +              int j = 0;
   11.60 +              while (serialPort.BytesToRead == 0 && j < 10) {
   11.61 +                Thread.Sleep(20);
   11.62 +                j++;
   11.63                }
   11.64 -              if (flag) {
   11.65 -                serialPort.WriteLine("[0:0]RH");
   11.66 -                try {
   11.67 -                  int k = 0;
   11.68 -                  int revision = 0;
   11.69 -                  while (k < 5) {
   11.70 -                    string line = ReadLine(serialPort, 100);
   11.71 -                    if (line.StartsWith("-[0:0]RH:")) {
   11.72 -                      int.TryParse(line.Substring(9), out revision);
   11.73 -                      break;
   11.74 +              if (serialPort.BytesToRead > 0) {
   11.75 +                bool flag = false;
   11.76 +                while (serialPort.BytesToRead > 0 && !flag) {
   11.77 +                  flag |= (serialPort.ReadByte() == 0xAA);
   11.78 +                }
   11.79 +                if (flag) {
   11.80 +                  serialPort.WriteLine("[0:0]RH");
   11.81 +                  try {
   11.82 +                    int k = 0;
   11.83 +                    int revision = 0;
   11.84 +                    while (k < 5) {
   11.85 +                      string line = ReadLine(serialPort, 100);
   11.86 +                      if (line.StartsWith("-[0:0]RH:",
   11.87 +                        StringComparison.Ordinal)) {
   11.88 +                        revision = int.Parse(line.Substring(9), 
   11.89 +                          CultureInfo.InvariantCulture);
   11.90 +                        break;
   11.91 +                      }
   11.92 +                      k++;
   11.93                      }
   11.94 -                    k++;
   11.95 +                    isValid = (revision == 770);
   11.96 +                    if (!isValid) {
   11.97 +                      report.Append("Status: Wrong Hardware Revision " +
   11.98 +                        revision.ToString(CultureInfo.InvariantCulture));
   11.99 +                    }
  11.100 +                  } catch (TimeoutException) {
  11.101 +                    report.AppendLine("Status: Timeout Reading Revision");
  11.102                    }
  11.103 -                  isValid = (revision == 770); 
  11.104 -                  if (!isValid) {
  11.105 -                    report.Append("Status: Wrong Hardware Revision " + 
  11.106 -                      revision.ToString());
  11.107 -                  }                 
  11.108 -                } catch (TimeoutException) {
  11.109 -                  report.AppendLine("Status: Timeout Reading Revision");
  11.110 +                } else {
  11.111 +                  report.AppendLine("Status: Wrong Startflag");
  11.112                  }
  11.113                } else {
  11.114 -                report.AppendLine("Status: Wrong Startflag");
  11.115 +                report.AppendLine("Status: No Response");
  11.116                }
  11.117 +              serialPort.DiscardInBuffer();
  11.118              } else {
  11.119 -              report.AppendLine("Status: No Response");
  11.120 -            }
  11.121 -            serialPort.DiscardInBuffer();
  11.122 -            serialPort.Close();
  11.123 -            serialPort.Dispose();
  11.124 -          } else {
  11.125 -            report.AppendLine("Status: Port not Open");
  11.126 -          }                          
  11.127 -          if (isValid) {
  11.128 -            report.AppendLine("Status: OK");
  11.129 -            hardware.Add(new Heatmaster(portNames[i], settings));
  11.130 -            return;
  11.131 +              report.AppendLine("Status: Port not Open");
  11.132 +            }            
  11.133            }
  11.134          } catch (Exception e) {
  11.135            report.AppendLine(e.ToString());
  11.136 -        } 
  11.137 +        }
  11.138 +
  11.139 +        if (isValid) {
  11.140 +          report.AppendLine("Status: OK");
  11.141 +          hardware.Add(new Heatmaster(portNames[i], settings));
  11.142 +          return;
  11.143 +        }
  11.144          report.AppendLine();
  11.145        }
  11.146      }
    12.1 --- a/Hardware/HexStringArray.cs	Tue Sep 07 22:15:02 2010 +0000
    12.2 +++ b/Hardware/HexStringArray.cs	Wed Sep 08 19:29:58 2010 +0000
    12.3 @@ -37,7 +37,6 @@
    12.4  
    12.5  using System;
    12.6  using System.Collections.Generic;
    12.7 -using System.Text;
    12.8  
    12.9  namespace OpenHardwareMonitor.Hardware {
   12.10    internal class HexStringArray {
    13.1 --- a/Hardware/IComputer.cs	Tue Sep 07 22:15:02 2010 +0000
    13.2 +++ b/Hardware/IComputer.cs	Wed Sep 08 19:29:58 2010 +0000
    13.3 @@ -35,9 +35,6 @@
    13.4   
    13.5  */
    13.6  
    13.7 -using System;
    13.8 -using System.Collections.Generic;
    13.9 -
   13.10  namespace OpenHardwareMonitor.Hardware {
   13.11  
   13.12    public delegate void HardwareEventHandler(IHardware hardware);
    14.1 --- a/Hardware/IElement.cs	Tue Sep 07 22:15:02 2010 +0000
    14.2 +++ b/Hardware/IElement.cs	Wed Sep 08 19:29:58 2010 +0000
    14.3 @@ -35,10 +35,6 @@
    14.4   
    14.5  */
    14.6  
    14.7 -using System;
    14.8 -using System.Collections.Generic;
    14.9 -using System.Text;
   14.10 -
   14.11  namespace OpenHardwareMonitor.Hardware {
   14.12    
   14.13    public interface IElement {
    15.1 --- a/Hardware/IGroup.cs	Tue Sep 07 22:15:02 2010 +0000
    15.2 +++ b/Hardware/IGroup.cs	Wed Sep 08 19:29:58 2010 +0000
    15.3 @@ -35,9 +35,6 @@
    15.4   
    15.5  */
    15.6  
    15.7 -using System;
    15.8 -using System.Collections.Generic;
    15.9 -
   15.10  namespace OpenHardwareMonitor.Hardware {
   15.11  
   15.12    internal interface IGroup {
    16.1 --- a/Hardware/IHardware.cs	Tue Sep 07 22:15:02 2010 +0000
    16.2 +++ b/Hardware/IHardware.cs	Wed Sep 08 19:29:58 2010 +0000
    16.3 @@ -35,9 +35,6 @@
    16.4   
    16.5  */
    16.6  
    16.7 -using System;
    16.8 -using System.Collections.Generic;
    16.9 -
   16.10  namespace OpenHardwareMonitor.Hardware {
   16.11  
   16.12    public delegate void SensorEventHandler(ISensor sensor);
    17.1 --- a/Hardware/IParameter.cs	Tue Sep 07 22:15:02 2010 +0000
    17.2 +++ b/Hardware/IParameter.cs	Wed Sep 08 19:29:58 2010 +0000
    17.3 @@ -35,9 +35,6 @@
    17.4   
    17.5  */
    17.6  
    17.7 -using System;
    17.8 -using System.Collections.Generic;
    17.9 -
   17.10  namespace OpenHardwareMonitor.Hardware {
   17.11  
   17.12    public interface IParameter : IElement {
    18.1 --- a/Hardware/ISettings.cs	Tue Sep 07 22:15:02 2010 +0000
    18.2 +++ b/Hardware/ISettings.cs	Wed Sep 08 19:29:58 2010 +0000
    18.3 @@ -35,9 +35,6 @@
    18.4   
    18.5  */
    18.6  
    18.7 -using System;
    18.8 -using System.Collections.Generic;
    18.9 -
   18.10  namespace OpenHardwareMonitor.Hardware {
   18.11    public interface ISettings {
   18.12  
    19.1 --- a/Hardware/IVisitor.cs	Tue Sep 07 22:15:02 2010 +0000
    19.2 +++ b/Hardware/IVisitor.cs	Wed Sep 08 19:29:58 2010 +0000
    19.3 @@ -35,10 +35,6 @@
    19.4   
    19.5  */
    19.6  
    19.7 -using System;
    19.8 -using System.Collections.Generic;
    19.9 -using System.Text;
   19.10 -
   19.11  namespace OpenHardwareMonitor.Hardware {
   19.12  
   19.13    public interface IVisitor {
    20.1 --- a/Hardware/Identifier.cs	Tue Sep 07 22:15:02 2010 +0000
    20.2 +++ b/Hardware/Identifier.cs	Wed Sep 08 19:29:58 2010 +0000
    20.3 @@ -36,7 +36,6 @@
    20.4  */
    20.5  
    20.6  using System;
    20.7 -using System.Collections.Generic;
    20.8  using System.Text;
    20.9  
   20.10  namespace OpenHardwareMonitor.Hardware {
   20.11 @@ -45,7 +44,7 @@
   20.12  
   20.13      private static char SEPARATOR = '/';
   20.14  
   20.15 -    private static void CheckIdentifiers(string[] identifiers) {
   20.16 +    private static void CheckIdentifiers(string[] identifiers) {      
   20.17        foreach (string s in identifiers)
   20.18          if (s.Contains(" ") || s.Contains(SEPARATOR.ToString()))
   20.19            throw new ArgumentException("Invalid identifier");
   20.20 @@ -97,7 +96,34 @@
   20.21        if (other == null)
   20.22          return 1;
   20.23        else 
   20.24 -        return this.identifier.CompareTo(other.identifier);
   20.25 +        return string.Compare(this.identifier, other.identifier, 
   20.26 +          StringComparison.Ordinal);
   20.27      }
   20.28 +
   20.29 +    public static bool operator ==(Identifier id1, Identifier id2) {
   20.30 +      if (id1 == null)
   20.31 +        return id2 == null;
   20.32 +      else
   20.33 +        return id1.Equals(id2);
   20.34 +    }
   20.35 +
   20.36 +    public static bool operator !=(Identifier id1, Identifier id2) {
   20.37 +      return !(id1 == id2);
   20.38 +    }
   20.39 +
   20.40 +    public static bool operator <(Identifier id1, Identifier id2) {
   20.41 +      if (id1 == null)
   20.42 +        return id2 != null;
   20.43 +      else 
   20.44 +        return (id1.CompareTo(id2) < 0);
   20.45 +    }
   20.46 +
   20.47 +    public static bool operator >(Identifier id1, Identifier id2) {
   20.48 +      if (id1 == null)
   20.49 +        return false;
   20.50 +      else 
   20.51 +        return (id1.CompareTo(id2) > 0);
   20.52 +    }  
   20.53 +
   20.54    }
   20.55  }
    21.1 --- a/Hardware/LPC/Chip.cs	Tue Sep 07 22:15:02 2010 +0000
    21.2 +++ b/Hardware/LPC/Chip.cs	Wed Sep 08 19:29:58 2010 +0000
    21.3 @@ -1,7 +1,39 @@
    21.4 -
    21.5 -using System;
    21.6 -using System.Collections.Generic;
    21.7 -using System.Text;
    21.8 +/*
    21.9 +  
   21.10 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
   21.11 +
   21.12 +  The contents of this file are subject to the Mozilla Public License Version
   21.13 +  1.1 (the "License"); you may not use this file except in compliance with
   21.14 +  the License. You may obtain a copy of the License at
   21.15 + 
   21.16 +  http://www.mozilla.org/MPL/
   21.17 +
   21.18 +  Software distributed under the License is distributed on an "AS IS" basis,
   21.19 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   21.20 +  for the specific language governing rights and limitations under the License.
   21.21 +
   21.22 +  The Original Code is the Open Hardware Monitor code.
   21.23 +
   21.24 +  The Initial Developer of the Original Code is 
   21.25 +  Michael Möller <m.moeller@gmx.ch>.
   21.26 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
   21.27 +  the Initial Developer. All Rights Reserved.
   21.28 +
   21.29 +  Contributor(s):
   21.30 +
   21.31 +  Alternatively, the contents of this file may be used under the terms of
   21.32 +  either the GNU General Public License Version 2 or later (the "GPL"), or
   21.33 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   21.34 +  in which case the provisions of the GPL or the LGPL are applicable instead
   21.35 +  of those above. If you wish to allow use of your version of this file only
   21.36 +  under the terms of either the GPL or the LGPL, and not to allow others to
   21.37 +  use your version of this file under the terms of the MPL, indicate your
   21.38 +  decision by deleting the provisions above and replace them with the notice
   21.39 +  and other provisions required by the GPL or the LGPL. If you do not delete
   21.40 +  the provisions above, a recipient may use your version of this file under
   21.41 +  the terms of any one of the MPL, the GPL or the LGPL.
   21.42 + 
   21.43 +*/
   21.44  
   21.45  namespace OpenHardwareMonitor.Hardware.LPC {
   21.46  
   21.47 @@ -59,7 +91,6 @@
   21.48          default: return "Unknown";
   21.49        }
   21.50      }
   21.51 -
   21.52    }
   21.53  
   21.54  }
    22.1 --- a/Hardware/LPC/ISuperIO.cs	Tue Sep 07 22:15:02 2010 +0000
    22.2 +++ b/Hardware/LPC/ISuperIO.cs	Wed Sep 08 19:29:58 2010 +0000
    22.3 @@ -35,9 +35,6 @@
    22.4   
    22.5  */
    22.6  
    22.7 -using System;
    22.8 -using System.Collections.Generic;
    22.9 -
   22.10  namespace OpenHardwareMonitor.Hardware.LPC {
   22.11    internal interface ISuperIO {
   22.12  
    23.1 --- a/Hardware/LPC/IT87XX.cs	Tue Sep 07 22:15:02 2010 +0000
    23.2 +++ b/Hardware/LPC/IT87XX.cs	Wed Sep 08 19:29:58 2010 +0000
    23.3 @@ -35,8 +35,6 @@
    23.4   
    23.5  */
    23.6  
    23.7 -using System;
    23.8 -using System.Collections.Generic;
    23.9  using System.Globalization;
   23.10  using System.Text;
   23.11  
    24.1 --- a/Hardware/LPC/LMSensors.cs	Tue Sep 07 22:15:02 2010 +0000
    24.2 +++ b/Hardware/LPC/LMSensors.cs	Wed Sep 08 19:29:58 2010 +0000
    24.3 @@ -35,7 +35,6 @@
    24.4   
    24.5  */
    24.6  
    24.7 -using System;
    24.8  using System.Collections.Generic;
    24.9  using System.Globalization;
   24.10  using System.IO;
    25.1 --- a/Hardware/LPC/W836XX.cs	Tue Sep 07 22:15:02 2010 +0000
    25.2 +++ b/Hardware/LPC/W836XX.cs	Wed Sep 08 19:29:58 2010 +0000
    25.3 @@ -36,7 +36,6 @@
    25.4  */
    25.5  
    25.6  using System;
    25.7 -using System.Collections.Generic;
    25.8  using System.Globalization;
    25.9  using System.Text;
   25.10  
    26.1 --- a/Hardware/Mainboard/Mainboard.cs	Tue Sep 07 22:15:02 2010 +0000
    26.2 +++ b/Hardware/Mainboard/Mainboard.cs	Wed Sep 08 19:29:58 2010 +0000
    26.3 @@ -36,7 +36,6 @@
    26.4  */
    26.5  
    26.6  using System;
    26.7 -using System.Collections.Generic;
    26.8  using System.Text;
    26.9  using OpenHardwareMonitor.Hardware.LPC;
   26.10  
    27.1 --- a/Hardware/Mainboard/MainboardGroup.cs	Tue Sep 07 22:15:02 2010 +0000
    27.2 +++ b/Hardware/Mainboard/MainboardGroup.cs	Wed Sep 08 19:29:58 2010 +0000
    27.3 @@ -35,9 +35,6 @@
    27.4   
    27.5  */
    27.6  
    27.7 -using System;
    27.8 -using System.Collections.Generic;
    27.9 -
   27.10  namespace OpenHardwareMonitor.Hardware.Mainboard {
   27.11    internal class MainboardGroup : IGroup {
   27.12  
    28.1 --- a/Hardware/Mainboard/SuperIOHardware.cs	Tue Sep 07 22:15:02 2010 +0000
    28.2 +++ b/Hardware/Mainboard/SuperIOHardware.cs	Wed Sep 08 19:29:58 2010 +0000
    28.3 @@ -35,7 +35,6 @@
    28.4   
    28.5  */
    28.6  
    28.7 -using System;
    28.8  using System.Collections.Generic;
    28.9  using System.Globalization;
   28.10  using OpenHardwareMonitor.Hardware.LPC;
    29.1 --- a/Hardware/Nvidia/NVAPI.cs	Tue Sep 07 22:15:02 2010 +0000
    29.2 +++ b/Hardware/Nvidia/NVAPI.cs	Wed Sep 08 19:29:58 2010 +0000
    29.3 @@ -36,7 +36,6 @@
    29.4  */
    29.5  
    29.6  using System;
    29.7 -using System.Collections.Generic;
    29.8  using System.Runtime.InteropServices;
    29.9  using System.Text;
   29.10  
    30.1 --- a/Hardware/Nvidia/NvidiaGPU.cs	Tue Sep 07 22:15:02 2010 +0000
    30.2 +++ b/Hardware/Nvidia/NvidiaGPU.cs	Wed Sep 08 19:29:58 2010 +0000
    30.3 @@ -36,7 +36,6 @@
    30.4  */
    30.5  
    30.6  using System;
    30.7 -using System.Collections.Generic;
    30.8  using System.Globalization;
    30.9  using System.Text;
   30.10  
    31.1 --- a/Hardware/Nvidia/NvidiaGroup.cs	Tue Sep 07 22:15:02 2010 +0000
    31.2 +++ b/Hardware/Nvidia/NvidiaGroup.cs	Wed Sep 08 19:29:58 2010 +0000
    31.3 @@ -35,7 +35,6 @@
    31.4   
    31.5  */
    31.6  
    31.7 -using System;
    31.8  using System.Collections.Generic;
    31.9  using System.Globalization;
   31.10  using System.Text;
    32.1 --- a/Hardware/Parameter.cs	Tue Sep 07 22:15:02 2010 +0000
    32.2 +++ b/Hardware/Parameter.cs	Wed Sep 08 19:29:58 2010 +0000
    32.3 @@ -37,7 +37,6 @@
    32.4  
    32.5  using System;
    32.6  using System.Globalization;
    32.7 -using System.Collections.Generic;
    32.8  
    32.9  namespace OpenHardwareMonitor.Hardware {
   32.10  
    33.1 --- a/Hardware/SensorVisitor.cs	Tue Sep 07 22:15:02 2010 +0000
    33.2 +++ b/Hardware/SensorVisitor.cs	Wed Sep 08 19:29:58 2010 +0000
    33.3 @@ -37,7 +37,6 @@
    33.4  
    33.5  using System;
    33.6  using System.Collections.Generic;
    33.7 -using OpenHardwareMonitor.Hardware;
    33.8  
    33.9  namespace OpenHardwareMonitor.Hardware {
   33.10  
    34.1 --- a/Hardware/TBalancer/FTD2XX.cs	Tue Sep 07 22:15:02 2010 +0000
    34.2 +++ b/Hardware/TBalancer/FTD2XX.cs	Wed Sep 08 19:29:58 2010 +0000
    34.3 @@ -36,7 +36,6 @@
    34.4  */
    34.5  
    34.6  using System;
    34.7 -using System.Collections.Generic;
    34.8  using System.Runtime.InteropServices;
    34.9  
   34.10  namespace OpenHardwareMonitor.Hardware.TBalancer {
    35.1 --- a/Hardware/TBalancer/TBalancer.cs	Tue Sep 07 22:15:02 2010 +0000
    35.2 +++ b/Hardware/TBalancer/TBalancer.cs	Wed Sep 08 19:29:58 2010 +0000
    35.3 @@ -37,7 +37,6 @@
    35.4  
    35.5  using System;
    35.6  using System.Collections.Generic;
    35.7 -using System.Configuration;
    35.8  using System.Globalization;
    35.9  using System.Text;
   35.10  
    36.1 --- a/Hardware/TBalancer/TBalancerGroup.cs	Tue Sep 07 22:15:02 2010 +0000
    36.2 +++ b/Hardware/TBalancer/TBalancerGroup.cs	Wed Sep 08 19:29:58 2010 +0000
    36.3 @@ -38,8 +38,6 @@
    36.4  using System;
    36.5  using System.Collections.Generic;
    36.6  using System.Globalization;
    36.7 -using System.IO;
    36.8 -using System.IO.Ports;
    36.9  using System.Text;
   36.10  using System.Threading;
   36.11  
    37.1 --- a/Hardware/WinRing0.cs	Tue Sep 07 22:15:02 2010 +0000
    37.2 +++ b/Hardware/WinRing0.cs	Wed Sep 08 19:29:58 2010 +0000
    37.3 @@ -36,8 +36,6 @@
    37.4  */
    37.5  
    37.6  using System;
    37.7 -using System.Collections.Generic;
    37.8 -using System.IO;
    37.9  using System.Runtime.InteropServices;
   37.10  using System.Threading;
   37.11