protected int CompareTo(MsDataFilePath other) { // Culture specific sorting desirable in file paths // ReSharper disable StringCompareToIsCultureSpecific int result = FilePath.CompareTo(other.FilePath); if (result != 0) { return(result); } result = SampleName.CompareTo(other.SampleName); if (result != 0) { return(result); } result = SampleIndex.CompareTo(other.SampleIndex); if (result != 0) { return(result); } result = CentroidMs1.CompareTo(other.CentroidMs1); if (result != 0) { return(result); } result = CentroidMs2.CompareTo(other.CentroidMs2); if (result != 0) { return(result); } return(LockMassParameters.CompareTo(other.LockMassParameters)); // ReSharper restore StringCompareToIsCultureSpecific }
public override int GetHashCode() { unchecked { var hashCode = CentroidMs1.GetHashCode(); hashCode = (hashCode * 397) ^ CentroidMs2.GetHashCode(); hashCode = (hashCode * 397) ^ (LockMassParameters != null ? LockMassParameters.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ServerUrl != null ? ServerUrl.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ModifiedTime.GetHashCode(); hashCode = (hashCode * 397) ^ (EncodedPath != null ? EncodedPath.GetHashCode() : 0); return(hashCode); } }