/// <summary> /// Creates new descriptor over given action /// </summary> /// <param name="render"> </param> public RenderDescriptor(IRender render) { Render = render; Name = RenderAttribute.GetName(render); DirectRole = RenderAttribute.GetRole(render); var contextualRender = render as IContextualRender; if (contextualRender != null) { contextualRender.SetDescriptor(this); } }
private void RegisterRender(Type type) { var name = NormalizeRenderName(RenderAttribute.GetName(type)); var component = Container.EmptyComponent(); component.Name = name; component.ServiceType = typeof(IRender); component.ImplementationType = type; component.Lifestyle = Lifestyle.Transient; Container.Register(component); ClearCaches(MvcObjectType.Render, name); }