コード例 #1
0
        public override bool Equals(object obj)
        {
            DataContainer lDC = obj as DataContainer;

            if ((object)lDC == null)
            {
                return(false);
            }

            bool lResult = true;

            if (System.Object.ReferenceEquals(this.Columns, lDC.Columns))
            {
                lResult = true;
            }
            else
            {
                if (((object)this.Columns == null) || ((object)lDC.Columns == null))
                {
                    lResult = false;
                }
                else
                {
                    if (this.Columns.Count != lDC.Columns.Count)
                    {
                        lResult = false;
                    }
                    else
                    {
                        if (System.Object.ReferenceEquals(this.Rows, this.Rows))
                        {
                            lResult = true;
                        }
                        else
                        {
                            if (((object)this.Rows == null) || ((object)this.Rows == null))
                            {
                                lResult = false;
                            }
                            else
                            {
                                if (this.Rows.Count != lDC.Rows.Count)
                                {
                                    lResult = false;
                                }
                                else
                                {
                                    for (int i = 0; i < this.Columns.Count; i++)
                                    {
                                        if (this.Columns[i] != lDC.Columns[i])
                                        {
                                            lResult = false;
                                        }
                                    }
                                    if (lResult)
                                    {
                                        this.restart();
                                        lDC.restart();
                                        while (this.read() && lDC.read())
                                        {
                                            for (int i = 0; i < this.fieldCount(); i++)
                                            {
                                                if (this.getValue(i) != lDC.getValue(i))
                                                {
                                                    lResult = false;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(base.Equals(obj) && lResult);
        }