示例#1
0
        /// <summary>
        /// Generates a hash code.
        /// </summary>
        /// <returns>Hash code based on stored data.</returns>
        public override int GetHashCode()
        {
            var hashCode =
                Abundance.GetHashCode() ^
                ChargeState.GetHashCode() ^
                DriftTime.GetHashCode() ^
                Id.GetHashCode() ^
                Net.GetHashCode();

            return(hashCode);
        }
示例#2
0
        /// <summary>
        /// Compares two objects' values.
        /// </summary>
        /// <param name="obj">Other to compare with.</param>
        /// <returns>True if values are the same, false if not.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            var other = obj as FeatureLight;

            if (other == null)
            {
                return(false);
            }

            if (!Id.Equals(other.Id))
            {
                return(false);
            }
            if (!Abundance.Equals(other.Abundance))
            {
                return(false);
            }
            if (!ChargeState.Equals(other.ChargeState))
            {
                return(false);
            }
            if (!DriftTime.Equals(other.DriftTime))
            {
                return(false);
            }
            if (!MassMonoisotopic.Equals(other.MassMonoisotopic))
            {
                return(false);
            }
            if (!Net.Equals(other.Net))
            {
                return(false);
            }
            return(true);
        }