diff Implab.ServiceHost/Unity/ValueElement.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/ValueElement.cs	Sat Apr 28 00:11:38 2018 +0300
+++ b/Implab.ServiceHost/Unity/ValueElement.cs	Sat Apr 28 18:48:09 2018 +0300
@@ -1,7 +1,7 @@
 using System.Xml.Serialization;
 
 namespace Implab.ServiceHost.Unity {
-    public class ValueElement : AbstractRegistration, ITextValue {
+    public class ValueElement : InstanceAbstractRegistration {
         
         [XmlAttribute("value")]
         public string Value { get; set; }
@@ -9,10 +9,8 @@
         [XmlText]
         public string Text { get; set; }
 
-        string ITextValue.Value {
-            get {
-                return string.IsNullOrEmpty(Value) ? Text : Value;
-            }
+        string GetTextValue() {
+            return string.IsNullOrEmpty(Value) ? Text : Value;
         }
 
         public string TypeName {
@@ -21,8 +19,13 @@
             }
         }
 
-        public override void Visit(ContainerBuilder context) {
-            context.Visit(this);
+        public override void Visit(InstanceRegistrationBuilder builder) {
+            base.Visit(builder);
+            var parameter = new ValueParameterElement {
+                Value = Value,
+                Text = Text
+            };
+            parameter.Visit(builder.ValueBuilder);
         }
     }
 }
\ No newline at end of file