示例#1
0
        public override TResult Deciding(TContext context)
        {
            var convertedContext = (TContext)context;
            var processedContext = Transform(convertedContext);

            return((TResult)_nextDecision.Deciding(processedContext));
        }
示例#2
0
        public object Deciding(object context)
        {
            if (_first.IsSatisfied(context))
            {
                return(_first.Deciding(context));
            }

            if (_second.IsSatisfied(context))
            {
                return(_second.Deciding(context));
            }

            throw new InvalidOperationException("decision tree cannot handle.");
        }
示例#3
0
        public IMessageProcessor Dispatching(KernelContext wechatContext)
        {
            var decisionResult = _dicisionTree.Deciding(wechatContext);

            return((IMessageProcessor)decisionResult);
        }