Added mainboard specific configurations for the following Gigabyte mainboards: EX58-UD3R, G41M-Combo, G41MT-S2, G41MT-S2P, GA-MA770T-UD3P, GA-MA785GM-US2H, GA-MA78LM-S2H, GA-MA790X-UD3P, H55-USB3, H55N-USB3, H61M-DS2 REV 1.2, H61M-USB3-B3 REV 2.0, H67A-USB3-B3, P55A-UD3, P67A-UD3-B3, P67A-UD3R-B3, Z68A-D3H-B3, Z68AP-D3, Z68X-UD3H-B3.
3 This Source Code Form is subject to the terms of the Mozilla Public
4 License, v. 2.0. If a copy of the MPL was not distributed with this
5 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 Copyright (C) 2009-2010 Michael Möller <mmoeller@openhardwaremonitor.org>
12 using System.Collections.Generic;
15 namespace OpenHardwareMonitor.Hardware {
16 public class Identifier : IComparable<Identifier> {
17 private readonly string identifier;
19 private const char Separator = '/';
21 private static void CheckIdentifiers(IEnumerable<string> identifiers) {
22 foreach (string s in identifiers)
23 if (s.Contains(" ") || s.Contains(Separator.ToString()))
24 throw new ArgumentException("Invalid identifier");
27 public Identifier(params string[] identifiers) {
28 CheckIdentifiers(identifiers);
30 StringBuilder s = new StringBuilder();
31 for (int i = 0; i < identifiers.Length; i++) {
33 s.Append(identifiers[i]);
35 this.identifier = s.ToString();
38 public Identifier(Identifier identifier, params string[] extensions) {
39 CheckIdentifiers(extensions);
41 StringBuilder s = new StringBuilder();
42 s.Append(identifier.ToString());
43 for (int i = 0; i < extensions.Length; i++) {
45 s.Append(extensions[i]);
47 this.identifier = s.ToString();
50 public override string ToString() {
54 public override bool Equals(Object obj) {
58 Identifier id = obj as Identifier;
62 return (identifier == id.identifier);
65 public override int GetHashCode() {
66 return identifier.GetHashCode();
69 public int CompareTo(Identifier other) {
73 return string.Compare(this.identifier, other.identifier,
74 StringComparison.Ordinal);
77 public static bool operator ==(Identifier id1, Identifier id2) {
79 return id2.Equals(null);
81 return id1.Equals(id2);
84 public static bool operator !=(Identifier id1, Identifier id2) {
88 public static bool operator <(Identifier id1, Identifier id2) {
92 return (id1.CompareTo(id2) < 0);
95 public static bool operator >(Identifier id1, Identifier id2) {
99 return (id1.CompareTo(id2) > 0);