private ToolStripItem[] BuildSubMenu(IMachineMetadata machine) { return(new ToolStripItem[] { new MachineStatusToolStripItem(machine), new ToolStripSeparator(), new ToolStripMenuItem( "Headless start", null, (_, __) => new Task(() => machineController.Start(machine, true)).Start() ), new ToolStripMenuItem( "Normal start", null, (_, __) => new Task(() => machineController.Start(machine, false)).Start() ), new ToolStripSeparator(), new ToolStripMenuItem( "Save State", null, (_, __) => new Task(() => machineController.SaveState(machine)).Start() ), new ToolStripMenuItem( "ACPI Shutdown", null, (_, __) => new Task(() => machineController.AcpiPowerOff(machine, 90000)).Start() ), new ToolStripMenuItem( "Power off", null, (_, __) => new Task(() => machineController.PowerOff(machine)).Start() ), new ToolStripSeparator(), new ToolStripMenuItem( "Reset", null, (_, __) => machineController.Reset(machine) ) }); }
public void StartAll(Func <IMachineMetadata, MachineConfiguration, bool> predicate) { foreach (var machine in appState.GetMachines(predicate)) { if (!machine.IsPoweredOff) { logger.LogInformation($"Skipping start {machine}"); continue; } machineController.Start(machine, true); } }