Пример #1
0
 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
 }
Пример #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);
 }
Пример #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);
        }
Пример #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);
        }
Пример #6
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <Host>() && selection.AtLeastOneXenObjectCan <Host>(CanExecute));
 }
Пример #7
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.AllItemsAre <VM>(CBTDisabled) &&
            (new CrossPoolMoveVMCommand(MainWindowCommandInterface, selection).CanExecute() ||
             selection.ContainsOneItemOfType <VM>(CanExecute)));
 }
Пример #8
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <VM>() && selection.AtLeastOneXenObjectCan <VM>(v => v.is_a_snapshot));
 }
Пример #9
0
 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>());
 }
Пример #11
0
 public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <XenAPI.Network>());
 }
Пример #12
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <Folder>() && ConnectionAvailable());
 }
Пример #13
0
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return((selection.ContainsOneItemOfType <Folder>() ||
             selection.ContainsOneItemOfType <GroupingTag>(t => t.Grouping is OrganizationViewFolders)) &&
            ConnectionAvailable());
 }
Пример #14
0
 public override bool IsValid(SelectedItemCollection selection)
 {
     return selection.ContainsOneItemOfType<Pool>();
 }
Пример #15
0
 public override bool IsValid(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <StorageLinkPool>());
 }
 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return(selection.ContainsOneItemOfType <GroupingTag>(CanExecute));
 }