コード例 #1
0
 private void button21_Click(object sender, System.EventArgs e)
 {
     AntivirusIdsFirewall antivirusForm = new AntivirusIdsFirewall();
     antivirusForm.unixSupport.Text = "Максимальные настройки";
     antivirusForm.windowsSupport.Text = "Стандартные настройки";
     if (antivirusForm.ShowDialog() == DialogResult.OK)
     {
         Firewall firewall = new Firewall()
         {
             Name = antivirusForm.NameObject,
             Price = antivirusForm.PriceObject,
             Support = antivirusForm.SuppotObject,
             ClassId = antivirusForm.ClassObject
         };
         _baseWorker.AddObject(firewall, "Firewalls");
         RefreshFirewalls();
     }
 }
コード例 #2
0
        private void button20_Click(object sender, System.EventArgs e)
        {
            Firewall oldFirewall = firewallsListBox.SelectedItem as Firewall;

            if (oldFirewall == null)
            {
                return;
            }
            AntivirusIdsFirewall antivirusForm = new AntivirusIdsFirewall(oldFirewall);
            antivirusForm.unixSupport.Text = "Максимальные настройки";
            antivirusForm.windowsSupport.Text = "Стандартные настройки";
            if (antivirusForm.ShowDialog() == DialogResult.OK)
            {
                Firewall newFirewall = new Firewall()
                {
                    Name = antivirusForm.NameObject,
                    Price = antivirusForm.PriceObject,
                    Support = antivirusForm.SuppotObject,
                    ClassId = antivirusForm.ClassObject
                };
                _baseWorker.ChangeObject(oldFirewall, newFirewall, "Firewalls");
                RefreshFirewalls();
            }
        }