view Implab.ServiceHost/Unity/SerializedElement.cs @ 277:963b17c275be v3

Refactoring Added <array> element to injection parameters Working on registrations of factories
author cin
date Sat, 28 Apr 2018 18:48:09 +0300
parents 6fefd5811b9b
children 8714471e8d78
line wrap: on
line source

using System;
using System.Xml;
using System.Xml.Serialization;

namespace Implab.ServiceHost.Unity
{
    public class SerializedElement : InstanceAbstractRegistration {
        [XmlAttribute("href")]
        public string Location { get; set; }

        [XmlAttribute("serializedType")]
        public string SerializedType { get; set; }


        [XmlAnyElement]
        public XmlElement[] Content { get; set; }

        public override void Visit(InstanceRegistrationBuilder builder) {
            base.Visit(builder);

            var parameter = new SerializedParameterElement {
                TypeName = SerializedType,
                Location = Location,
                Content = Content
            };
            parameter.Visit(builder.ValueBuilder);
        }
    }
}