Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)Major;
         hashCode = (hashCode * 397) ^ (int)Minor;
         hashCode = (hashCode * 397) ^ (int)Patch;
         hashCode = (hashCode * 397) ^ (int)Build;
         hashCode = (hashCode * 397) ^ (VersionType != null ? VersionType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (VersionDesc != null ? VersionDesc.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 13;

            unchecked
            {
                if (valid)
                {
                    hash = (hash * 7) + major.GetHashCode();
                    hash = (hash * 7) + minor.GetHashCode();
                    hash = (hash * 7) + patch.GetHashCode();
                    hash = (hash * 7) + build.GetHashCode();
                    hash = (hash * 7) + type.GetHashCode();
                }
                else
                {
                    return(text.GetHashCode());
                }
            }

            return(hash);
        }