Ejemplo n.º 1
0
        private void delBtn_Click(object sender, EventArgs e)
        {
            ConfigList.Config data = ConfigList.GetInstance().GetItem(settingList.SelectedIndex);

            if (data == null)
            {
                return;
            }

            ConfigList.GetInstance().Remove(data);

            settingList.DataSource = ConfigList.GetInstance().GetNames();
        }
Ejemplo n.º 2
0
        private void addListBtn_Click(object sender, EventArgs e)
        {
            ConfigList.Config data = new ConfigList.Config();

            data.Name      = nameBox.Text;
            data.IpAddress = ipaddrBox.Text;
            data.Subnet    = maskBox.Text;
            data.Gateway   = gatewayBox.Text;
            data.Dns1      = dns1Box.Text;
            data.Dns2      = dns2Box.Text;

            ConfigList.GetInstance().Add(data);
            settingList.DataSource = ConfigList.GetInstance().GetNames();
        }
Ejemplo n.º 3
0
        private void settingList_SelectedIndexChanged(object sender, EventArgs e)
        {
            ConfigList.Config data = ConfigList.GetInstance().GetItem(settingList.SelectedIndex);

            if (data == null)
            {
                return;
            }

            ipaddrBox.Text  = data.IpAddress;
            maskBox.Text    = data.Subnet;
            gatewayBox.Text = data.Gateway;
            dns1Box.Text    = data.Dns1;
            dns2Box.Text    = data.Dns2;
            nameBox.Text    = data.Name;
        }