private void TVcommand(object obj) { IProducts t = new TV(); string flag; if (obj is string) { flag = obj as string; } else { flag = string.Empty; } CommandList.Add(flag); switch (flag) { case "on": t.on(); Recent = "TV on"; break; case "off": t.off(); Recent = "TV off"; break; } }
public void watchMovie() { l.on(); t.on(); }