annotate Implab.ServiceHost/Unity/RegisterElement.cs @ 270:ade80d94dfb5 v3

Working on Unity container xml configuration
author cin
date Wed, 25 Apr 2018 04:44:40 +0300
parents ff581cff7003
children d4d437ec4483
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
269
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
1 using System;
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
2 using System.Xml.Serialization;
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
3 using Unity.Lifetime;
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
4 using Unity.Registration;
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
5
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
6 namespace Implab.ServiceHost.Unity {
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
7
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
8 [XmlRoot("register", Namespace = Schema.ContainerConfigurationNamespace)]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
9 public class RegisterElement : AbstractRegistration {
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
10
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
11 /// <summary>
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
12 /// An optional type specification for the service registration,
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
13 /// must be assignable from the type specified by <see cref="ImplementedType"/>
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
14 /// </summary>
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
15 [XmlAttribute("provides")]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
16 public string ProvidesType { get; set; }
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
17
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
18 /// <summary>
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
19 /// The type which is registered as a service in the container.
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
20 /// </summary>
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
21 [XmlAttribute("type")]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
22 public string ImplementedType { get; set; }
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
23
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
24 [XmlElement("signleton", typeof(SimgletonLifetimeElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
25 [XmlElement("context", typeof(ContextLifetimeElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
26 [XmlElement("container", typeof(ContainerLifetimeElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
27 [XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
28 public LifetimeElement Lifetime {get; set;}
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
29
270
ade80d94dfb5 Working on Unity container xml configuration
cin
parents: 269
diff changeset
30 [XmlElement("constructor", typeof(ConstructorInjectionElement))]
ade80d94dfb5 Working on Unity container xml configuration
cin
parents: 269
diff changeset
31 [XmlElement("property", typeof(PropertyInjectionElement))]
ade80d94dfb5 Working on Unity container xml configuration
cin
parents: 269
diff changeset
32 [XmlElement("method", typeof(MethodInjectionElement))]
ade80d94dfb5 Working on Unity container xml configuration
cin
parents: 269
diff changeset
33 public AbstractInjectionElement[] Injectors { get; set; }
269
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
34 }
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
35
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
36 }