public void RepeatedHashFails_CannotContinueExisting()
        {
            peer.IsChoking = false;
            peer.BitField.SetAll(true);

            var otherPeer = peers[1];

            otherPeer.IsChoking = false;
            otherPeer.BitField.SetAll(true);
            otherPeer.Peer.RepeatedHashFails++;

            // Successfully receive one block, then abandon the piece by disconnecting.
            var request = picker.PickPiece(peer, peer.BitField, peers);

            picker.ValidatePiece(peer, new BlockInfo(request.Value.PieceIndex, request.Value.StartOffset, request.Value.RequestLength), out _, out _);
            request = picker.PickPiece(peer, peer.BitField, peers);
            picker.CancelRequests(peer);
            peer.Dispose();

            // Peers involved in repeated hash fails cannot continue incomplete pieces.
            var otherRequest = picker.PickPiece(otherPeer, otherPeer.BitField, peers);

            Assert.AreNotEqual(request.Value.PieceIndex, otherRequest.Value.PieceIndex, "#0");
        }
        void ReleaseDesignerOutlets()
        {
            if (ChatMessageAuthor != null)
            {
                ChatMessageAuthor.Dispose();
                ChatMessageAuthor = null;
            }

            if (ChatMessageText != null)
            {
                ChatMessageText.Dispose();
                ChatMessageText = null;
            }

            if (ChatTable != null)
            {
                ChatTable.Dispose();
                ChatTable = null;
            }

            if (MessageTextField != null)
            {
                MessageTextField.Dispose();
                MessageTextField = null;
            }

            if (PeerId != null)
            {
                PeerId.Dispose();
                PeerId = null;
            }

            if (PeerName != null)
            {
                PeerName.Dispose();
                PeerName = null;
            }

            if (PeersTable != null)
            {
                PeersTable.Dispose();
                PeersTable = null;
            }
        }