示例#1
0
        private void HostEnumerator_HostsDiscovered(object sender, HostEnumeratorEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new EventHandler <HostEnumeratorEventArgs>(HostEnumerator_HostsDiscovered), sender, e);
                return;
            }

            // check if this is the first callback.
            if (m_waitingForHosts)
            {
                ItemsLV.Items.Clear();
                m_waitingForHosts = false;
            }

            // populate list with hostnames.
            if (e != null && e.Hostnames != null)
            {
                foreach (string hostname in e.Hostnames)
                {
                    AddItem(hostname);
                }
            }

            AdjustColumns();
        }
        private void HostEnumerator_HostsDiscovered(object sender, HostEnumeratorEventArgs e)
        {
            // check if this is the first callback.
            if (m_waitingForHosts)
            {
                ItemsLV.Items.Clear();
                m_waitingForHosts = false;
            }

            // populate list with hostnames.
            if (e != null && e.Hostnames != null)
            {
                foreach (string hostname in e.Hostnames)
                {
                    AddItem(hostname);
                }
            }
        }