示例#1
0
        public string Render(RenderContext context)
        {
            var component = ComponentService.GetComponent(setting.TagName);

            if (this.data != null)
            {
                context.DataContext.Push(setting.Settings);
            }

            string result = Kooboo.Sites.Render.RenderHelper.Render(component.RenderTasks, context);

            if (this.data != null)
            {
                context.DataContext.Pop();
            }

            return(result);
        }
示例#2
0
        public EvaluatorResponse Evaluate(Node node, EvaluatorOption options)
        {
            if (node.nodeType != enumNodeType.ELEMENT)
            {
                return(null);
            }
            var element = node as Element;

            if (ComponentService.IsServerComponent(element.tagName))
            {
                var response = new EvaluatorResponse();
                List <IRenderTask> result = new List <IRenderTask>();
                result.Add(new ServerComponentRenderTask(element));
                response.ContentTask       = result;
                response.OmitTag           = true;
                response.StopNextEvaluator = true;
                return(response);
            }
            return(null);
        }