Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (PeptideModifiedSequence != null ? PeptideModifiedSequence.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MoleculeName != null ? MoleculeName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ChemicalFormula != null ? ChemicalFormula.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (InChiKey != null ? InChiKey.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OtherKeys != null ? OtherKeys.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        public IAssociationMapping <T, TElement> OtherKey(string key_name)
        {
            if (string.IsNullOrEmpty(key_name))
            {
                return(this);
            }

            if (!OtherKeys.Contains(key_name))
            {
                OtherKeys.Add(key_name);
            }

            return(this);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets or sets the value associated with the specified key
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public string this[string index]
 {
     get
     {
         if (!OtherKeys.ContainsKey(index))
         {
             throw new KeyNotFoundException();
         }
         return(OtherKeys[index]);
     }
     set
     {
         if (OtherKeys.ContainsKey(index))
         {
             OtherKeys[index] = value;
         }
         else
         {
             OtherKeys.Add(index, value);
         }
     }
 }