public void Undo() { if (fan.ToggleCount <= 1) { fan.TurnOff(); fan.ToggleCount = 0; } else { fan.LastSpeed(); fan.ToggleCount--; } }
public void Execute(object parameter) { fan.TurnOff(); lastToggleCount = fan.ToggleCount; fan.ToggleCount = 0; }