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 public abstract class AbstractRegistration : IConfigurationElement {
|
|
9
|
|
10 /// <summary>
|
|
11 /// An optional name for a registration in the container
|
|
12 /// </summary>
|
|
13 [XmlAttribute("name")]
|
|
14 public string Name {
|
|
15 get; set;
|
|
16 }
|
|
17
|
271
|
18 [XmlElement("signleton", typeof(SimgletonLifetimeElement))]
|
|
19 [XmlElement("context", typeof(ContextLifetimeElement))]
|
|
20 [XmlElement("container", typeof(ContainerLifetimeElement))]
|
|
21 [XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))]
|
|
22 public LifetimeElement Lifetime {get; set;}
|
|
23
|
|
24 /// <summary>
|
|
25 /// A type specification for the service registration,
|
|
26 /// </summary>
|
|
27 [XmlAttribute("provides")]
|
|
28 public string ProvidesType { get; set; }
|
|
29
|
269
|
30 public void Visit(ConfigurationContext context) {
|
270
|
31 context.Visit(this);
|
269
|
32 }
|
|
33 }
|
|
34 } |