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

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

            ret = Path.Equals(peer.Path);
            if (!ret)
            {
                return(ret);
            }
            ret = Data.Equals(peer.Data);
            if (!ret)
            {
                return(ret);
            }
            ret = (Version == peer.Version);
            if (!ret)
            {
                return(ret);
            }
            return(ret);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            SetDataTxn peer = (SetDataTxn)obj;

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

            ret = Path.CompareTo(peer.Path);
            if (ret != 0)
            {
                return(ret);
            }
            ret = Data.CompareTo(peer.Data);
            if (ret != 0)
            {
                return(ret);
            }
            ret = (Version == peer.Version)? 0 :((Version < peer.Version)?-1:1);
            if (ret != 0)
            {
                return(ret);
            }
            return(ret);
        }