コード例 #1
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(EventReportReliablePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_eventType == rhs._eventType))
            {
                ivarsEqual = false;
            }
            if (!(_pad1 == rhs._pad1))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfFixedDatumRecords == rhs._numberOfFixedDatumRecords))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _fixedDatumRecords.Count; idx++)
            {
                FixedDatum x = (FixedDatum)_fixedDatumRecords[idx];
                if (!(_fixedDatumRecords[idx].Equals(rhs._fixedDatumRecords[idx])))
                {
                    ivarsEqual = false;
                }
            }


            for (int idx = 0; idx < _variableDatumRecords.Count; idx++)
            {
                VariableDatum x = (VariableDatum)_variableDatumRecords[idx];
                if (!(_variableDatumRecords[idx].Equals(rhs._variableDatumRecords[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
コード例 #2
0
        /**
          * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
          */
        public bool equals(EventReportReliablePdu rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
            return false;

             if( ! (_eventType == rhs._eventType)) ivarsEqual = false;
             if( ! (_pad1 == rhs._pad1)) ivarsEqual = false;
             if( ! (_numberOfFixedDatumRecords == rhs._numberOfFixedDatumRecords)) ivarsEqual = false;
             if( ! (_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords)) ivarsEqual = false;

             for(int idx = 0; idx < _fixedDatumRecords.Count; idx++)
             {
            FixedDatum x = (FixedDatum)_fixedDatumRecords[idx];
            if( ! ( _fixedDatumRecords[idx].Equals(rhs._fixedDatumRecords[idx]))) ivarsEqual = false;
             }

             for(int idx = 0; idx < _variableDatumRecords.Count; idx++)
             {
            VariableDatum x = (VariableDatum)_variableDatumRecords[idx];
            if( ! ( _variableDatumRecords[idx].Equals(rhs._variableDatumRecords[idx]))) ivarsEqual = false;
             }

            return ivarsEqual;
        }