public AcceptTypeExpression With <TRenderer>() where TRenderer : IRenderer { var rendererType = typeof(TRenderer); RendererReg renderReg = Renderers .Where(renderer => renderer.Key.RendererType == rendererType) .Select(renderer => renderer.Key) .FirstOrDefault(); AcceptTypeExpression typeExpression; if (renderReg == null) { renderReg = new RendererReg { RendererType = rendererType }; typeExpression = new AcceptTypeExpression(renderReg); Renderers.Add(renderReg, typeExpression); } else { typeExpression = Renderers[renderReg]; } return(typeExpression); }
public AcceptTypeExpression(RendererReg renderer) { Renderer = renderer; }