예제 #1
0
        public override bool Equals(object obj)
        {
            LearnerInfo peer = (LearnerInfo)obj;

            if (peer == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(peer, this))
            {
                return(true);
            }
            bool ret = false;

            ret = (Serverid == peer.Serverid);
            if (!ret)
            {
                return(ret);
            }
            ret = (ProtocolVersion == peer.ProtocolVersion);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            LearnerInfo peer = (LearnerInfo)obj;

            if (peer == null)
            {
                throw new InvalidOperationException("Comparing different types of records.");
            }
            int ret = 0;

            ret = (Serverid == peer.Serverid)? 0 :((Serverid < peer.Serverid)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (ProtocolVersion == peer.ProtocolVersion)? 0 :((ProtocolVersion < peer.ProtocolVersion)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }