public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <XenAPI.Network>() &&
            !(selection.FirstAsXenObject as XenAPI.Network).IsGuestInstallerNetwork());
     // CA-218956 - Expose HIMN when showing hidden objects
     // HIMN should not be editable
 }
Exemple #2
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     if (selection.AllItemsAre <VM>() && new CrossPoolMoveVMCommand(MainWindowCommandInterface, selection).CanExecute())
     {
         return(true);
     }
     return(selection.ContainsOneItemOfType <VM>() && selection.AtLeastOneXenObjectCan <VM>(CanExecute));
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     if (selection.ContainsOneItemOfType <IXenObject>())
     {
         IXenObject xenObject = selection[0].XenObject;
         return(!(xenObject is Folder) && xenObject.Connection != null && xenObject.Connection.IsConnected);
     }
     return(false);
 }
Exemple #4
0
        protected override bool CanExecuteCore(SelectedItemCollection selection)
        {
            if (_slr != null && selection.ContainsOneItemOfType <VDI>())
            {
                VDI vdi           = (VDI)selection[0].XenObject;
                var deleteCommand = new DeleteVirtualDiskCommand(MainWindowCommandInterface, vdi);

                return(vdi.sm_config.ContainsKey("SVID") && !string.IsNullOrEmpty(vdi.sm_config["SVID"]) && deleteCommand.CanExecute());
            }
            return(false);
        }
Exemple #5
0
        /// <summary>
        /// Installs tools on the single VM selected.
        /// </summary>
        /// <returns>The <see cref="AsyncAction"/> for the Command.</returns>
        public AsyncAction ExecuteGetAction()
        {
            SelectedItemCollection selection = GetSelection();

            if (selection.Count > 1)
            {
                throw new InvalidOperationException("This method can only be used with a single VM selected.");
            }

            if (selection.ContainsOneItemOfType <VM>())
            {
                VM vm = (VM)selection[0].XenObject;

                if (CanExecute(vm))
                {
                    return(SingleVMExecute(vm));
                }
            }

            return(null);
        }
Exemple #6
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <Host>() && selection.AtLeastOneXenObjectCan <Host>(CanExecute));
 }
Exemple #7
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.AllItemsAre <VM>(CBTDisabled) &&
            (new CrossPoolMoveVMCommand(MainWindowCommandInterface, selection).CanExecute() ||
             selection.ContainsOneItemOfType <VM>(CanExecute)));
 }
Exemple #8
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <VM>() && selection.AtLeastOneXenObjectCan <VM>(v => v.is_a_snapshot));
 }
 public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <Folder>());
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <SR>(sr => sr.StorageLinkRepository(Program.StorageLinkConnections) != null) ||
            selection.ContainsOneItemOfType <StorageLinkRepository>());
 }
 public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <XenAPI.Network>());
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <Folder>() && ConnectionAvailable());
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return((selection.ContainsOneItemOfType <Folder>() ||
             selection.ContainsOneItemOfType <GroupingTag>(t => t.Grouping is OrganizationViewFolders)) &&
            ConnectionAvailable());
 }
 public override bool IsValid(SelectedItemCollection selection)
 {
     return selection.ContainsOneItemOfType<Pool>();
 }
Exemple #15
0
 public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <StorageLinkPool>());
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <GroupingTag>(CanExecute));
 }