Beispiel #1
0
        public override bool Equals(object obj)
        {
            Search other = obj as Search;

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

            // Ifs are expanded to aid debuggin'

            if (!((name == null && other.name == null) || (name != null && name.Equals(other.Name))))
            {
                return(false);
            }

            if (!((query == null && other.query == null) || (query != null && query.Equals(other.Query))))
            {
                return(false);
            }

            if (!((grouping == null && other.grouping == null) || (grouping != null && grouping.Equals(other.grouping))))
            {
                return(false);
            }

            if (!((sorting == null && other.sorting == null) || (Helper.AreEqual(sorting, other.sorting))))
            {
                return(false);
            }

            if (!((connection == null && other.connection == null) || (connection != null && connection.Equals(other.connection))))
            {
                return(false);
            }

            return(true);
        }