# HG changeset patch # User cin # Date 2018-04-27 13:57:30 # Node ID 6fefd5811b9bf5c516add62af45628efc0cedbcb # Parent 22629bf26121d959c790ef41a541f21a48c76ed7 refactoring diff --git a/Implab.ServiceHost/Unity/DefaultParameterElement.cs b/Implab.ServiceHost/Unity/DefaultParameterElement.cs --- a/Implab.ServiceHost/Unity/DefaultParameterElement.cs +++ b/Implab.ServiceHost/Unity/DefaultParameterElement.cs @@ -5,7 +5,7 @@ namespace Implab.ServiceHost.Unity get { return null; } } - internal override void Visit(InjectionValueBuilder builder) { + public override void Visit(InjectionValueBuilder builder) { builder.Visit(this); } } diff --git a/Implab.ServiceHost/Unity/DependencyParameterElement.cs b/Implab.ServiceHost/Unity/DependencyParameterElement.cs --- a/Implab.ServiceHost/Unity/DependencyParameterElement.cs +++ b/Implab.ServiceHost/Unity/DependencyParameterElement.cs @@ -9,7 +9,7 @@ namespace Implab.ServiceHost.Unity { [XmlAttribute("optional")] public bool Optional { get; set; } - internal override void Visit(InjectionValueBuilder builder) { + public override void Visit(InjectionValueBuilder builder) { builder.Visit(this); } } diff --git a/Implab.ServiceHost/Unity/IDependencyReference.cs b/Implab.ServiceHost/Unity/IDependencyReference.cs --- a/Implab.ServiceHost/Unity/IDependencyReference.cs +++ b/Implab.ServiceHost/Unity/IDependencyReference.cs @@ -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 diff --git a/Implab.ServiceHost/Unity/IInjectionArray.cs b/Implab.ServiceHost/Unity/IInjectionArray.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost/Unity/IInjectionArray.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace Implab.ServiceHost.Unity +{ + public interface IArrayInjectionParameter { + + string TypeName { get; } + + IEnumerable Items { get; } + + } +} \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/IInjectionParameter.cs b/Implab.ServiceHost/Unity/IInjectionParameter.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost/Unity/IInjectionParameter.cs @@ -0,0 +1,5 @@ +namespace Implab.ServiceHost.Unity { + public interface IInjectionParameter { + void Visit(InjectionValueBuilder builder); + } +} \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/ITextValue.cs b/Implab.ServiceHost/Unity/ITextValue.cs --- a/Implab.ServiceHost/Unity/ITextValue.cs +++ b/Implab.ServiceHost/Unity/ITextValue.cs @@ -1,5 +1,6 @@ namespace Implab.ServiceHost.Unity { public interface ITextValue { + string TypeName { get; } string Value { get; } diff --git a/Implab.ServiceHost/Unity/InjectionParameterElement.cs b/Implab.ServiceHost/Unity/InjectionParameterElement.cs --- a/Implab.ServiceHost/Unity/InjectionParameterElement.cs +++ b/Implab.ServiceHost/Unity/InjectionParameterElement.cs @@ -2,11 +2,11 @@ using System; 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 diff --git a/Implab.ServiceHost/Unity/SerializedElement.cs b/Implab.ServiceHost/Unity/SerializedElement.cs --- a/Implab.ServiceHost/Unity/SerializedElement.cs +++ b/Implab.ServiceHost/Unity/SerializedElement.cs @@ -21,6 +21,8 @@ namespace Implab.ServiceHost.Unity } } + public string TypeName => throw new NotImplementedException(); + public override void Visit(ContainerBuilder context) { context.Visit(this); } @@ -33,5 +35,9 @@ namespace Implab.ServiceHost.Unity throw new Exception("No content found, expected XML document"); } + + public void Visit(InjectionValueBuilder builder) { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/SerializedParameterElement.cs b/Implab.ServiceHost/Unity/SerializedParameterElement.cs --- a/Implab.ServiceHost/Unity/SerializedParameterElement.cs +++ b/Implab.ServiceHost/Unity/SerializedParameterElement.cs @@ -21,7 +21,7 @@ namespace Implab.ServiceHost.Unity throw new Exception("No content found, expected XML document"); } - internal override void Visit(InjectionValueBuilder builder) { + public override void Visit(InjectionValueBuilder builder) { builder.Visit(this); } } diff --git a/Implab.ServiceHost/Unity/ValueParameterElement.cs b/Implab.ServiceHost/Unity/ValueParameterElement.cs --- a/Implab.ServiceHost/Unity/ValueParameterElement.cs +++ b/Implab.ServiceHost/Unity/ValueParameterElement.cs @@ -6,7 +6,7 @@ namespace Implab.ServiceHost.Unity { [XmlAttribute("value")] public string Value { get; set; } - internal override void Visit(InjectionValueBuilder builder) { + public override void Visit(InjectionValueBuilder builder) { builder.Visit(this); } }