comparison Implab.ServiceHost/Unity/AbstractRegistration.cs @ 273:79110a16cab7 v3

Working on Unity xml configuration: Refactoring in progress
author cin
date Thu, 26 Apr 2018 19:35:01 +0300
parents 9d1cca834b05
children 22629bf26121
comparison
equal deleted inserted replaced
272:9d1cca834b05 273:79110a16cab7
3 using Unity.Lifetime; 3 using Unity.Lifetime;
4 using Unity.Registration; 4 using Unity.Registration;
5 5
6 namespace Implab.ServiceHost.Unity 6 namespace Implab.ServiceHost.Unity
7 { 7 {
8 public abstract class AbstractRegistration : IConfigurationElement { 8 public abstract class AbstractRegistration : ContainerItemElement {
9 9
10 /// <summary> 10 /// <summary>
11 /// An optional name for a registration in the container 11 /// An optional name for a registration in the container
12 /// </summary> 12 /// </summary>
13 [XmlAttribute("name")] 13 [XmlAttribute("name")]
22 public LifetimeElement Lifetime {get; set;} 22 public LifetimeElement Lifetime {get; set;}
23 23
24 /// <summary> 24 /// <summary>
25 /// A type specification for the service registration, 25 /// A type specification for the service registration,
26 /// </summary> 26 /// </summary>
27 [XmlAttribute("provides")] 27 [XmlAttribute("type")]
28 public string ProvidesType { get; set; } 28 public string RegistrationType { get; set; }
29 29
30 public abstract void Visit(ConfigurationContext context); 30 public virtual Type ResolveRegistrationType(ContainerContext ctx) {
31 return ctx.Resolve(RegistrationType);
32 }
33
31 } 34 }
32 } 35 }