private void lbEndPoints_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (EndPoints == null)
            {
                return;
            }

            currentEndPointConfiuration = lbEndPointList.SelectedItem as Alchemi.Core.EndPointUtils.EndPointConfiguration;
            currentEndPointPreviousName = currentEndPointConfiuration.ToString();

            ucEndPointConfig.ReadEndPointConfiguration(currentEndPointConfiuration);
            txtEPName.Text = currentEndPointConfiuration.ToString();

            if (lbEndPointList.SelectedItem != null)
            {
                btnDelete.Enabled        = true;
                ucEndPointConfig.Enabled = true;
                btnSave.Enabled          = true;
                txtEPName.Enabled        = true;
            }
            else
            {
                btnDelete.Enabled        = false;
                ucEndPointConfig.Enabled = false;
                btnSave.Enabled          = false;
                txtEPName.Enabled        = false;
            }
        }
        private void RebindEndPointsList()
        {
            if (EndPoints == null)
            {
                return;
            }

            lbEndPointList.Items.Clear();
            foreach (string key in EndPoints.Keys)
            {
                Alchemi.Core.EndPointUtils.EndPointConfiguration epc = EndPoints[key];
                epc.FriendlyName = key;
                lbEndPointList.Items.Add(epc);
            }
            btnDelete.Enabled = false;
        }
        private void btnNew_Click(object sender, EventArgs e)
        {
            if (EndPoints == null)
            {
                return;
            }

            currentEndPointConfiuration = new Alchemi.Core.EndPointUtils.EndPointConfiguration(Alchemi.Core.Utility.AlchemiRole.Manager);
            currentEndPointPreviousName = string.Empty;

            ucEndPointConfig.Clear();
            ucEndPointConfig.AddressPart = "Manager";
            ucEndPointConfig.Enabled     = true;
            btnSave.Enabled   = true;
            txtEPName.Enabled = true;
            txtEPName.Text    = GetNewEPName();
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (EndPoints == null)
            {
                return;
            }

            Alchemi.Core.EndPointUtils.EndPointConfiguration epc = lbEndPointList.SelectedItem as Alchemi.Core.EndPointUtils.EndPointConfiguration;

            if (epc != null && EndPoints.ContainsKey(epc.ToString()))
            {
                EndPoints.Remove(epc.ToString());
            }

            RebindEndPointsList();

            ucEndPointConfig.Clear();
            ucEndPointConfig.AddressPart = "Manager";
            ucEndPointConfig.Enabled     = false;
            lbEndPointList.ClearSelected();
            txtEPName.Enabled = false;
            txtEPName.Text    = string.Empty;
        }