diff Implab.ServiceHost/Unity/AbstractRegistration.cs @ 277:963b17c275be v3

Refactoring Added <array> element to injection parameters Working on registrations of factories
author cin
date Sat, 28 Apr 2018 18:48:09 +0300
parents 22629bf26121
children 8714471e8d78
line wrap: on
line diff
--- a/Implab.ServiceHost/Unity/AbstractRegistration.cs	Sat Apr 28 00:11:38 2018 +0300
+++ b/Implab.ServiceHost/Unity/AbstractRegistration.cs	Sat Apr 28 18:48:09 2018 +0300
@@ -5,7 +5,10 @@
 
 namespace Implab.ServiceHost.Unity
 {
-    public abstract class AbstractRegistration : ContainerItemElement {
+    /// <summary>
+    /// Базовая информаци о регистрации в контейнере: тип, имя и время жизни
+    /// </summary>
+    public abstract class AbstractRegistration : AbstractContainerItem {
 
         /// <summary>
         /// An optional name for a registration in the container
@@ -15,7 +18,7 @@
             get; set;
         }
 
-        [XmlElement("signleton", typeof(SimgletonLifetimeElement))]
+        [XmlElement("signleton", typeof(SingletonLifetimeElement))]
         [XmlElement("context", typeof(ContextLifetimeElement))]
         [XmlElement("container", typeof(ContainerLifetimeElement))]
         [XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))]
@@ -27,5 +30,13 @@
         [XmlAttribute("type")]
         public string RegistrationType { get; set; }
 
+        public virtual Type GetRegistrationType(Func<string,Type> resolver) {
+            return resolver(RegistrationType);
+        }
+
+        public virtual void Visit(RegistrationBuilder builder) {
+            Lifetime?.Visit(builder);
+        }
+
     }
 }
\ No newline at end of file