AbstractRegistration.cs
33 lines
| 1.0 KiB
| text/x-csharp
|
CSharpLexer
cin
|
r269 | using System; | |
using System.Xml.Serialization; | |||
using Unity.Lifetime; | |||
using Unity.Registration; | |||
namespace Implab.ServiceHost.Unity | |||
{ | |||
public abstract class AbstractRegistration : IConfigurationElement { | |||
/// <summary> | |||
/// An optional name for a registration in the container | |||
/// </summary> | |||
[XmlAttribute("name")] | |||
public string Name { | |||
get; set; | |||
} | |||
cin
|
r271 | [XmlElement("signleton", typeof(SimgletonLifetimeElement))] | |
[XmlElement("context", typeof(ContextLifetimeElement))] | |||
[XmlElement("container", typeof(ContainerLifetimeElement))] | |||
[XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))] | |||
public LifetimeElement Lifetime {get; set;} | |||
/// <summary> | |||
/// A type specification for the service registration, | |||
/// </summary> | |||
[XmlAttribute("provides")] | |||
public string ProvidesType { get; set; } | |||
cin
|
r269 | public void Visit(ConfigurationContext context) { | |
cin
|
r270 | context.Visit(this); | |
cin
|
r269 | } | |
} | |||
} |