Ejemplo n.º 1
0
        public PresetFirewall()
        {
            InitializeComponent();

            ProgramControl.PrepAccessCmb(cmbOnAccess);
            ProgramControl.PrepAccessCmb(cmbOffAccess);

            RuleList = new ControlList <RuleItemControl, FirewallPreset.SingleRule>(this.ruleScroll, (rule) =>
            {
                FirewallRuleEx FwRule = Rules.Find(x => x.guid.Equals(rule.RuleId));
                var ctrl          = new RuleItemControl(rule, FwRule, FirewallPreset);
                ctrl.RuleChanged += Ctrl_RuleChanged;
                return(ctrl);
            }, (rule) => rule.RuleId);
        }
Ejemplo n.º 2
0
        private void Ctrl_RuleChanged(object sender, EventArgs e)
        {
            RuleItemControl ctrl = (RuleItemControl)sender;

            FirewallPreset.Rules[ctrl.rule.RuleId] = ctrl.rule;
        }