コード例 #1
0
        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);
        }
コード例 #2
0
 public AcceptTypeExpression(RendererReg renderer)
 {
     Renderer = renderer;
 }