コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         if (Id != null)
         {
             hash = hash * 486187739 + Id.GetHashCode();
         }
         if (FileGuid != null)
         {
             hash = hash * 486187739 + FileGuid.GetHashCode();
         }
         if (FileName != null)
         {
             hash = hash * 486187739 + FileName.GetHashCode();
         }
         if (FileUrn != null)
         {
             hash = hash * 486187739 + FileUrn.GetHashCode();
         }
         if (FilePath != null)
         {
             hash = hash * 486187739 + FilePath.GetHashCode();
         }
         if (FileType != null)
         {
             hash = hash * 486187739 + FileType.GetHashCode();
         }
         if (FileVersion != null)
         {
             hash = hash * 486187739 + FileVersion.GetHashCode();
         }
         hash = hash * 486187739 + PublishedViewsCount.GetHashCode();
         hash = hash * 486187739 + PublishedSheetsCount.GetHashCode();
         hash = hash * 486187739 + FileSize.GetHashCode();
         if (FileModifiedDate != null)
         {
             hash = hash * 486187739 + FileModifiedDate.GetHashCode();
         }
         if (UserCreate != null)
         {
             hash = hash * 486187739 + UserCreate.GetHashCode();
         }
         if (UserLastModified != null)
         {
             hash = hash * 486187739 + UserLastModified.GetHashCode();
         }
         return(hash);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            int result = 17;

            unchecked
            {
                if (Name != null)
                {
                    result = (result * 31) + Name.GetHashCode();
                }

                if (FullName != null)
                {
                    result = (result * 31) + FullName.GetHashCode();
                }

                if (Version != null)
                {
                    result = (result * 31) + Version.GetHashCode();
                }

                if (SemanticVersion != null)
                {
                    result = (result * 31) + SemanticVersion.GetHashCode();
                }

                if (FileVersion != null)
                {
                    result = (result * 31) + FileVersion.GetHashCode();
                }

                if (Properties != null)
                {
                    // Use xor for dictionaries to be order-independent.
                    int xor_0 = 0;
                    foreach (var value_0 in Properties)
                    {
                        xor_0 ^= value_0.Key.GetHashCode();
                        if (value_0.Value != null)
                        {
                            xor_0 ^= value_0.Value.GetHashCode();
                        }
                    }

                    result = (result * 31) + xor_0;
                }

                if (Tags != null)
                {
                    foreach (var value_1 in Tags)
                    {
                        result = result * 31;
                        if (value_1 != null)
                        {
                            result = (result * 31) + value_1.GetHashCode();
                        }
                    }
                }
            }

            return(result);
        }