annotate Implab.ServiceHost/Unity/AbstractRegistration.cs @ 271:d4d437ec4483 v3

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