예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #3
0
 public void execute()
 {
     light.off();
 }
예제 #4
0
 public void endMovie()
 {
     l.off();
     t.off();
 }
예제 #5
0
 public void undo()
 {
     light.off();
 }