Esempio n. 1
0
        /// <summary>
        /// Adds a <see cref="RenderObject"/> to the rendering.
        /// </summary>
        /// An appropriate <see cref="RootRenderFeature"/> will be found and the object will be initialized with it.
        /// If nothing could be found, <see cref="RenderObject.RenderFeature"/> will be null.
        /// <param name="renderObject"></param>
        public void AddRenderObject(RenderObject renderObject)
        {
            RootRenderFeature renderFeature;

            if (renderFeaturesByType.TryGetValue(renderObject.GetType(), out renderFeature))
            {
                // Found it
                renderFeature.AddRenderObject(renderObject);
            }
            else
            {
                // New type without render feature, let's do auto pipeline setup
                if (InstantiateDefaultPipelinePlugin(renderObject.GetType()))
                {
                    // Try again, after pipeline plugin setup
                    if (renderFeaturesByType.TryGetValue(renderObject.GetType(), out renderFeature))
                    {
                        renderFeature.AddRenderObject(renderObject);
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a <see cref="RenderObject"/> to the rendering.
        /// </summary>
        /// An appropriate <see cref="RootRenderFeature"/> will be found and the object will be initialized with it.
        /// If nothing could be found, <see cref="RenderObject.RenderFeature"/> will be null.
        /// <param name="renderObject"></param>
        public void AddRenderObject(RenderObject renderObject)
        {
            List <RootRenderFeature> renderFeatures;

            if (renderFeaturesByType.TryGetValue(renderObject.GetType(), out renderFeatures))
            {
                // Try each available compatible render feature
                foreach (var renderFeature in renderFeatures)
                {
                    if (renderFeature.TryAddRenderObject(renderObject))
                    {
                        break;
                    }
                }
            }
        }