public void Execute(object parameter) { Light l = new Light(); string flag; if (parameter is string) { flag = parameter as string; } else { flag = string.Empty; } switch (flag) { case "on": l.on(); break; case "off": l.off(); break; } }
private void Lightcommand(object obj) { IProducts l = new Light(); string flag; if (obj is string) { flag = obj as string; } else { flag = string.Empty; } CommandList.Add(flag); switch (flag) { case "on": l.on(); Recent = "Light on"; break; case "off": l.off(); Recent = "Light off"; break; } }
public void undo() { light.on(); }
public void watchMovie() { l.on(); t.on(); }
public void execute() { light.on(); }