예제 #1
0
        public override void Handle(Context context)
        {
            Console.WriteLine(Name + " is handling context.");

            // change context state51
            context.SetState(new ConcreteStateA());
        }
예제 #2
0
        public void Run()
        {
            var context = new Context();
            context.SetState(new ConcreteStateA());

            context.Request();

               // context.SetState(new ConcreteStateB());
            context.Request();
        }