Exemplo n.º 1
0
        public TBuilder WithRenderer(Type rendererType)
        {
            Guard.ArgumentNotNull(() => rendererType);
            Guard.Implements <ComponentRenderer <TComponent> >(rendererType);
            var renderer = TypeHelper.CreateInstance(rendererType) as ComponentRenderer <TComponent>;

            if (renderer != null)
            {
                this.Renderer = renderer;
            }
            return(this as TBuilder);
        }
Exemplo n.º 2
0
 public TBuilder WithRenderer <T>(ComponentRenderer <TComponent> instance)
     where T : ComponentRenderer <TComponent>
 {
     Guard.ArgumentNotNull(() => instance);
     return(this.WithRenderer(typeof(T)));
 }
Exemplo n.º 3
0
 private void EnrichRenderer(ComponentRenderer <TComponent> renderer)
 {
     renderer.Component   = this.Component;
     renderer.ViewContext = this.HtmlHelper.ViewContext;
     renderer.ViewData    = this.HtmlHelper.ViewData;
 }