Пример #1
0
        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;
            }
        }
Пример #2
0
        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;
        }
Пример #3
0
        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();
        }
Пример #4
0
        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;
        }