using System; namespace Trigger.Classes.Device { /// /// A device. This is very abstract /// public class Device { #region Enums /// Type of the public enum DeviceType : byte { /// This is an IDE disk (HDD, SDD, ...) IDE, /// This is a floppy disk Floppy, /// This is a compact disk CD, /// This is a digital video disk DVD, /// This is a blue ray disk BD, /// This is a USB disk USB, /// This can be any disk Any, /// This is a screen Screen, } #endregion #region Properties #region Instance /// The name of the public string Name { get; internal set; } /// The Id of the public string Id { get; internal set; } /// The type of the public DeviceType Type { get; internal set; } /// Get the model of this disk. This is the manufacturer's name. public string Model { get; internal set; } #endregion #endregion #region Constructor /// /// Creates an instance of this /// public Device(string Id) { this.Id = Id; } #endregion #region Operators /// /// Gets a unique code of this /// /// public override int GetHashCode() { return this.Id.GetHashCode(); } /// /// /// /// public static bool operator ==(Device A, Device B) { if ((object)A == null) return (object)B == null; if ((object)B == null) return false; return A.Id == B.Id; } /// /// /// /// public static bool operator !=(Device A, Device B) { return !(A == B); } /// /// Compares to s (only the IDs) /// /// /// public override bool Equals(object obj) { Device that = obj as Device; if (that == null) return false; return this.Id == that.Id; } #endregion } }