Exemple #1
0
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                EndPoint[] nodes;

                switch (listView1.SelectedItems[0].Text)
                {
                case "IPv4 DHT Nodes":
                    nodes = _node.GetIPv4DhtNodes();
                    break;

                case "IPv6 DHT Nodes":
                    nodes = _node.GetIPv6DhtNodes();
                    break;

                case "LAN DHT Nodes":
                    nodes = _node.GetLanDhtNodes();
                    break;

                case "Tor DHT Nodes":
                    nodes = _node.GetTorDhtNodes();
                    break;

                default:
                    return;
                }

                StringBuilder strData = new StringBuilder(128);

                foreach (EndPoint node in nodes)
                {
                    strData.AppendLine(node.ToString());
                }

                MessageBox.Show(strData.ToString(), listView1.SelectedItems[0].Text);
            }
        }