changeset 275:6fefd5811b9b v3

refactoring
author cin
date Fri, 27 Apr 2018 16:57:30 +0300
parents 22629bf26121
children b4e0f81c7425
files Implab.ServiceHost/Unity/DefaultParameterElement.cs Implab.ServiceHost/Unity/DependencyParameterElement.cs Implab.ServiceHost/Unity/IDependencyReference.cs Implab.ServiceHost/Unity/IInjectionArray.cs Implab.ServiceHost/Unity/IInjectionParameter.cs Implab.ServiceHost/Unity/ITextValue.cs Implab.ServiceHost/Unity/InjectionParameterElement.cs Implab.ServiceHost/Unity/SerializedElement.cs Implab.ServiceHost/Unity/SerializedParameterElement.cs Implab.ServiceHost/Unity/ValueParameterElement.cs
diffstat 10 files changed, 34 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Implab.ServiceHost/Unity/DefaultParameterElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/DefaultParameterElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -5,7 +5,7 @@
             get { return null; }
         }
 
-        internal override void Visit(InjectionValueBuilder builder) {
+        public override void Visit(InjectionValueBuilder builder) {
             builder.Visit(this);
         }
     }
--- a/Implab.ServiceHost/Unity/DependencyParameterElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/DependencyParameterElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -9,7 +9,7 @@
         [XmlAttribute("optional")]
         public bool Optional { get; set; }
 
-        internal override void Visit(InjectionValueBuilder builder) {
+        public override  void Visit(InjectionValueBuilder builder) {
             builder.Visit(this);
         }
     }
--- a/Implab.ServiceHost/Unity/IDependencyReference.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/IDependencyReference.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -1,8 +1,10 @@
 namespace Implab.ServiceHost.Unity {
     public interface IDependencyReference {
 
-        string TypeName { get; set; }
+        string TypeName { get; }
+
+        bool Optional { get; }
         
-        string DependencyName { get; set; }
+        string DependencyName { get; }
     }
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Implab.ServiceHost/Unity/IInjectionArray.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+
+namespace Implab.ServiceHost.Unity
+{
+    public interface IArrayInjectionParameter {
+
+        string TypeName { get; }
+
+        IEnumerable<IInjectionParameter> Items { get; }
+         
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Implab.ServiceHost/Unity/IInjectionParameter.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -0,0 +1,5 @@
+namespace Implab.ServiceHost.Unity {
+    public interface IInjectionParameter {
+        void Visit(InjectionValueBuilder builder);
+    }
+}
\ No newline at end of file
--- a/Implab.ServiceHost/Unity/ITextValue.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/ITextValue.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -1,5 +1,6 @@
 namespace Implab.ServiceHost.Unity {
     public interface ITextValue {
+
         string TypeName { get; }
 
         string Value { get; }
--- a/Implab.ServiceHost/Unity/InjectionParameterElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/InjectionParameterElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -2,11 +2,11 @@
 using System.Xml.Serialization;
 
 namespace Implab.ServiceHost.Unity {
-    public abstract class InjectionParameterElement {
+    public abstract class InjectionParameterElement : IInjectionParameter {
         
         [XmlAttribute("type")]
         public string TypeName { get; set; }
 
-        internal abstract void Visit(InjectionValueBuilder builder);
+        public abstract void Visit(InjectionValueBuilder builder);
     }
 }
\ No newline at end of file
--- a/Implab.ServiceHost/Unity/SerializedElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/SerializedElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -21,6 +21,8 @@
             }
         }
 
+        public string TypeName => throw new NotImplementedException();
+
         public override void Visit(ContainerBuilder context) {
             context.Visit(this);
         }
@@ -33,5 +35,9 @@
 
             throw new Exception("No content found, expected XML document");
         }
+
+        public void Visit(InjectionValueBuilder builder) {
+            throw new NotImplementedException();
+        }
     }
 }
\ No newline at end of file
--- a/Implab.ServiceHost/Unity/SerializedParameterElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/SerializedParameterElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -21,7 +21,7 @@
             throw new Exception("No content found, expected XML document");
         }
 
-        internal override void Visit(InjectionValueBuilder builder) {
+        public override void Visit(InjectionValueBuilder builder) {
             builder.Visit(this);
         }
     }
--- a/Implab.ServiceHost/Unity/ValueParameterElement.cs	Fri Apr 27 04:47:52 2018 +0300
+++ b/Implab.ServiceHost/Unity/ValueParameterElement.cs	Fri Apr 27 16:57:30 2018 +0300
@@ -6,7 +6,7 @@
         [XmlAttribute("value")]
         public string Value { get; set; }
 
-        internal override void Visit(InjectionValueBuilder builder) {
+        public override void Visit(InjectionValueBuilder builder) {
             builder.Visit(this);
         }
     }