public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(MoveVirtualDiskDialog.MoveMigrateCommand(mainWindow, selection));
     // 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));
 }
            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));
                }
            }
Beispiel #3
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);
                }

                items.AddSeparator();
                items.Add(new AddHostToSelectedPoolToolStripMenuItem(mainWindow, selection, true));
                items.Add(new DisconnectPoolCommand(mainWindow, selection));
                items.Add(new PoolReconnectAsCommand(mainWindow, selection));
                items.AddSeparator();
                items.Add(new DeletePoolCommand(mainWindow, selection));
                items.AddPluginItems(PluginContextMenu.pool, selection);
                items.AddSeparator();
                items.Add(new PoolPropertiesCommand(mainWindow, selection));
            }
Beispiel #4
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();

                var haItem = new CommandToolStripMenuItem(new HACommand(mainWindow, selection), true);

                if (haItem.Command.CanExecute())
                {
                    haItem.DropDownItems.Add(new CommandToolStripMenuItem(new HAConfigureCommand(mainWindow, selection), true));
                    haItem.DropDownItems.Add(new CommandToolStripMenuItem(new HADisableCommand(mainWindow, selection), true));
                    items.Add(haItem);
                }

                items.AddIfEnabled(new VMGroupCommand <VMSS>(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);
                }

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

                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));
            }
            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.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));
            }
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new PropertiesCommand(mainWindow, selection));
 }
Beispiel #7
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new DestroySRCommand(mainWindow, selection));
     items.Add(new ForgetSRCommand(mainWindow, selection));
 }
Beispiel #8
0
 public override void Build(IMainWindow mainWindow, SelectedItemCollection selection, ContextMenuItemCollection items)
 {
     items.Add(new NewSRCommand(mainWindow, selection));
     items.AddIfEnabled(new RemoveStorageLinkSystemCommand(mainWindow, selection));
 }