Ejemplo n.º 1
0
        void Main()
        {
            Handler h1 = new ConcreteHandler1();
            Handler h2 = new ConcreteHandler2();

            h1.Successor = h2;
            h1.HandleRequest(2);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ChainOfResponsibilityPattern
        /// </summary>
        private static void ChainOfResponsibilityRun()
        {
            int     condition = 2;
            Handler h1        = new ConcreteHandler1();
            Handler h2        = new ConcreteHandler2();

            h1.Successor = h2;
            h2.Successor = h1;
            h1.HandleRequest(ref condition);
        }