예제 #1
0
        public ChainOfResponsibilityLink <T> Chain(IEnumerable <ChainOfResponsibilityLink <T> > handlers)
        {
            ChainOfResponsibilityLink <T> chainOfResponsibilityLink = null;

            foreach (ChainOfResponsibilityLink <T> handler in handlers)
            {
                chainOfResponsibilityLink = this.Chain(handler);
            }
            return(chainOfResponsibilityLink);
        }
예제 #2
0
 public ChainOfResponsibilityLink <T> Chain(ChainOfResponsibilityLink <T> lastHandler)
 {
     if (this.Next != null)
     {
         this._lastLink.Chain(lastHandler);
     }
     else
     {
         this.Next = lastHandler;
     }
     this._lastLink = lastHandler;
     return(this);
 }