예제 #1
0
 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     foreach (SelectedItem item in selection)
     {
         if (item.Connection != null && !item.Connection.IsConnected)
         {
             item.Connection.Password = null;
             item.Connection.ExpectPasswordIsCorrect = false;
             MainWindowCommandInterface.SaveServerList();
         }
     }
 }
        private void DoDisconnect(IXenConnection connection)
        {
            string     msg    = string.Format(Messages.CONNECTION_CLOSED_NOTICE_TEXT, connection.Hostname);
            ActionBase notice = new ActionBase(msg, msg, false, true);

            notice.Pool = Helpers.GetPoolOfOne(connection);
            notice.Host = Helpers.GetMaster(connection);
            log.Warn($"Connection to {connection.Hostname} closed.");

            MainWindowCommandInterface.CloseActiveWizards(connection);
            XenDialogBase.CloseAll(connection);
            connection.EndConnect();
            MainWindowCommandInterface.SaveServerList();
        }
예제 #3
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            MainWindowCommandInterface.SelectObjectInTree(null);

            foreach (Host host in selection.AsXenObjects <Host>())
            {
                string msg = string.Format(Messages.MAINWINDOW_LOG_REMOVECONNECTION, host.Connection.Hostname);
                log.Info($"Removed connection to {host.Connection.Hostname}");
                new ActionBase(msg, msg, false, true);
                MainWindowCommandInterface.CloseActiveWizards(host.Connection);
                host.Connection.EndConnect();
                MainWindowCommandInterface.RemoveConnection(host.Connection);
            }

            MainWindowCommandInterface.SaveServerList();
        }