/// <summary> /// Determines if this object is equivalent to another. /// </summary> /// <param name="obj">The object to test against.</param> /// <returns><c>true</c> if the <paramref name="obj"/> is equivalent, else <c>false</c>.</returns> public override bool Equals(object obj) { if (obj == null || obj.GetType() != GetType()) { return(false); } ChsAddress other = (ChsAddress)obj; return(_cylinder == other._cylinder && _head == other._head && _sector == other._sector); }
/// <summary> /// Converts a CHS (Cylinder,Head,Sector) address to a LBA (Logical Block Address). /// </summary> /// <param name="chsAddress">The CHS address to convert</param> /// <returns>The Logical Block Address (in sectors)</returns> public long ToLogicalBlockAddress(ChsAddress chsAddress) { return(ToLogicalBlockAddress(chsAddress.Cylinder, chsAddress.Head, chsAddress.Sector)); }