The changes selected by the user in the PortManagerWindow dialog.
Пример #1
0
        private void OnOkCommand()
        {
            var portsToEnable  = new List <FirewallPort>();
            var portsToDisable = new List <FirewallPort>();

            foreach (var entry in Ports.Where(x => x.Changed))
            {
                var firewallPort = new FirewallPort(entry.PortInfo.GetTag(_instance), entry.PortInfo.Port);
                if (entry.IsEnabled)
                {
                    portsToEnable.Add(firewallPort);
                }
                else
                {
                    portsToDisable.Add(firewallPort);
                }
            }

            Result = new PortChanges(portsToEnable: portsToEnable, portsToDisable: portsToDisable);

            _owner.Close();
        }
 private void OnOkCommand()
 {
     Result = new PortChanges(Ports.Where(x => x.Changed));
     _close();
 }
        private void OnOkCommand()
        {
            var portsToEnable = new List<FirewallPort>();
            var portsToDisable = new List<FirewallPort>();

            foreach (var entry in Ports.Where(x => x.Changed))
            {
                var firewallPort = new FirewallPort(entry.PortInfo.GetTag(_instance), entry.PortInfo.Port);
                if (entry.IsEnabled)
                {
                    portsToEnable.Add(firewallPort);
                }
                else
                {
                    portsToDisable.Add(firewallPort);
                }
            }

            Result = new PortChanges(portsToEnable: portsToEnable, portsToDisable: portsToDisable);

            _owner.Close();
        }