コード例 #1
0
 /// <summary>
 /// Adds an object renderer for a specific class.
 /// </summary>
 /// <param name="typeToRender">The type that will be rendered by the renderer supplied.</param>
 /// <param name="rendererInstance">The object renderer used to render the object.</param>
 /// <remarks>
 /// <para>
 /// Adds an object renderer for a specific class.
 /// </para>
 /// </remarks>
 public virtual void AddRenderer(Type typeToRender, IObjectRenderer rendererInstance)
 {
     if ((object)typeToRender == null)
     {
         throw new ArgumentNullException("typeToRender");
     }
     if (rendererInstance == null)
     {
         throw new ArgumentNullException("rendererInstance");
     }
     m_rendererMap.Put(typeToRender, rendererInstance);
 }
コード例 #2
0
        /// <summary>
        /// Adds an object renderer for a specific class.
        /// </summary>
        /// <param name="classToRender">The type that will be rendered by the renderer supplied.</param>
        /// <param name="objectRenderer">The object renderer used to render the object.</param>
        virtual public void AddRenderer(Type classToRender, IObjectRenderer objectRenderer)
        {
            if (classToRender == null)
            {
                throw new ArgumentNullException("classToRender");
            }
            if (objectRenderer == null)
            {
                throw new ArgumentNullException("objectRenderer");
            }

            m_rendererMap.Put(classToRender, objectRenderer);
        }
コード例 #3
0
        /// <summary>
        /// Retorna una clase que puede representar en formato XML el cabezal de
        /// mensajes.
        /// </summary>
        /// <param name="renderingMap">Es un mapa con todas las clases que
        /// representan objetos.</param>
        /// <returns>Una clase que puede representar en formato XML el cabezal de
        /// mensajes.
        /// </returns>
        public override MessagingComponentXmlRendering XmlRendering(
            RendererMap renderingMap)
        {
            IObjectRenderer objectRendering = renderingMap.Get(typeof(MessageHeader));

            if (objectRendering == null)
            {
                // Add renderer to map.
                objectRendering = new MessageHeaderXmlRendering();
                renderingMap.Put(typeof(MessageHeader), objectRendering);
            }
            else
            if (!(objectRendering is MessageHeaderXmlRendering))
            {
                objectRendering = new MessageHeaderXmlRendering();
            }

            return(( MessagingComponentXmlRendering)objectRendering);
        }
コード例 #4
0
 internal void ApplyTo(RendererMap map)
 {
     map.Put(_targetType, _renderer);
 }