Пример #1
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     foreach (IXenConnection c in MainWindowCommandInterface.GetXenConnectionsCopy())
     {
         if (!c.InProgress && !c.IsConnected)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
 private bool ConnectionAvailable()
 {
     foreach (IXenConnection connection in MainWindowCommandInterface.GetXenConnectionsCopy())
     {
         if (connection.IsConnected)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     foreach (IXenConnection connection in MainWindowCommandInterface.GetXenConnectionsCopy())
     {
         if (connection.IsConnected)
         {
             MainWindowCommandInterface.Invoke(delegate
             {
                 new DisconnectCommand(MainWindowCommandInterface, connection, true).Execute();
             });
         }
     }
 }
Пример #4
0
        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            bool expand = MainWindowCommandInterface.GetXenConnectionsCopy().Count < 30;

            foreach (IXenConnection c in MainWindowCommandInterface.GetXenConnectionsCopy())
            {
                if (!c.IsConnected && !c.InProgress)
                {
                    MainWindowCommandInterface.Invoke(delegate
                    {
                        if (expand)
                        {
                            c.CachePopulated += c_CachePopulated;
                        }
                        XenConnectionUI.BeginConnect(c, false, null, false);
                    });
                }
            }
        }