예제 #1
0
        static void Main()
        {
            //The chain of responsibility
            Approver larry = new Director();
            Approver sam   = new VicePresident();
            Approver tammy = new President();

            larry.SetSuccesor(sam);
            sam.SetSuccesor(tammy);

            //Generate and process purchase requests
            Purchase p = new Purchase(2034, 350.5, "Assets");

            larry.ProcessRequest(p);

            p = new new Purchase(2034, 2343.4, "Project X");
            larry.ProcessRequest(p);

            Console.ReadKey();
        }