269
|
1 using System;
|
|
2 using System.Xml.Serialization;
|
|
3 using Unity.Lifetime;
|
|
4 using Unity.Registration;
|
|
5
|
|
6 namespace Implab.ServiceHost.Unity {
|
|
7
|
|
8 [XmlRoot("register", Namespace = Schema.ContainerConfigurationNamespace)]
|
|
9 public class RegisterElement : AbstractRegistration {
|
|
10
|
|
11 /// <summary>
|
|
12 /// An optional type specification for the service registration,
|
|
13 /// must be assignable from the type specified by <see cref="ImplementedType"/>
|
|
14 /// </summary>
|
|
15 [XmlAttribute("provides")]
|
|
16 public string ProvidesType { get; set; }
|
|
17
|
|
18 /// <summary>
|
|
19 /// The type which is registered as a service in the container.
|
|
20 /// </summary>
|
|
21 [XmlAttribute("type")]
|
|
22 public string ImplementedType { get; set; }
|
|
23
|
|
24 [XmlElement("signleton", typeof(SimgletonLifetimeElement))]
|
|
25 [XmlElement("context", typeof(ContextLifetimeElement))]
|
|
26 [XmlElement("container", typeof(ContainerLifetimeElement))]
|
|
27 [XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))]
|
|
28 public LifetimeElement Lifetime {get; set;}
|
|
29
|
|
30 [XmlElement("constructor", typeof(ConstructorInjectorElement))]
|
|
31 [XmlElement("property", typeof(PropertyInjectorElement))]
|
|
32 [XmlElement("method", typeof(MethodInjectorElement))]
|
|
33 public AbstractInjectorElement[] Injectors { get; set; }
|
|
34 }
|
|
35
|
|
36 } |