コード例 #1
0
ファイル: Customer.cs プロジェクト: Vakuu/CSharp
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (payments != null ? payments.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FName != null ? FName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MName != null ? MName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LName != null ? LName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EGN != null ? EGN.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Address != null ? Address.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MPhone != null ? MPhone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Type;
         return(hashCode);
     }
 }
コード例 #2
0
ファイル: Printer.cs プロジェクト: MisuZ99/Tema1CNA
        public override int GetHashCode()
        {
            int hash = 1;

            if (MName.Length != 0)
            {
                hash ^= MName.GetHashCode();
            }
            if (MGender.Length != 0)
            {
                hash ^= MGender.GetHashCode();
            }
            if (MAge.Length != 0)
            {
                hash ^= MAge.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }