Exemplo n.º 1
0
 private void OnManageFirewallPortsCommand()
 {
     try
     {
         var changes = PortManagerWindow.PromptUser(Instance);
         if (changes?.HasChanges ?? false)
         {
             var operation = _owner.DataSource.UpdateInstancePorts(
                 Instance,
                 portsToEnable: changes.PortsToEnable,
                 portsToDisable: changes.PortsToDisable);
             UpdateInstanceState(operation);
         }
     }
     catch (DataSourceException)
     {
         UserPromptUtils.ErrorPrompt(Resources.CloudExplorerGceFailedToUpdateFirewallMessage, Resources.CloudExplorerGceFailedToUpdateFirewallCaption);
     }
 }
        private void OnManageFirewallPortsCommand()
        {
            try
            {
                var changes = PortManagerWindow.PromptUser(Instance);
                if (changes?.HasChanges ?? false)
                {
                    var operation = _owner.DataSource.UpdateInstancePorts(
                        Instance,
                        portsToEnable: changes.PortsToEnable,
                        portsToDisable: changes.PortsToDisable);
                    UpdateInstanceState(operation);

                    EventsReporterWrapper.ReportEvent(ChangedFirewallPortsEvent.Create(CommandStatus.Success));
                }
            }
            catch (DataSourceException)
            {
                EventsReporterWrapper.ReportEvent(ChangedFirewallPortsEvent.Create(CommandStatus.Failure));
                UserPromptUtils.Default.ErrorPrompt(Resources.CloudExplorerGceFailedToUpdateFirewallMessage, Resources.CloudExplorerGceFailedToUpdateFirewallCaption);
            }
        }