public override bool Equals(object obj) { TxnHeader peer = (TxnHeader)obj; if (peer == null) { return(false); } if (Object.ReferenceEquals(peer, this)) { return(true); } bool ret = false; ret = (ClientId == peer.ClientId); if (!ret) { return(ret); } ret = (Cxid == peer.Cxid); if (!ret) { return(ret); } ret = (Zxid == peer.Zxid); if (!ret) { return(ret); } ret = (Time == peer.Time); if (!ret) { return(ret); } ret = (Type == peer.Type); if (!ret) { return(ret); } return(ret); }
public int CompareTo(object obj) { TxnHeader peer = (TxnHeader)obj; if (peer == null) { throw new InvalidOperationException("Comparing different types of records."); } int ret = 0; ret = (ClientId == peer.ClientId)? 0 :((ClientId < peer.ClientId)?-1:1); if (ret != 0) { return(ret); } ret = (Cxid == peer.Cxid)? 0 :((Cxid < peer.Cxid)?-1:1); if (ret != 0) { return(ret); } ret = (Zxid == peer.Zxid)? 0 :((Zxid < peer.Zxid)?-1:1); if (ret != 0) { return(ret); } ret = (Time == peer.Time)? 0 :((Time < peer.Time)?-1:1); if (ret != 0) { return(ret); } ret = (Type == peer.Type)? 0 :((Type < peer.Type)?-1:1); if (ret != 0) { return(ret); } return(ret); }