Пример #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = 47;
         hashCode = (hashCode * 53) ^ Id.GetHashCode();
         hashCode = (hashCode * 53) ^ ResolvedId.GetHashCode();
         if (GivenUrl != null)
         {
             hashCode = (hashCode * 53) ^ GivenUrl.GetHashCode();
         }
         if (GivenTitle != null)
         {
             hashCode = (hashCode * 53) ^ GivenTitle.GetHashCode();
         }
         hashCode = (hashCode * 53) ^ IsFavorite.GetHashCode();
         hashCode = (hashCode * 53) ^ (int)Status;
         hashCode = (hashCode * 53) ^ TimeAdded.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeUpdated.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeRead.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeFavorited.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeSyncDatabaseAdded.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeSyncDatabaseUpdated.GetHashCode();
         if (ResolvedTitle != null)
         {
             hashCode = (hashCode * 53) ^ ResolvedTitle.GetHashCode();
         }
         if (ResolvedUrl != null)
         {
             hashCode = (hashCode * 53) ^ ResolvedUrl.GetHashCode();
         }
         if (Excerpt != null)
         {
             hashCode = (hashCode * 53) ^ Excerpt.GetHashCode();
         }
         hashCode = (hashCode * 53) ^ IsArticle.GetHashCode();
         hashCode = (hashCode * 53) ^ IsIndex.GetHashCode();
         hashCode = (hashCode * 53) ^ ImageContent.GetHashCode();
         hashCode = (hashCode * 53) ^ VideoContent.GetHashCode();
         hashCode = (hashCode * 53) ^ WordCount.GetHashCode();
         if (AmpUrl != null)
         {
             hashCode = (hashCode * 53) ^ AmpUrl.GetHashCode();
         }
         if (Encoding != null)
         {
             hashCode = (hashCode * 53) ^ Encoding.GetHashCode();
         }
         if (MimeType != null)
         {
             hashCode = (hashCode * 53) ^ MimeType.GetHashCode();
         }
         if (LeadImage != null)
         {
             hashCode = (hashCode * 53) ^ LeadImage.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            var hashCode =
                Created.GetHashCode() ^
                LastModified.GetHashCode() ^
                Size.GetHashCode() ^
                IsFavorite.GetHashCode() ^
                CommentsCount.GetHashCode() ^
                CommentsUnread.GetHashCode() ^
                ShareTypes.GetHashCode() ^
                HasPreview.GetHashCode();

            if (ContentType != null)
            {
                hashCode ^= ContentType.GetHashCode();
            }

            if (Name != null)
            {
                hashCode ^= Name.GetHashCode();
            }

            if (Path != null)
            {
                hashCode ^= Path.GetHashCode();
            }

            if (CommentsHref != null)
            {
                hashCode ^= CommentsHref.GetHashCode();
            }

            // Is null on directories
            if (ETag != null)
            {
                hashCode ^= ETag.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Id))
            {
                hashCode ^= Id.GetHashCode();
            }

            if (!string.IsNullOrEmpty(FileId))
            {
                hashCode ^= FileId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnderId))
            {
                hashCode ^= OwnderId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnerDisplayName))
            {
                hashCode ^= OwnerDisplayName.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Checksums))
            {
                hashCode ^= Checksums.GetHashCode();
            }

            return(hashCode);
        }