예제 #1
0
        static void Main(string[] args)
        {
            Handler h1 = new Level1Handler("部门组长");
            Handler h2 = new Level2Handler("部门经理");
            Handler h3 = new Level3Handler("Boss");

            h1.SetNextHandler(h2);
            h2.SetNextHandler(h3);

            h1.Handle(2);
            h1.Handle(4);
            h1.Handle(9);
            h1.Handle(10);

            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Handler h1 = new Level1Handler("部门组长");
            Handler h2 = new Level2Handler("部门经理");
            Handler h3 = new Level3Handler("Boss");
            h1.SetNextHandler(h2);
            h2.SetNextHandler(h3);

            h1.Handle(2);
            h1.Handle(4);
            h1.Handle(9);
            h1.Handle(10);

            Console.ReadLine();


        }