Example #1
0
        // profilo selezionato
        private void ProfileSelected(object sender, EventArgs e)
        {
            if (boxProfiles.SelectedItem != null)
            {
                buttonApply.Enabled  = true;
                buttonEdit.Enabled   = true;
                cbAnotherNic.Enabled = true;

                var item = ProfilesCollection.Profiles.FirstOrDefault(p => p.Name == boxProfiles.SelectedItem.ToString());
                selectedProfile = item;

                ShowProfile(selectedProfile);
            }
        }
Example #2
0
        // mostra il profilo selezionato nel datagrid
        public void ShowProfile(object p)
        {
            NetworkProfile profile = (NetworkProfile)p;

            DataTable t = new DataTable();

            t.Columns.Add("Nome");
            t.Columns.Add("Valore");
            t.Rows.Add("Nome profilo", profile.Name);
            t.Rows.Add("Interfaccia", profile.Interface);
            t.Rows.Add("Indirizzo IP", profile.IPAddress);
            t.Rows.Add("Netmask", profile.Netmask);
            t.Rows.Add("Gateway", profile.Gateway);
            t.Rows.Add("DNS 1", profile.DNS1);
            t.Rows.Add("DNS 2", profile.DNS2);

            dataGridView.DataSource = t;
        }
Example #3
0
 public static void RemoveProfile(NetworkProfile profile)
 {
     Profiles.Remove(profile);
     SaveProfiles();
 }
Example #4
0
 public static void AddProfile(NetworkProfile profile)
 {
     Profiles.Add(profile);
     SaveProfiles();
 }