protected override void Run() { ActionCountCompleted = 0; ActionCountTotal = VmsToSuspend.Count + VmsToShutdown.Count; foreach (VM vm in VmsToSuspend) { Description = string.Format(Messages.SUSPENDING_VM_OUT_OF, ActionCountCompleted + 1, VmsToSuspend.Count); var action = new VMSuspendAction(vm); action.Changed += action_Changed; action.RunExternal(Session); ActionCountCompleted++; } foreach (VM vm in VmsToShutdown) { Description = string.Format(Messages.SHUTTING_DOWN_VM_OUT_OF, ActionCountCompleted - VmsToSuspend.Count + 1, VmsToShutdown.Count); var action = new VMHardShutdown(vm); action.Changed += action_Changed; action.RunExternal(Session); ActionCountCompleted++; } }