コード例 #1
0
 public virtual void Render(IControlOutputContext context, RendererTagAttributes attributes)
 {
     this.RendererControl = context.Control as RendererTagHelper;
     if (null == context.Parent)
     {
         if (1 != context.Children.Count)
         {
             throw new Exception();
         }
         context.Output.TagName = string.Empty;
         this.RenderRootControl(context.Children[0]);
         context.Children[0].Output.Content.MoveTo(context.Output.Content);
         this.RenderAssets(context, attributes);
     }
 }
コード例 #2
0
        public virtual async Task RenderAsync(IControlOutputContext context, RendererTagAttributes attributes)
        {
            this.RendererControl = context.Control as RendererTagHelper;
            if (null == context.Parent)
            {
                if (1 != context.Children.Count)
                {
                    throw new Exception();
                }
                context.Output.TagName = string.Empty;
                this.RenderRootControl((TControl)context.Children[0].Control, context.Children[0]);
                context.Children[0].Output.PreContent.MoveTo(context.Output.PreContent);
                context.Children[0].Output.Content.MoveTo(context.Output.Content);
                context.Children[0].Output.PostContent.MoveTo(context.Output.PostContent);

                await this.RenderAssetsAsync(context);
            }
        }