Beispiel #1
0
        /// <summary>
        /// Sets a new PeerAddress, but only if the previous had the same peer ID.
        /// </summary>
        /// <param name="peerAddress">The new peer address.</param>
        /// <returns>The old peer address.</returns>
        public PeerAddress SetPeerAddress(PeerAddress peerAddress)
        {
            if (!_peerId.Equals(peerAddress.PeerId))
            {
                throw new ArgumentException("Can only update PeerAddress with the same peer ID.");
            }
            var previous = PeerAddress;

            PeerAddress = peerAddress;
            return(previous);
        }
Beispiel #2
0
        public bool Equals(Number320 other)
        {
            bool t1 = LocationKey.Equals(other.LocationKey);
            bool t2 = DomainKey.Equals(other.DomainKey);

            return(t1 && t2);
        }
Beispiel #3
0
        public bool Equals(Number480 other)
        {
            var t1 = LocationKey.Equals(other.LocationKey);
            var t2 = DomainKey.Equals(other.DomainKey);
            var t3 = ContentKey.Equals(other.ContentKey);

            return(t1 && t2 && t3);
        }
Beispiel #4
0
        public bool Equals(Number640 other)
        {
            var t1 = LocationKey.Equals(other.LocationKey);
            var t2 = DomainKey.Equals(other.DomainKey);
            var t3 = ContentKey.Equals(other.ContentKey);
            var t4 = VersionKey.Equals(other.VersionKey);

            return(t1 && t2 && t3 && t4);
        }