Exemple #1
0
        public override bool Equals(object peer_)
        {
            if (!(peer_ is op_result_t))
            {
                return(false);
            }
            if (peer_ == this)
            {
                return(true);
            }
            bool        ret  = false;
            op_result_t peer = (op_result_t)peer_;

            ret = (Rc == peer.Rc);
            if (!ret)
            {
                return(ret);
            }
            ret = (Op == peer.Op);
            if (!ret)
            {
                return(ret);
            }
            ret = Response.Equals(peer.Response);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
Exemple #2
0
        public int CompareTo(object peer_)
        {
            if (!(peer_ is op_result_t))
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            op_result_t peer = (op_result_t)peer_;
            int         ret  = 0;

            ret = (Rc == peer.Rc) ? 0 : ((Rc < peer.Rc) ? -1 : 1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Op == peer.Op) ? 0 : ((Op < peer.Op) ? -1 : 1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = Response.CompareTo(peer.Response);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }