Пример #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }

            SerializePdx4 other = obj as SerializePdx4;

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

            if (s0 == other.s0 &&
                i1 == other.i1 &&
                i2 == other.i2 &&
                s1 == other.s1 &&
                s2 == other.s2)
            {
                bool ret = nestedObject.Equals(other.nestedObject);
                if (ret)
                {
                    if (_addressList.Count == other._addressList.Count &&
                        _addressList[0].Equals(other._addressList[0]))
                    {
                        for (int i = 0; i < _addressList.Count; i++)
                        {
                            ret = _addressList[i].Equals(other._addressList[i]);
                            if (!ret)
                            {
                                return(false);
                            }
                        }
                        return(base.Equals(other));
                    }
                }
            }

            return(false);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }

            SerializePdx3 other = obj as SerializePdx3;

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

            if (s0 == other.s0 &&
                i1 == other.i1 &&
                i2 == other.i2 &&
                s1 == other.s1 &&
                s2 == other.s2)
            {
                bool ret = nestedObject.Equals(other.nestedObject);
                if (ret)
                {
                    if (_addressList.Count == 10 &&
                        _addressList.Count == other._addressList.Count//&&
                        //_arrayOfAddress.Length == other._arrayOfAddress.Length &&
                        //_arrayOfAddress[0].Equals(other._arrayOfAddress[0])
                        )
                    {
                        for (int i = 0; i < _addressList.Count; i++)
                        {
                            ret = _addressList[i].Equals(other._addressList[i]);
                            if (!ret)
                            {
                                return(false);
                            }
                        }

                        if (_hashTable.Count != other._hashTable.Count)
                        {
                            return(false);
                        }
                        foreach (DictionaryEntry de in _hashTable)
                        {
                            object otherHe = other._hashTable[de.Key];
                            ret = de.Value.Equals(otherHe);
                            if (!ret)
                            {
                                return(false);
                            }
                        }

                        if (!_address.Equals(other._address))
                        {
                            return(false);
                        }
                        return(base.Equals(other));
                    }
                }
            }

            return(false);
        }