public void Execute(object parameter) { if (fan.CurrentSpeed == 0) { fan.TurnOn(); } else { fan.NextSpeed(); } fan.ToggleCount++; }
public void Undo() { fan.TurnOn(); fan.ToggleCount = lastToggleCount; }