示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello State design pattern!");

            var sw = new Switch();

            sw.On();
            sw.On();
            sw.Off();
            sw.Off();
            sw.On();
        }
示例#2
0
        static void Main(string[] args)
        {
            var ls = new Switch();

            ls.On();
            ls.Off();
            ls.Off();
        }