private void DiscoverServersButton_Click(object sender, EventArgs e)
        {
            try
            {
                ConfiguredEndpoint endpoint = new ConfiguredServerListDlg().ShowDialog(m_configuration, true);

                if (endpoint != null)
                {
                    this.SelectedEndpoint = endpoint;
                    return;
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void EndpointCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (EndpointCB.SelectedIndex != 0)
                {
                    m_selectedIndex = EndpointCB.SelectedIndex;
                    return;
                }

                // modify configuration.
                ConfiguredEndpoint endpoint = new ConfiguredServerListDlg().ShowDialog(m_configuration, true);

                if (endpoint == null)
                {
                    EndpointCB.SelectedIndex = m_selectedIndex;
                    return;
                }

                m_endpoints.Add(endpoint);

                // raise notification.
                if (m_EndpointsChanged != null)
                {
                    m_EndpointsChanged(this, null);
                }

                // update dropdown.
                Initialize(m_endpoints, m_configuration);

                // update selection.
                for (int ii = 0; ii < m_endpoints.Endpoints.Count; ii++)
                {
                    if (Object.ReferenceEquals(endpoint, m_endpoints.Endpoints[ii]))
                    {
                        EndpointCB.SelectedIndex = ii + 1;
                        break;
                    }
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }