Ejemplo n.º 1
0
 public WechatHandler(IHttpContextAccessor httpContextAccessor, IWechatContext wechatContext)
 {
     this.httpContext   = httpContextAccessor;
     this.wechatContext = wechatContext;
     //this.httpClientFactory = httpClientFactory;
     this.wechat = new WechatModel();
     this.wechatContext.WechatModel = this.wechat;
 }
Ejemplo n.º 2
0
        public MessageBase Hanlde(IWechatContext wechatContext)
        {
            if (wechatContext == null)
            {
                throw new ArgumentNullException("wechatContext");
            }

            var kernelContext = new KernelContext(wechatContext, Setting, _handlerCollection);

            var dispatcher = TypeResolver.Resolve <IDispatcher>();
            var handler    = dispatcher.Dispatching(kernelContext);

            return(handler.Process());
        }
Ejemplo n.º 3
0
        internal KernelContext(IWechatContext wechatContext, KernelSetting setting, HandlerCollection handlerCollection)
        {
            if (wechatContext == null)
            {
                throw new ArgumentNullException("wechatContext");
            }
            if (setting == null)
            {
                throw new ArgumentNullException("setting");
            }
            if (handlerCollection == null)
            {
                throw new ArgumentNullException("handlerCollection");
            }

            WechatContext   = wechatContext;
            Setting         = setting;
            MessageHandlers = new ReadOnlyCollection <IMessageHandler>(handlerCollection);
            RawBody         = wechatContext.RawBody;
        }
Ejemplo n.º 4
0
 public MessageBase VerifyAvailability(IWechatContext wechatContext)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public CustomMenu(IWechatContext wechatContext)
 {
     this.WechatContext = wechatContext;
 }