/// <summary>
        /// Parses an object renderer.
        /// </summary>
        /// <param name="element">The renderer element.</param>
        /// <remarks>
        /// <para>
        /// Parse an XML element that represents a renderer.
        /// </para>
        /// </remarks>
        protected void ParseRenderer(XmlElement element)
        {
            string renderingClassName = element.GetAttribute(RENDERING_TYPE_ATTR);
            string renderedClassName  = element.GetAttribute(RENDERED_TYPE_ATTR);

            LogLog.Debug(declaringType, "Rendering class [" + renderingClassName + "], Rendered class [" + renderedClassName + "].");
            IObjectRenderer renderer = (IObjectRenderer)OptionConverter.InstantiateByClassName(renderingClassName, typeof(IObjectRenderer), null);

            if (renderer == null)
            {
                LogLog.Error(declaringType, "Could not instantiate renderer [" + renderingClassName + "].");
                return;
            }
            else
            {
                try
                {
                    m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(renderedClassName, true, true), renderer);
                }
                catch (Exception e)
                {
                    LogLog.Error(declaringType, "Could not find class [" + renderedClassName + "].", e);
                }
            }
        }
Esempio n. 2
0
        protected void ParseRenderer(XmlElement element)
        {
            string attribute = element.GetAttribute("renderingClass");
            string typeName  = element.GetAttribute("renderedClass");

            string[] textArray1 = new string[] { "Rendering class [", attribute, "], Rendered class [", typeName, "]." };
            LogLog.Debug(declaringType, string.Concat(textArray1));
            IObjectRenderer renderer = (IObjectRenderer)OptionConverter.InstantiateByClassName(attribute, typeof(IObjectRenderer), null);

            if (renderer == null)
            {
                LogLog.Error(declaringType, "Could not instantiate renderer [" + attribute + "].");
            }
            else
            {
                try
                {
                    this.m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(typeName, true, true), renderer);
                }
                catch (Exception exception)
                {
                    LogLog.Error(declaringType, "Could not find class [" + typeName + "].", exception);
                }
            }
        }
        /// <summary>
        /// Parses an object renderer.
        /// </summary>
        /// <param name="element">The renderer element.</param>
        /// <remarks>
        /// <para>
        /// Parse an XML element that represents a renderer.
        /// </para>
        /// </remarks>
        protected void ParseRenderer(XmlElement element)
        {
            string attribute  = element.GetAttribute("renderingClass");
            string attribute2 = element.GetAttribute("renderedClass");

            LogLog.Debug(declaringType, "Rendering class [" + attribute + "], Rendered class [" + attribute2 + "].");
            IObjectRenderer objectRenderer = (IObjectRenderer)OptionConverter.InstantiateByClassName(attribute, typeof(IObjectRenderer), null);

            if (objectRenderer == null)
            {
                LogLog.Error(declaringType, "Could not instantiate renderer [" + attribute + "].");
            }
            else
            {
                try
                {
                    m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(GetType().GetTypeInfo().Assembly, attribute2, throwOnError: true, ignoreCase: true), objectRenderer);
                }
                catch (Exception exception)
                {
                    LogLog.Error(declaringType, "Could not find class [" + attribute2 + "].", exception);
                }
            }
        }