コード例 #1
0
        static void Main(string[] args)
        {
            Context context = new Context();

            ModifiedState modified = new ModifiedState();

            modified.DoAction(context);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Context context = new Context();

            ModifiedState modified = new ModifiedState();

            modified.DoAction(context);

            DeleetedState deleted = new DeleetedState();

            deleted.DoAction(context);

            Console.WriteLine(context.GetState());
            Console.ReadLine();
        }