annotate Implab.ServiceHost/Unity/RegisterElement.cs @ 269:ff581cff7003 v3

Working on Unity container xml configuration
author cin
date Tue, 24 Apr 2018 01:46:02 +0300
parents
children ade80d94dfb5
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
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
30 [XmlElement("constructor", typeof(ConstructorInjectorElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
31 [XmlElement("property", typeof(PropertyInjectorElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
32 [XmlElement("method", typeof(MethodInjectorElement))]
ff581cff7003 Working on Unity container xml configuration
cin
parents:
diff changeset
33 public AbstractInjectorElement[] Injectors { get; set; }
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 }