1.1 --- a/Hardware/Identifier.cs Tue Sep 21 10:33:28 2010 +0000
1.2 +++ b/Hardware/Identifier.cs Tue Sep 21 20:32:36 2010 +0000
1.3 @@ -36,17 +36,18 @@
1.4 */
1.5
1.6 using System;
1.7 +using System.Collections.Generic;
1.8 using System.Text;
1.9
1.10 namespace OpenHardwareMonitor.Hardware {
1.11 public class Identifier : IComparable<Identifier> {
1.12 - private string identifier;
1.13 + private readonly string identifier;
1.14
1.15 - private static char SEPARATOR = '/';
1.16 + private const char Separator = '/';
1.17
1.18 - private static void CheckIdentifiers(string[] identifiers) {
1.19 + private static void CheckIdentifiers(IEnumerable<string> identifiers) {
1.20 foreach (string s in identifiers)
1.21 - if (s.Contains(" ") || s.Contains(SEPARATOR.ToString()))
1.22 + if (s.Contains(" ") || s.Contains(Separator.ToString()))
1.23 throw new ArgumentException("Invalid identifier");
1.24 }
1.25
1.26 @@ -55,7 +56,7 @@
1.27
1.28 StringBuilder s = new StringBuilder();
1.29 for (int i = 0; i < identifiers.Length; i++) {
1.30 - s.Append(SEPARATOR);
1.31 + s.Append(Separator);
1.32 s.Append(identifiers[i]);
1.33 }
1.34 this.identifier = s.ToString();
1.35 @@ -67,7 +68,7 @@
1.36 StringBuilder s = new StringBuilder();
1.37 s.Append(identifier.ToString());
1.38 for (int i = 0; i < extensions.Length; i++) {
1.39 - s.Append(SEPARATOR);
1.40 + s.Append(Separator);
1.41 s.Append(extensions[i]);
1.42 }
1.43 this.identifier = s.ToString();
1.44 @@ -77,7 +78,7 @@
1.45 return identifier;
1.46 }
1.47
1.48 - public override bool Equals(System.Object obj) {
1.49 + public override bool Equals(Object obj) {
1.50 if (obj == null)
1.51 return false;
1.52