Exemplo n.º 1
0
        public static void Begin(MvcContext ctx)
        {
            WebStopwatch.Start();

            MvcEventPublisher.Instance.BeginProcessMvc(ctx);

            List <ProcessorBase> processorList = initProcessor();
            ProcessContext       context       = new ProcessContext(ctx);

            foreach (ProcessorBase p in processorList)
            {
                if (context.isEnd())
                {
                    break;                  // showEnd 会跳过下面所有处理器,除了 RenderProcessor
                }
                if (context.ctx.utils.GetCancelMvcProcessor().Contains(p.GetType()))
                {
                    continue;                                                                    // cancelProcessor 会跳过指定处理器
                }
                p.Process(context);
                context.ctx.utils.skipCurrentProcessor(false);   // 重置状态 // skipCurrentProcessor 会跳过当前处理器的剩余部分
            }

            // 呈现页面内容
            if (skinRender(ctx) == false)
            {
                new RenderProcessor().Process(context);
            }

            ctx.web.CompleteRequest();
        }
Exemplo n.º 2
0
        public virtual void ProcessRequest(HttpContext context)
        {
            if (MvcConfig.Instance.IsPageCache)
            {
                String key = MvcConfig.Instance.CheckDomainMap() ? context.Request.Url.ToString() : context.Request.Url.PathAndQuery;

                String pageContent = CacheManager.GetApplicationCache().Get(key) as String;
                if (pageContent != null)
                {
                    context.Response.Write(pageContent);
                    return;
                }
            }

            MvcContext ctx = new MvcContext(new WebContext(context));

            ProcessContext.Begin(ctx);
        }
Exemplo n.º 3
0
        public static void Begin( MvcContext ctx )
        {
            WebStopwatch.Start();

            MvcEventPublisher.Instance.BeginProcessMvc( ctx );

            List<ProcessorBase> processorList = initProcessor();
            ProcessContext context = new ProcessContext( ctx );
            foreach (ProcessorBase p in processorList) {

                if (ctx.utils.isEnd()) break; // showEnd 会跳过下面所有处理器,除了 RenderProcessor

                if (ctx.utils.GetCancelMvcProcessor().Contains( p.GetType() )) continue; // cancelProcessor 会跳过指定处理器

                p.Process( context );
                ctx.utils.skipCurrentProcessor( false ); // 重置状态 // skipCurrentProcessor 会跳过当前处理器的剩余部分
            }

            // 呈现页面内容
            if (skinRender( ctx ) == false) new RenderProcessor().Process( context );

            ctx.web.CompleteRequest();
        }
Exemplo n.º 4
0
 public virtual void ProcessRequest(MvcContext context)
 {
     ProcessContext.Begin(context);
 }
Exemplo n.º 5
0
 public virtual void ProcessRequest(IWebContext context)
 {
     ProcessContext.Begin(new MvcContext(context));
 }