Exemple #1
0
 private void EnrichRenderer(ComponentRenderer <TComponent> renderer)
 {
     renderer.Component   = this.Component;
     renderer.HtmlHelper  = this.HtmlHelper;
     renderer.ViewContext = this.HtmlHelper.ViewContext;
     renderer.ViewData    = this.HtmlHelper.ViewData;
 }
Exemple #2
0
        public TBuilder WithRenderer(Type rendererType)
        {
            Guard.ArgumentNotNull(() => rendererType);
            Guard.Implements <ComponentRenderer <TComponent> >(rendererType);
            var renderer = Activator.CreateInstance(rendererType) as ComponentRenderer <TComponent>;

            if (renderer != null)
            {
                this.Renderer = renderer;
            }
            return(this as TBuilder);
        }
Exemple #3
0
 public TBuilder WithRenderer <T>(ComponentRenderer <TComponent> instance)
     where T : ComponentRenderer <TComponent>
 {
     Guard.ArgumentNotNull(() => instance);
     return(this.WithRenderer(typeof(T)));
 }