예제 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Alias != null)
         {
             hashCode = hashCode * 59 + Alias.GetHashCode();
         }
         if (EntryType != null)
         {
             hashCode = hashCode * 59 + EntryType.GetHashCode();
         }
         if (Algorithm != null)
         {
             hashCode = hashCode * 59 + Algorithm.GetHashCode();
         }
         if (Format != null)
         {
             hashCode = hashCode * 59 + Format.GetHashCode();
         }
         if (Chain != null)
         {
             hashCode = hashCode * 59 + Chain.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        public override int GetHashCode()
        {
            var hashCode = 1707150943;

            hashCode = hashCode * -1521134295 + EntryType.GetHashCode();
            hashCode = hashCode * -1521134295 + StringComparer.Ordinal.GetHashCode(Pattern);
            hashCode = hashCode * -1521134295 + StringComparer.Ordinal.GetHashCode(Member);
            return(hashCode);
        }
예제 #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Alias != null)
         {
             hashCode = hashCode * 59 + Alias.GetHashCode();
         }
         if (EntryType != null)
         {
             hashCode = hashCode * 59 + EntryType.GetHashCode();
         }
         if (Subject != null)
         {
             hashCode = hashCode * 59 + Subject.GetHashCode();
         }
         if (Issuer != null)
         {
             hashCode = hashCode * 59 + Issuer.GetHashCode();
         }
         if (NotBefore != null)
         {
             hashCode = hashCode * 59 + NotBefore.GetHashCode();
         }
         if (NotAfter != null)
         {
             hashCode = hashCode * 59 + NotAfter.GetHashCode();
         }
         if (SerialNumber != null)
         {
             hashCode = hashCode * 59 + SerialNumber.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #4
0
 public override int GetHashCode()
 {
     return(Index.GetHashCode() ^ EntryType.GetHashCode() ^ Item.GetHashCode());
 }
예제 #5
0
        private void InsertIDtoDatabase(Service listservice, int malid, int servicetitleid, EntryType type)
        {
            String sql       = "";
            int    mediatype = type == EntryType.Anime ? 0 : 1;

            switch (listservice)
            {
            case Service.AniList:
                sql = "INSERT INTO titleids (malid,anilist_id,mediatype) VALUES (" + malid.ToString() + "," + servicetitleid.ToString() + "," + type.GetHashCode() + ")";
                break;

            case Service.Kitsu:
                sql = "INSERT INTO titleids (malid,kitsu_id,mediatype) VALUES (" + malid.ToString() + "," + servicetitleid.ToString() + "," + type.GetHashCode() + ")";
                break;

            default:
                return;
            }
            SQLiteCommand cmd = new SQLiteCommand(sql, sqlitecon);

            cmd.ExecuteNonQuery();
        }