示例#1
0
        private bool Equals(CustomIon other)
        {
            var equal = string.Equals(Formula, other.Formula) &&
                        string.Equals(Name, other.Name) &&
                        MonoisotopicMass.Equals(other.MonoisotopicMass) &&
                        AverageMass.Equals(other.AverageMass);

            return(equal); // For debugging convenience
        }
示例#2
0
        public int CompareTo(CustomMolecule other)
        {
            if (other == null)
            {
                return(1);
            }
            var result = string.CompareOrdinal(Name, other.Name);

            if (result == 0)
            {
                result = string.CompareOrdinal(Formula, other.Formula);
                if (result == 0)
                {
                    result = AccessionNumbers.CompareTo(other.AccessionNumbers);
                    if (result == 0)
                    {
                        result = MonoisotopicMass.Equals(other.MonoisotopicMass, 5E-10) ? // Allow for float vs double serialization effects
                                 0 : MonoisotopicMass.CompareTo(other.MonoisotopicMass);
                    }
                }
            }
            return(result);
        }
示例#3
0
 protected bool Equals(Modification other)
 {
     return(ExplicitMod.Equals(other.ExplicitMod) && MonoisotopicMass.Equals(other.MonoisotopicMass) &&
            AverageMass.Equals(other.AverageMass));
 }