コード例 #1
0
        public override int GetHashCode()
        {
            unchecked
            {
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ (BudynekId.GetHashCode());
                hash = (hash * HashingMultiplier) ^ (Object.ReferenceEquals(null, Nazwa) ? 0: Nazwa.GetHashCode());

                int a = 12;
                return(hash);
            }
        }
コード例 #2
0
        public override bool Equals(Object other)
        {
            IBudynek obj = other as IBudynek;

            if (obj == null)
            {
                return(false);
            }

            return(BudynekId.Equals(obj.BudynekId) &&

                   string.Equals(Nazwa, obj.Nazwa) &&
                   powBezPiwnic.Equals(obj.powBezPiwnic) &&
                   powZPiwnic.Equals(obj.powZPiwnic) &&
                   powCalk.Equals(obj.powCalk) &&
                   powZabud.Equals(obj.powZabud) &&
                   kubatura.Equals(obj.kubatura) &&
                   iloscKond.Equals(obj.iloscKond) &&
                   string.Equals(numerEwid, obj.numerEwid) &&
                   wpisRejZab.Equals(obj.wpisRejZab) &&

                   prad.Equals(obj.prad) &&
                   woda.Equals(obj.woda) &&
                   kanSan.Equals(obj.kanSan) &&
                   kanLok.Equals(obj.kanLok) &&
                   kanDeszcz.Equals(obj.kanDeszcz) &&
                   tel.Equals(obj.tel) &&
                   co.Equals(obj.co) &&
                   gaz.Equals(obj.gaz) &&
                   internet.Equals(obj.internet) &&
                   tv.Equals(obj.tv) &&

                   string.Equals(opisKonstr, obj.opisKonstr) &&
                   string.Equals(stanTech, obj.stanTech) &&

                   (object.ReferenceEquals(Adres, obj.Adres) || Adres != null && Adres.Equals(obj.Adres)));
        }
コード例 #3
0
        //public override  bool Equals(Object _other)
        //{
        //    IDzialka_Budynek other = _other as IDzialka_Budynek;

        //    return DzialkaId.Equals(other.DzialkaId) &&
        //           BudynekId.Equals(other.BudynekId);
        //}

        //public override int GetHashCode() => (DzialkaId, BudynekId).GetHashCode();

        public override int GetHashCode()
        {
            unchecked
            {
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, DzialkaId) ? DzialkaId.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^ (!Object.ReferenceEquals(null, BudynekId) ? BudynekId.GetHashCode() : 0);
                return(hash);
            }
        }