예제 #1
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new PropertiesCommand(mainWindow, selection));
 }
예제 #2
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                List <SelectedItem> inProgressItems = new List <SelectedItem>();

                foreach (SelectedItem item in selection)
                {
                    if (item.Connection != null && !item.Connection.IsConnected && item.Connection.InProgress)
                    {
                        inProgressItems.Add(item);
                    }
                }

                if (inProgressItems.Count > 0)
                {
                    items.Add(new CancelHostConnectionCommand(mainWindow, inProgressItems));
                }
                else
                {
                    items.AddIfEnabled(new DisconnectHostsAndPoolsCommand(mainWindow, selection), true);
                    items.Add(new ReconnectHostCommand(mainWindow, selection), true);
                    items.Add(new ForgetSavedPasswordCommand(mainWindow, selection));
                    items.Add(new RemoveHostCommand(mainWindow, selection));
                    items.AddIfEnabled(new RestartToolstackCommand(mainWindow, selection));
                }
            }
예제 #3
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new NewVMFromTemplateCommand(mainWindow, selection), true);
                items.AddIfEnabled(new InstantVMFromTemplateCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new ExportTemplateCommand(mainWindow, selection));
                items.AddIfEnabled(new CopyTemplateCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new DeleteTemplateCommand(mainWindow, selection));

                items.AddPluginItems(PluginContextMenu.template, selection);
                items.AddSeparator();



                items.AddIfEnabled(new PropertiesCommand(mainWindow, selection));
            }
예제 #4
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new RepairSRCommand(mainWindow, selection));
                items.AddIfEnabled(new SetAsDefaultSRCommand(mainWindow, selection));
                items.AddIfEnabled(new ShareSRCommand(mainWindow, selection));
                items.AddIfEnabled(new UpgradeSRCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new DetachSRCommand(mainWindow, selection));
                items.AddIfEnabled(new ReattachSRCommand(mainWindow, selection));
                items.AddIfEnabled(new ForgetSRCommand(mainWindow, selection));
                items.AddIfEnabled(new DestroySRCommand(mainWindow, selection));

                items.AddPluginItems(PluginContextMenu.storage, selection);
                items.AddSeparator();

                items.AddIfEnabled(new PropertiesCommand(mainWindow, selection));
            }
예제 #5
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new ShutDownHostCommand(mainWindow, selection));
     items.AddIfEnabled(new PowerOnHostCommand(mainWindow, selection));
     items.AddIfEnabled(new RestartToolstackCommand(mainWindow, selection));
 }
예제 #6
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.Add(new NewVMCommand(mainWindow, selection));
                items.Add(new NewSRCommand(mainWindow, selection));
                items.Add(new ImportCommand(mainWindow, selection));
                items.AddSeparator();
                if (selection.FirstAsXenObject != null)
                {
                    items.Add(new HACommand(mainWindow, selection));
                }
                items.AddIfEnabled(new VMGroupCommand <VMPP>(mainWindow, selection));
                items.AddIfEnabled(new VMGroupCommand <VM_appliance>(mainWindow, selection));

                var drItem = new CommandToolStripMenuItem(new DRCommand(mainWindow, selection), true);

                if (drItem.Command.CanExecute())
                {
                    drItem.DropDownItems.Add(new CommandToolStripMenuItem(
                                                 new DRConfigureCommand(mainWindow, selection), true));
                    drItem.DropDownItems.Add(new CommandToolStripMenuItem(new DisasterRecoveryCommand(mainWindow, selection),
                                                                          true));
                    items.Add(drItem);
                }

                var pool = selection.FirstAsXenObject as Pool;

                if (pool != null && !pool.IsPoolFullyUpgraded)
                {
                    items.Add(new RollingUpgradeCommand(mainWindow));
                }

                items.AddSeparator();
                items.Add(new AddHostToSelectedPoolToolStripMenuItem(mainWindow, selection, true));
                items.Add(new DisconnectPoolCommand(mainWindow, selection));
                items.Add(new PoolReconnectAsCommand(mainWindow, selection));
                items.AddSeparator();
                items.AddPluginItems(PluginContextMenu.pool, selection);
                items.AddSeparator();
                items.Add(new PoolPropertiesCommand(mainWindow, selection));
            }
예제 #7
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new DestroySRCommand(mainWindow, selection));
     items.Add(new ForgetSRCommand(mainWindow, selection));
 }
예제 #8
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                Host host = (Host)selection[0].XenObject;

                items.AddIfEnabled(new NewVMCommand(mainWindow, selection));
                items.AddIfEnabled(new NewSRCommand(mainWindow, selection));
                items.AddIfEnabled(new ImportCommand(mainWindow, selection));
                items.AddSeparator();
                items.AddIfEnabled(new HostMaintenanceModeCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new RebootHostCommand(mainWindow, selection));
                items.AddIfEnabled(new ShutDownHostCommand(mainWindow, selection));
                items.AddIfEnabled(new RestartToolstackCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIf(new InstallNewUpdateCommand(mainWindow), delegate { return(!Host.IsFullyPatched(host, ConnectionsManager.XenConnectionsCopy)); });
                items.AddIfEnabled(new RemoveHostCrashDumpsCommand(mainWindow, selection));

                if (host != Helpers.GetMaster(host.Connection))
                {
                    items.AddSeparator();
                    items.Add(new RemoveHostFromPoolCommand(mainWindow, selection));
                }

                items.AddPluginItems(PluginContextMenu.server, selection);
                items.AddSeparator();
                items.AddIfEnabled(new HostPropertiesCommand(mainWindow, selection));
            }
예제 #9
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new DeleteTagCommand(mainWindow, selection));
 }
예제 #10
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new NewSRCommand(mainWindow, selection));
     items.AddIfEnabled(new RemoveStorageLinkSystemCommand(mainWindow, selection));
 }
예제 #11
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new DeleteFolderCommand(mainWindow, selection));

                items.AddPluginItems(PluginContextMenu.folder, selection);
            }
예제 #12
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new ShutDownVMCommand(mainWindow, selection));
                items.AddIfEnabled(new StartVMCommand(mainWindow, selection));
                items.AddIfEnabled(new ResumeVMCommand(mainWindow, selection));
                items.AddIfEnabled(new SuspendVMCommand(mainWindow, selection));
                items.AddIfEnabled(new RebootVMCommand(mainWindow, selection));
                items.AddSeparator();
                items.AddIfEnabled(new ForceVMShutDownCommand(mainWindow, selection));
                items.AddIfEnabled(new ForceVMRebootCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new InstallToolsCommand(mainWindow, selection));
                items.AddIfEnabled(new DeleteVMCommand(mainWindow, selection));
                items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
                items.AddPluginItems(PluginContextMenu.vm, selection);
            }
예제 #13
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new ShutDownVMCommand(mainWindow, selection));
                items.AddIfEnabled(new StartVMCommand(mainWindow, selection));
                items.AddIfEnabled(new ResumeVMCommand(mainWindow, selection));
                items.AddIfEnabled(new SuspendVMCommand(mainWindow, selection));
                items.AddIfEnabled(new RebootVMCommand(mainWindow, selection));
                items.AddSeparator();
                items.AddIfEnabled(new ForceVMShutDownCommand(mainWindow, selection));
                items.AddIfEnabled(new ForceVMRebootCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new VappStartCommand(mainWindow, selection));
                items.AddIfEnabled(new VappShutDownCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new StartVMOnHostToolStripMenuItem(mainWindow, selection, true));
                items.AddIfEnabled(new ResumeVMOnHostToolStripMenuItem(mainWindow, selection, true));
                items.AddIfEnabled(new MigrateVMToolStripMenuItem(mainWindow, selection, true));
                items.AddIfEnabled(new ExportCommand(mainWindow, selection));
                items.AddIfEnabled(new AssignGroupToolStripMenuItem <VMPP>(mainWindow, selection, true));
                items.AddIfEnabled(new AssignGroupToolStripMenuItem <VM_appliance>(mainWindow, selection, true));
                items.AddSeparator();

                items.AddIfEnabled(new InstallToolsCommand(mainWindow, selection));
                items.AddIfEnabled(new DeleteVMCommand(mainWindow, selection));
                items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
                items.AddPluginItems(PluginContextMenu.vm, selection);
            }
예제 #14
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new DeleteVMsAndTemplatesCommand(mainWindow, selection));
     items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
 }
예제 #15
0
 public abstract void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items);
예제 #16
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new AddSelectedHostToPoolToolStripMenuItem(mainWindow, selection, true));
     items.AddIfEnabled(new DisconnectHostCommand(mainWindow, selection));
     items.AddIfEnabled(new RebootHostCommand(mainWindow, selection));
     items.AddIfEnabled(new ShutDownHostCommand(mainWindow, selection));
     items.AddIfEnabled(new RestartToolstackCommand(mainWindow, selection));
     items.AddSeparator();
     items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
     items.AddSeparator();
     items.AddPluginItems(PluginContextMenu.server, selection);
     items.AddSeparator();
 }
예제 #17
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new DisconnectHostsAndPoolsCommand(mainWindow, selection), true);
     items.AddIfEnabled(new ReconnectHostCommand(mainWindow, selection), true);
     items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
 }
예제 #18
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                Host host = (Host)selection[0].XenObject;

                items.AddIfEnabled(new NewVMCommand(mainWindow, selection));
                items.AddIfEnabled(new NewSRCommand(mainWindow, selection));
                items.AddIfEnabled(new ImportCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new AddSelectedHostToPoolToolStripMenuItem(mainWindow, selection, true));
                items.AddSeparator();

                items.AddIfEnabled(new HostMaintenanceModeCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new RebootHostCommand(mainWindow, selection));
                items.AddIfEnabled(new ShutDownHostCommand(mainWindow, selection));
                items.AddIfEnabled(new PowerOnHostCommand(mainWindow, selection));
                items.AddIfEnabled(new RestartToolstackCommand(mainWindow, selection));
                items.AddSeparator();
                items.AddIf(new InstallNewUpdateCommand(mainWindow), () => !Host.IsFullyPatched(host, ConnectionsManager.XenConnectionsCopy));
                items.AddIfEnabled(new RemoveHostCrashDumpsCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new DisconnectHostCommand(mainWindow, selection));
                items.AddIfEnabled(new HostReconnectAsCommand(mainWindow, selection));
                items.AddPluginItems(PluginContextMenu.server, selection);
                items.AddSeparator();

                items.AddIfEnabled(new HostPropertiesCommand(mainWindow, selection));
            }
예제 #19
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new DisconnectPoolCommand(mainWindow, selection), true);
     items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
     items.AddPluginItems(PluginContextMenu.pool, selection);
 }
예제 #20
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                items.AddIfEnabled(new PowerOnHostCommand(mainWindow, selection));
                items.AddIfEnabled(new DestroyHostCommand(mainWindow, selection));

                if (selection.Count == 1)
                {
                    items.AddSeparator();
                    items.AddIfEnabled(new HostPropertiesCommand(mainWindow, selection));
                }
            }
예제 #21
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new UpgradeSRCommand(mainWindow, selection));
     items.AddIfEnabled(new ShareSRCommand(mainWindow, selection));
     items.AddIfEnabled(new RepairSRCommand(mainWindow, selection));
     items.AddIfEnabled(new DetachSRCommand(mainWindow, selection));
     items.AddIfEnabled(new ForgetSRCommand(mainWindow, selection));
     items.AddIfEnabled(new DestroySRCommand(mainWindow, selection));
     items.AddIfEnabled(new EditTagsCommand(mainWindow, selection));
 }
예제 #22
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new NewVMFromSnapshotCommand(mainWindow, selection));
     items.AddIfEnabled(new NewTemplateFromSnapshotCommand(mainWindow, selection));
     items.AddIfEnabled(new ExportSnapshotAsTemplateCommand(mainWindow, selection));
     items.AddIfEnabled(new DeleteSnapshotCommand(mainWindow, selection));
     items.AddPluginItems(PluginContextMenu.vm, selection);
     items.AddSeparator();
     items.AddIfEnabled(new PropertiesCommand(mainWindow, selection));
 }
예제 #23
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     // Default behaviour of this command is very conservative, they wont be able to delete if there are multi vbds,
     // or if any of the vbds are plugged on top of the other constraints.
     items.Add(new DeleteVirtualDiskCommand(mainWindow, selection));
     items.AddSeparator();
     items.Add(new PropertiesCommand(mainWindow, selection));
 }
예제 #24
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.AddIfEnabled(new VappStartCommand(mainWindow, selection));
     items.AddIfEnabled(new VappShutDownCommand(mainWindow, selection));
 }
예제 #25
0
            public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
            {
                VM vm = (VM)selection[0].XenObject;

                items.AddIfEnabled(new ShutDownVMCommand(mainWindow, selection));
                items.AddIfEnabled(new StartVMCommand(mainWindow, selection), vm.power_state == vm_power_state.Halted);
                items.AddIfEnabled(new ResumeVMCommand(mainWindow, selection));
                items.AddIfEnabled(new SuspendVMCommand(mainWindow, selection));
                items.AddIfEnabled(new RebootVMCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new ForceVMShutDownCommand(mainWindow, selection));
                items.AddIfEnabled(new ForceVMRebootCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new VappStartCommand(mainWindow, selection));
                items.AddIfEnabled(new VappShutDownCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new StartVMOnHostToolStripMenuItem(mainWindow, selection, true));
                items.AddIfEnabled(new ResumeVMOnHostToolStripMenuItem(mainWindow, selection, true));
                items.AddIfEnabled(new MigrateVMToolStripMenuItem(mainWindow, selection, true));
                items.AddSeparator();

                items.AddIfEnabled(new CopyVMCommand(mainWindow, selection));
                items.AddIfEnabled(new MoveVMCommand(mainWindow, selection));
                items.AddIfEnabled(new ExportCommand(mainWindow, selection));
                items.AddIfEnabled(new TakeSnapshotCommand(mainWindow, selection));
                items.AddIfEnabled(new ConvertVMToTemplateCommand(mainWindow, selection));
                items.AddIfEnabled(new AssignGroupToolStripMenuItem <VMPP>(mainWindow, selection, true));
                items.AddIfEnabled(new AssignGroupToolStripMenuItem <VM_appliance>(mainWindow, selection, true));
                items.AddSeparator();

                items.AddIfEnabled(new InstallToolsCommand(mainWindow, selection));
                items.AddSeparator();

                items.AddIfEnabled(new DeleteVMCommand(mainWindow, selection));

                items.AddPluginItems(PluginContextMenu.vm, selection);
                items.AddSeparator();
                items.AddIfEnabled(new PropertiesCommand(mainWindow, selection));
            }