Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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();
 }
Beispiel #4
0
 public void watchMovie()
 {
     l.on();
     t.on();
 }
Beispiel #5
0
 public void execute()
 {
     light.on();
 }