comparison Implab.ServiceHost/Unity/DependencyParameterElement.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 6691aff01de1
comparison
equal deleted inserted replaced
276:b4e0f81c7425 277:963b17c275be
1 using System.Xml.Serialization; 1 using System.Xml.Serialization;
2 2
3 namespace Implab.ServiceHost.Unity { 3 namespace Implab.ServiceHost.Unity {
4 public class DependencyParameterElement : InjectionParameterElement, IDependencyReference { 4 public class DependencyParameterElement : InjectionParameterElement {
5 5
6 [XmlAttribute("name")] 6 [XmlAttribute("name")]
7 public string DependencyName { get; set; } 7 public string DependencyName { get; set; }
8 8
9 [XmlAttribute("optional")] 9 [XmlAttribute("optional")]
10 public bool Optional { get; set; } 10 public bool Optional { get; set; }
11 11
12 public override void Visit(InjectionValueBuilder builder) { 12 public override void Visit(InjectionValueBuilder builder) {
13 builder.Visit(this); 13 var type = builder.ResolveInjectedValueType(TypeName);
14 builder.SetDependencyReference(type, DependencyName, Optional);
14 } 15 }
15 } 16 }
16 } 17 }