Example #1
0
        public BuilderPipeline()
        {
            _head = new BuilderPipelineContext(new BuilderPipelineHead());
            _last = new BuilderPipelineContext(new BuilderPipelineLast());

            _head.Next = _last;
            _last.Prev = _head;
        }
Example #2
0
        public BuilderPipelineContext AddLast(IBuildHandler handler)
        {
            var context     = new BuilderPipelineContext(handler);
            var origin_prev = _last.Prev;

            origin_prev.Next = context;
            context.Prev     = origin_prev;
            _last.Prev       = context;
            return(context);
        }
        public static BuilderPipelineContext AddStep(this BuilderPipelineContext ctx, IBuildHandler nextHandler)
        {
            var nextContext = new BuilderPipelineContext(nextHandler);
            var origin_next = ctx.Next;

            ctx.Next         = nextContext;
            nextContext.Next = origin_next;
            nextContext.Prev = ctx;
            if (origin_next != null)
            {
                origin_next.Prev = nextContext;
            }
            return(nextContext);
        }
Example #4
0
        public BuilderPipelineContext AddFirst(IBuildHandler handler)
        {
            var context       = new BuilderPipelineContext(handler);
            var _origin_first = _head.Next;

            context.Next = _origin_first;
            _head.Next   = context;
            context.Prev = _head;
            if (_origin_first != null)
            {
                _origin_first.Prev = context;
            }
            return(context);
        }
 public BuilderPipelineContext(IBuildHandler handler)
 {
     _handler = handler;
     Next     = null;
     Prev     = null;
 }