# HG changeset patch # User cin # Date 2018-06-17 18:46:53 # Node ID 95896f882995c74202bded87392585d287b16e82 # Parent 90cef6117ced6f5da9b1760a913f3436f015fdd5 Added tests for Implab.ServiceHost.Unity configuration loader. diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -25,3 +25,5 @@ Implab.Playground/obj/ Implab.Playground/bin/ Implab.ServiceHost/bin/ Implab.ServiceHost/obj/ +Implab.ServiceHost.Test/bin/ +Implab.ServiceHost.Test/obj/ diff --git a/Implab.ServiceHost.Test/Implab.ServiceHost.Test.csproj b/Implab.ServiceHost.Test/Implab.ServiceHost.Test.csproj new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/Implab.ServiceHost.Test.csproj @@ -0,0 +1,29 @@ + + + netcoreapp2.0;net46 + /usr/lib/mono/4.5/ + + + + netcoreapp2.0;net46 + + + + false + + + + + + + + + + + + + + + + + diff --git a/Implab.ServiceHost.Test/data/container/basic.xml b/Implab.ServiceHost.Test/data/container/basic.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/basic.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + I'm default! + + + + + + + GOOD + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Baaar + + + + !]]> + + + + + name @#$%^&]]> + + + false + + + + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/data/container/empty.xml b/Implab.ServiceHost.Test/data/container/empty.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/empty.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/data/container/generic.services.xml b/Implab.ServiceHost.Test/data/container/generic.services.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/generic.services.xml @@ -0,0 +1,65 @@ + + + + + + + + + + 5 + + + + + 3 + + + + + 1 + + + + + 2 + + + + + + + + + + + + + + + + + boxForString + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/data/container/p2.xml b/Implab.ServiceHost.Test/data/container/p2.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/p2.xml @@ -0,0 +1,6 @@ + + + Trohn + Javolta + 88 + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/data/container/serialized.instances.xml b/Implab.ServiceHost.Test/data/container/serialized.instances.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/serialized.instances.xml @@ -0,0 +1,16 @@ + + + + + + + + + + Com + Truise + 99 + + + + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/data/container/simple.services.xml b/Implab.ServiceHost.Test/data/container/simple.services.xml new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/data/container/simple.services.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + 1 + 2 + 3 + + + + + + + + + + + + + + + + + + + 5 + + + + + 3 + + + + + 1 + + + + + 2 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/Baz.cs b/Implab.ServiceHost.Test/src/Mock/Baz.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/Baz.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Implab.ServiceHost.Test.Mock { + public class Baz { + + public Guid Id { + get; set; + } + + public int[] Numbers { + get; set; + } + + public Nut[] Nuts { + get; set; + } + + public class Nut { + public int Size { get; set; } + } + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/BazFactory.cs b/Implab.ServiceHost.Test/src/Mock/BazFactory.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/BazFactory.cs @@ -0,0 +1,17 @@ +using System; +using Implab.Components; + +namespace Implab.ServiceHost.Test.Mock { + public class BazFactory : IFactory { + + public Func IdGenerator { + get; set; + } + + Baz IFactory.Create() { + return new Baz { + Id = IdGenerator?.Invoke() ?? Guid.Empty + }; + } + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/BoxFactory`1.cs b/Implab.ServiceHost.Test/src/Mock/BoxFactory`1.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/BoxFactory`1.cs @@ -0,0 +1,13 @@ +using System; +using Implab.Components; + +namespace Implab.ServiceHost.Test.Mock { + public class BoxFactory : IFactory> { + public IBox Create() { + return new Box { + Name = "Creepy sugar" + }; + } + } + +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/Box`1.cs b/Implab.ServiceHost.Test/src/Mock/Box`1.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/Box`1.cs @@ -0,0 +1,13 @@ +namespace Implab.ServiceHost.Test.Mock { + public class Box : IBox { + + public string Name { get; set; } + + public T Value { get; set; } + + public T GetBoxValue() { + return Value; + } + + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/GuidFactory.cs b/Implab.ServiceHost.Test/src/Mock/GuidFactory.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/GuidFactory.cs @@ -0,0 +1,10 @@ +using System; +using Implab.Components; + +namespace Implab.ServiceHost.Test.Mock { + public class GuidFactory : IFactory { + public Guid Create() { + return Guid.NewGuid(); + } + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/IBox.cs b/Implab.ServiceHost.Test/src/Mock/IBox.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/IBox.cs @@ -0,0 +1,6 @@ +namespace Implab.ServiceHost.Test.Mock { + public interface IBox { + string Name { get; } + T GetBoxValue(); + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/Person.cs b/Implab.ServiceHost.Test/src/Mock/Person.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/Person.cs @@ -0,0 +1,20 @@ +using System.Xml.Serialization; + +namespace Implab.ServiceHost.Test.Mock +{ + [XmlRoot(Namespace="urn:implab:test:model")] + public class Person { + public string FirstName { get; set; } + + public string LastName { get; set; } + + public int Age { get; set; } + + [XmlIgnore] + public bool AgeSpecified { get; set; } + + + [XmlElement("Tag")] + public string[] Tags { get; set; } + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/Mock/SetOfBoxes`1.cs b/Implab.ServiceHost.Test/src/Mock/SetOfBoxes`1.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/Mock/SetOfBoxes`1.cs @@ -0,0 +1,21 @@ +using System; +using System.Linq; + +namespace Implab.ServiceHost.Test.Mock { + public class SetOfBoxes { + + public Guid Uuid { get; set; } + + public IBox[] Boxes { + get; set; + } + + public void BoxValues(T[] items) { + if (items == null || items.Length == 0) + return; + + Boxes = items.Select(x => new Box {Value = x}).ToArray(); + } + + } +} \ No newline at end of file diff --git a/Implab.ServiceHost.Test/src/UnityConfigTest.cs b/Implab.ServiceHost.Test/src/UnityConfigTest.cs new file mode 100644 --- /dev/null +++ b/Implab.ServiceHost.Test/src/UnityConfigTest.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Implab.Components; +using Implab.Diagnostics; +using Implab.ServiceHost.Test.Mock; +using Implab.ServiceHost.Unity; +using Unity; +using Xunit; + +namespace Implab.Test { + + public class UnityConfigTest { + + [Fact] + public void CreateContainer() { + var container = new UnityContainer(); + + container.LoadXmlConfiguration(Path.Combine("data","container","empty.xml")); + } + + [Fact] + public void SimpleServicesContainer() { + var container = new UnityContainer(); + + container.LoadXmlConfiguration(Path.Combine("data","container","simple.services.xml")); + + // named service registration + var baz1 = container.Resolve("Baz1"); + + Assert.Equal(new [] {1,2,3}, baz1.Numbers); + + // default service registration + var baz = container.Resolve(); + + Assert.Equal(new [] {2,5,5,1,3}, baz.Nuts.Select(x => x.Size)); + + // ServiceFactory registered without a name + // explicitly provides 'Baz2' service + var baz2 = container.Resolve("Baz2"); + + // ServiceFactory registered with name 'Baz3' + // provides by default the service registration with same name + var baz3 = container.Resolve("Baz3"); + + // This factory uses GuidGenerator registration + // to generate a new id value + Assert.NotEqual(Guid.Empty, baz3.Id); + } + + [Fact] + public void GenericServicesContainer() { + var container = new UnityContainer(); + container.LoadXmlConfiguration(Path.Combine("data","container","generic.services.xml")); + + // resolve using a generig interface mapping + var box = container.Resolve>(); + + Assert.NotNull(box.GetBoxValue()); + + // registered generic defines dependency of type {T} + // in this case it should resolve to the default Nut with Size=2 + Assert.Equal(box.GetBoxValue().Size,2); + + // generic factory which provides generic services + var box2 = container.Resolve>(); + + var set1 = container.Resolve>(); + + Assert.Equal(new int?[] {null,2,1}, set1.Boxes?.Select(x => x.GetBoxValue()?.Size)); + } + + [Fact] + public void SerializedInstances() { + var container = new UnityContainer(); + container.LoadXmlConfiguration(Path.Combine("data","container","serialized.instances.xml")); + + var p1 = container.Resolve("p1"); + var p2 = container.Resolve("p2"); + + Assert.Equal("Com", p1.FirstName); + Assert.True(p1.AgeSpecified); + Assert.Equal(99, p1.Age); + + Assert.Equal("Javolta", p2.LastName); + Assert.True(p2.AgeSpecified); + Assert.Equal(88, p2.Age); + } + + } +} \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/AbstractContainerItem.cs b/Implab.ServiceHost/src/Unity/AbstractContainerItem.cs rename from Implab.ServiceHost/Unity/AbstractContainerItem.cs rename to Implab.ServiceHost/src/Unity/AbstractContainerItem.cs diff --git a/Implab.ServiceHost/Unity/AbstractInjectionParameter.cs b/Implab.ServiceHost/src/Unity/AbstractInjectionParameter.cs rename from Implab.ServiceHost/Unity/AbstractInjectionParameter.cs rename to Implab.ServiceHost/src/Unity/AbstractInjectionParameter.cs diff --git a/Implab.ServiceHost/Unity/AbstractMemberInjection.cs b/Implab.ServiceHost/src/Unity/AbstractMemberInjection.cs rename from Implab.ServiceHost/Unity/AbstractMemberInjection.cs rename to Implab.ServiceHost/src/Unity/AbstractMemberInjection.cs diff --git a/Implab.ServiceHost/Unity/AbstractRegistration.cs b/Implab.ServiceHost/src/Unity/AbstractRegistration.cs rename from Implab.ServiceHost/Unity/AbstractRegistration.cs rename to Implab.ServiceHost/src/Unity/AbstractRegistration.cs diff --git a/Implab.ServiceHost/Unity/ArrayParameterElement.cs b/Implab.ServiceHost/src/Unity/ArrayParameterElement.cs rename from Implab.ServiceHost/Unity/ArrayParameterElement.cs rename to Implab.ServiceHost/src/Unity/ArrayParameterElement.cs diff --git a/Implab.ServiceHost/Unity/ArrayTypeReference.cs b/Implab.ServiceHost/src/Unity/ArrayTypeReference.cs rename from Implab.ServiceHost/Unity/ArrayTypeReference.cs rename to Implab.ServiceHost/src/Unity/ArrayTypeReference.cs diff --git a/Implab.ServiceHost/Unity/AssemblyElement.cs b/Implab.ServiceHost/src/Unity/AssemblyElement.cs rename from Implab.ServiceHost/Unity/AssemblyElement.cs rename to Implab.ServiceHost/src/Unity/AssemblyElement.cs diff --git a/Implab.ServiceHost/Unity/ConstructorInjectionElement.cs b/Implab.ServiceHost/src/Unity/ConstructorInjectionElement.cs rename from Implab.ServiceHost/Unity/ConstructorInjectionElement.cs rename to Implab.ServiceHost/src/Unity/ConstructorInjectionElement.cs diff --git a/Implab.ServiceHost/Unity/ContainerBuilder.cs b/Implab.ServiceHost/src/Unity/ContainerBuilder.cs rename from Implab.ServiceHost/Unity/ContainerBuilder.cs rename to Implab.ServiceHost/src/Unity/ContainerBuilder.cs --- a/Implab.ServiceHost/Unity/ContainerBuilder.cs +++ b/Implab.ServiceHost/src/Unity/ContainerBuilder.cs @@ -50,7 +50,8 @@ namespace Implab.ServiceHost.Unity { var builder = new TypeRegistrationBuilder( m_resolver, registrationType, - implementationType + implementationType, + this ); builder.Lifetime = registration.GetLifetime(this); @@ -76,7 +77,8 @@ namespace Implab.ServiceHost.Unity { var builder = new InstanceRegistrationBuilder ( m_resolver, - registrationType + registrationType, + this ); builder.Lifetime = registration.GetLifetime(this); @@ -123,6 +125,15 @@ namespace Implab.ServiceHost.Unity { } /// + /// Resolves a path ralatively to the current container configuration location. + /// + /// A path yto resolve + /// Resolved Uri fot the specified location + public Uri MakeLocationUri(string location) { + return m_location != null ? new Uri(m_location, location) : new Uri(location); + } + + /// /// Loads a configuration from the specified local file. /// /// The path to the configuration file. diff --git a/Implab.ServiceHost/Unity/ContainerConfigurationSchema.cs b/Implab.ServiceHost/src/Unity/ContainerConfigurationSchema.cs rename from Implab.ServiceHost/Unity/ContainerConfigurationSchema.cs rename to Implab.ServiceHost/src/Unity/ContainerConfigurationSchema.cs diff --git a/Implab.ServiceHost/Unity/ContainerElement.cs b/Implab.ServiceHost/src/Unity/ContainerElement.cs rename from Implab.ServiceHost/Unity/ContainerElement.cs rename to Implab.ServiceHost/src/Unity/ContainerElement.cs diff --git a/Implab.ServiceHost/Unity/ContainerLifetimeElement.cs b/Implab.ServiceHost/src/Unity/ContainerLifetimeElement.cs rename from Implab.ServiceHost/Unity/ContainerLifetimeElement.cs rename to Implab.ServiceHost/src/Unity/ContainerLifetimeElement.cs diff --git a/Implab.ServiceHost/Unity/ContextLifetimeElement.cs b/Implab.ServiceHost/src/Unity/ContextLifetimeElement.cs rename from Implab.ServiceHost/Unity/ContextLifetimeElement.cs rename to Implab.ServiceHost/src/Unity/ContextLifetimeElement.cs diff --git a/Implab.ServiceHost/Unity/DefaultParameterElement.cs b/Implab.ServiceHost/src/Unity/DefaultParameterElement.cs rename from Implab.ServiceHost/Unity/DefaultParameterElement.cs rename to Implab.ServiceHost/src/Unity/DefaultParameterElement.cs diff --git a/Implab.ServiceHost/Unity/DependencyParameterElement.cs b/Implab.ServiceHost/src/Unity/DependencyParameterElement.cs rename from Implab.ServiceHost/Unity/DependencyParameterElement.cs rename to Implab.ServiceHost/src/Unity/DependencyParameterElement.cs diff --git a/Implab.ServiceHost/Unity/FactoryActivator.cs b/Implab.ServiceHost/src/Unity/FactoryActivator.cs rename from Implab.ServiceHost/Unity/FactoryActivator.cs rename to Implab.ServiceHost/src/Unity/FactoryActivator.cs --- a/Implab.ServiceHost/Unity/FactoryActivator.cs +++ b/Implab.ServiceHost/src/Unity/FactoryActivator.cs @@ -27,12 +27,23 @@ namespace Implab.ServiceHost.Unity { public IEnumerable MemberInjections { get { - yield return new FactoryInjector { - Factory = (InjectionFactory)GetType() - .GetMethod(nameof(CreateInjectionFactory), BindingFlags.Static | BindingFlags.NonPublic) - .MakeGenericMethod(FactoryType, RegistrationType) - .Invoke(null, new [] { FactoryName }) - }; + if (RegistrationType == null) + throw new Exception($"RegistrationType must be specified"); + if (!typeof(IFactory<>).MakeGenericType(RegistrationType).IsAssignableFrom(FactoryType)) + throw new Exception($"The factory {FactoryType} can't be used to create {RegistrationType} instances"); + + if (FactoryType.ContainsGenericParameters) { + yield return new FactoryInjector { + Factory = CreateDynamicInjectionFactory(FactoryName) + }; + } else { + yield return new FactoryInjector { + Factory = (InjectionFactory)GetType() + .GetMethod(nameof(CreateInjectionFactory), BindingFlags.Static | BindingFlags.NonPublic) + .MakeGenericMethod(FactoryType, RegistrationType) + .Invoke(null, new [] { FactoryName }) + }; + } } } @@ -59,5 +70,9 @@ namespace Implab.ServiceHost.Unity { return new InjectionFactory(c => c.Resolve(dependencyName).Create()); } + + static InjectionFactory CreateDynamicInjectionFactory(string dependencyName) { + return new InjectionFactory((c,t,name) => ((IFactory)c.Resolve(t, dependencyName)).Create()); + } } } \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/FactoryElement.cs b/Implab.ServiceHost/src/Unity/FactoryElement.cs rename from Implab.ServiceHost/Unity/FactoryElement.cs rename to Implab.ServiceHost/src/Unity/FactoryElement.cs --- a/Implab.ServiceHost/Unity/FactoryElement.cs +++ b/Implab.ServiceHost/src/Unity/FactoryElement.cs @@ -37,7 +37,7 @@ namespace Implab.ServiceHost.Unity { RegistrationType = builder.ResolveType(item.RegistrationType), FactoryName = Name, FactoryType = factoryType, - Lifetime = item.Lifetime.GetLifetime(builder) + Lifetime = item.Lifetime?.GetLifetime(builder) }; builder.Visit(activator); } diff --git a/Implab.ServiceHost/Unity/HierarchicalLifetimeElement.cs b/Implab.ServiceHost/src/Unity/HierarchicalLifetimeElement.cs rename from Implab.ServiceHost/Unity/HierarchicalLifetimeElement.cs rename to Implab.ServiceHost/src/Unity/HierarchicalLifetimeElement.cs diff --git a/Implab.ServiceHost/Unity/IInjectionParameter.cs b/Implab.ServiceHost/src/Unity/IInjectionParameter.cs rename from Implab.ServiceHost/Unity/IInjectionParameter.cs rename to Implab.ServiceHost/src/Unity/IInjectionParameter.cs diff --git a/Implab.ServiceHost/Unity/IInstanceRegistration.cs b/Implab.ServiceHost/src/Unity/IInstanceRegistration.cs rename from Implab.ServiceHost/Unity/IInstanceRegistration.cs rename to Implab.ServiceHost/src/Unity/IInstanceRegistration.cs diff --git a/Implab.ServiceHost/Unity/IRegistration.cs b/Implab.ServiceHost/src/Unity/IRegistration.cs rename from Implab.ServiceHost/Unity/IRegistration.cs rename to Implab.ServiceHost/src/Unity/IRegistration.cs diff --git a/Implab.ServiceHost/Unity/ITypeMemberInjection.cs b/Implab.ServiceHost/src/Unity/ITypeMemberInjection.cs rename from Implab.ServiceHost/Unity/ITypeMemberInjection.cs rename to Implab.ServiceHost/src/Unity/ITypeMemberInjection.cs diff --git a/Implab.ServiceHost/Unity/ITypeRegistration.cs b/Implab.ServiceHost/src/Unity/ITypeRegistration.cs rename from Implab.ServiceHost/Unity/ITypeRegistration.cs rename to Implab.ServiceHost/src/Unity/ITypeRegistration.cs diff --git a/Implab.ServiceHost/Unity/IncludeElement.cs b/Implab.ServiceHost/src/Unity/IncludeElement.cs rename from Implab.ServiceHost/Unity/IncludeElement.cs rename to Implab.ServiceHost/src/Unity/IncludeElement.cs diff --git a/Implab.ServiceHost/Unity/InjectionValueBuilder.cs b/Implab.ServiceHost/src/Unity/InjectionValueBuilder.cs rename from Implab.ServiceHost/Unity/InjectionValueBuilder.cs rename to Implab.ServiceHost/src/Unity/InjectionValueBuilder.cs --- a/Implab.ServiceHost/Unity/InjectionValueBuilder.cs +++ b/Implab.ServiceHost/src/Unity/InjectionValueBuilder.cs @@ -16,6 +16,8 @@ namespace Implab.ServiceHost.Unity { public Type ValueType { get; private set; } + public ContainerBuilder Root { get; private set; } + object m_value; public object Value { @@ -42,9 +44,10 @@ namespace Implab.ServiceHost.Unity { get { return m_injection != null; } } - internal InjectionParameterBuilder(TypeResolver resolver, Type defaultType) { + internal InjectionParameterBuilder(TypeResolver resolver, Type defaultType, ContainerBuilder root) { m_resolver = resolver; DefaultType = defaultType; + Root = root; } public Type ResolveInjectedValueType(string typeSpec) { @@ -77,7 +80,11 @@ namespace Implab.ServiceHost.Unity { ValueSpecified = false; m_value = null; - m_injection = optional ? (InjectionParameterValue)new OptionalParameter(type, name) : new ResolvedParameter(type, name); + m_injection = optional ? + type.IsGenericParameter ? + new OptionalGenericParameter(type.Name, name) + : (InjectionParameterValue)new OptionalParameter(type, name) + : new ResolvedParameter(type, name); } internal void Visit(ArrayParameterElement arrayParameter) { @@ -100,21 +107,19 @@ namespace Implab.ServiceHost.Unity { InjectionParameterValue[] injections = (arrayParameter.Items ?? new AbstractInjectionParameter[0]) .Select(x => { - var builder = new InjectionParameterBuilder(m_resolver, itemsType); + var builder = new InjectionParameterBuilder(m_resolver, itemsType, Root); x.Visit(builder); return builder.Injection; }) .ToArray(); - var array = itemsType.IsGenericParameter ? + m_injection = itemsType.IsGenericParameter ? (InjectionParameterValue)new GenericResolvedArrayParameter(itemsType.Name, injections) : new ResolvedArrayParameter(itemsType, injections); ValueType = arrayType; m_value = null; ValueSpecified = false; - - m_injection = array; } Type GetItemsType(Type collectionType) { @@ -123,7 +128,7 @@ namespace Implab.ServiceHost.Unity { Type itemsType = null; - if (collectionType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { + if (collectionType.IsGenericType && collectionType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { itemsType = collectionType.GetGenericArguments()[0]; } else if (collectionType == typeof(IEnumerable)) { itemsType = typeof(object); diff --git a/Implab.ServiceHost/Unity/InstanceRegistrationBuilder.cs b/Implab.ServiceHost/src/Unity/InstanceRegistrationBuilder.cs rename from Implab.ServiceHost/Unity/InstanceRegistrationBuilder.cs rename to Implab.ServiceHost/src/Unity/InstanceRegistrationBuilder.cs --- a/Implab.ServiceHost/Unity/InstanceRegistrationBuilder.cs +++ b/Implab.ServiceHost/src/Unity/InstanceRegistrationBuilder.cs @@ -6,8 +6,8 @@ namespace Implab.ServiceHost.Unity public InjectionParameterBuilder ValueBuilder { get; private set; } - internal InstanceRegistrationBuilder(TypeResolver typeResolver, Type registrationType) : base(registrationType) { - ValueBuilder = new InjectionParameterBuilder(typeResolver, registrationType); + internal InstanceRegistrationBuilder(TypeResolver typeResolver, Type registrationType, ContainerBuilder root) : base(registrationType, root) { + ValueBuilder = new InjectionParameterBuilder(typeResolver, registrationType, root); } } } \ No newline at end of file diff --git a/Implab.ServiceHost/Unity/LifetimeElement.cs b/Implab.ServiceHost/src/Unity/LifetimeElement.cs rename from Implab.ServiceHost/Unity/LifetimeElement.cs rename to Implab.ServiceHost/src/Unity/LifetimeElement.cs diff --git a/Implab.ServiceHost/Unity/MethodInjectionElement.cs b/Implab.ServiceHost/src/Unity/MethodInjectionElement.cs rename from Implab.ServiceHost/Unity/MethodInjectionElement.cs rename to Implab.ServiceHost/src/Unity/MethodInjectionElement.cs diff --git a/Implab.ServiceHost/Unity/NamespaceElement.cs b/Implab.ServiceHost/src/Unity/NamespaceElement.cs rename from Implab.ServiceHost/Unity/NamespaceElement.cs rename to Implab.ServiceHost/src/Unity/NamespaceElement.cs diff --git a/Implab.ServiceHost/Unity/NestedTypeReference.cs b/Implab.ServiceHost/src/Unity/NestedTypeReference.cs rename from Implab.ServiceHost/Unity/NestedTypeReference.cs rename to Implab.ServiceHost/src/Unity/NestedTypeReference.cs diff --git a/Implab.ServiceHost/Unity/PropertyInjectionElement.cs b/Implab.ServiceHost/src/Unity/PropertyInjectionElement.cs rename from Implab.ServiceHost/Unity/PropertyInjectionElement.cs rename to Implab.ServiceHost/src/Unity/PropertyInjectionElement.cs diff --git a/Implab.ServiceHost/Unity/ProvidesElement.cs b/Implab.ServiceHost/src/Unity/ProvidesElement.cs rename from Implab.ServiceHost/Unity/ProvidesElement.cs rename to Implab.ServiceHost/src/Unity/ProvidesElement.cs diff --git a/Implab.ServiceHost/Unity/RegisterElement.cs b/Implab.ServiceHost/src/Unity/RegisterElement.cs rename from Implab.ServiceHost/Unity/RegisterElement.cs rename to Implab.ServiceHost/src/Unity/RegisterElement.cs diff --git a/Implab.ServiceHost/Unity/RegistrationBuilder.cs b/Implab.ServiceHost/src/Unity/RegistrationBuilder.cs rename from Implab.ServiceHost/Unity/RegistrationBuilder.cs rename to Implab.ServiceHost/src/Unity/RegistrationBuilder.cs --- a/Implab.ServiceHost/Unity/RegistrationBuilder.cs +++ b/Implab.ServiceHost/src/Unity/RegistrationBuilder.cs @@ -13,6 +13,10 @@ namespace Implab.ServiceHost.Unity { /// Базовый класс для формирования записей в контейнере, созволяет указать время жизни для записи /// public abstract class RegistrationBuilder { + public ContainerBuilder Root { + get; private set; + } + public Type RegistrationType { get; private set; @@ -20,7 +24,8 @@ namespace Implab.ServiceHost.Unity { internal LifetimeManager Lifetime { get; set; } - protected RegistrationBuilder(Type registrationType) { + protected RegistrationBuilder(Type registrationType, ContainerBuilder root) { + Root = root; RegistrationType = registrationType; } } diff --git a/Implab.ServiceHost/Unity/RootTypeReference.cs b/Implab.ServiceHost/src/Unity/RootTypeReference.cs rename from Implab.ServiceHost/Unity/RootTypeReference.cs rename to Implab.ServiceHost/src/Unity/RootTypeReference.cs diff --git a/Implab.ServiceHost/Unity/Schema.cs b/Implab.ServiceHost/src/Unity/Schema.cs rename from Implab.ServiceHost/Unity/Schema.cs rename to Implab.ServiceHost/src/Unity/Schema.cs diff --git a/Implab.ServiceHost/Unity/SerializedElement.cs b/Implab.ServiceHost/src/Unity/SerializedElement.cs rename from Implab.ServiceHost/Unity/SerializedElement.cs rename to Implab.ServiceHost/src/Unity/SerializedElement.cs diff --git a/Implab.ServiceHost/Unity/SerializedParameterElement.cs b/Implab.ServiceHost/src/Unity/SerializedParameterElement.cs rename from Implab.ServiceHost/Unity/SerializedParameterElement.cs rename to Implab.ServiceHost/src/Unity/SerializedParameterElement.cs --- a/Implab.ServiceHost/Unity/SerializedParameterElement.cs +++ b/Implab.ServiceHost/src/Unity/SerializedParameterElement.cs @@ -12,9 +12,9 @@ namespace Implab.ServiceHost.Unity [XmlAnyElement] public XmlElement[] Content { get; set; } - public XmlReader GetReader() { + public XmlReader GetReader(InjectionParameterBuilder builder) { if (!string.IsNullOrEmpty(Location)) - return XmlReader.Create(Location); + return XmlReader.Create(builder.Root.MakeLocationUri(Location).ToString()); if (Content != null && Content.Length > 0) return Content[0].CreateNavigator().ReadSubtree(); @@ -25,7 +25,7 @@ namespace Implab.ServiceHost.Unity var type = builder.ResolveInjectedValueType(TypeName); var serializer = new XmlSerializer(type); - using(var reader = GetReader()) + using(var reader = GetReader(builder)) builder.SetValue(type, serializer.Deserialize(reader)); } diff --git a/Implab.ServiceHost/Unity/SingletonLifetimeElement.cs b/Implab.ServiceHost/src/Unity/SingletonLifetimeElement.cs rename from Implab.ServiceHost/Unity/SingletonLifetimeElement.cs rename to Implab.ServiceHost/src/Unity/SingletonLifetimeElement.cs diff --git a/Implab.ServiceHost/Unity/SpecializedTypeReference.cs b/Implab.ServiceHost/src/Unity/SpecializedTypeReference.cs rename from Implab.ServiceHost/Unity/SpecializedTypeReference.cs rename to Implab.ServiceHost/src/Unity/SpecializedTypeReference.cs diff --git a/Implab.ServiceHost/Unity/TypeReference.cs b/Implab.ServiceHost/src/Unity/TypeReference.cs rename from Implab.ServiceHost/Unity/TypeReference.cs rename to Implab.ServiceHost/src/Unity/TypeReference.cs diff --git a/Implab.ServiceHost/Unity/TypeReferenceParser.cs b/Implab.ServiceHost/src/Unity/TypeReferenceParser.cs rename from Implab.ServiceHost/Unity/TypeReferenceParser.cs rename to Implab.ServiceHost/src/Unity/TypeReferenceParser.cs diff --git a/Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs b/Implab.ServiceHost/src/Unity/TypeRegistrationBuilder.cs rename from Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs rename to Implab.ServiceHost/src/Unity/TypeRegistrationBuilder.cs --- a/Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs +++ b/Implab.ServiceHost/src/Unity/TypeRegistrationBuilder.cs @@ -18,7 +18,7 @@ namespace Implab.ServiceHost.Unity { private set; } - internal TypeRegistrationBuilder(TypeResolver resolver, Type registrationType, Type implementationType) : base(registrationType) { + internal TypeRegistrationBuilder(TypeResolver resolver, Type registrationType, Type implementationType, ContainerBuilder root) : base(registrationType, root) { ImplementationType = implementationType; // when registering a generic mapping, register all generic parameter names as local types @@ -37,7 +37,7 @@ namespace Implab.ServiceHost.Unity { var parameters = constructorInjection.Parameters? .Select(x => { - var valueBuilder = new InjectionParameterBuilder(m_resolver, null); + var valueBuilder = new InjectionParameterBuilder(m_resolver, null, Root); x.Visit(valueBuilder); return valueBuilder.Injection; }) @@ -50,7 +50,7 @@ namespace Implab.ServiceHost.Unity { internal void Visit(MethodInjectionElement methodInjection) { var parameters = methodInjection.Parameters? .Select(x => { - var valueBuilder = new InjectionParameterBuilder(m_resolver, null); + var valueBuilder = new InjectionParameterBuilder(m_resolver, null, Root); x.Visit(valueBuilder); return valueBuilder.Injection; }) @@ -65,7 +65,7 @@ namespace Implab.ServiceHost.Unity { throw new Exception($"A value value must be specified for the property '{propertyInjection.Name}'"); var propertyType = ImplementationType.GetProperty(propertyInjection.Name)?.PropertyType; - var valueContext = new InjectionParameterBuilder(m_resolver, propertyType); + var valueContext = new InjectionParameterBuilder(m_resolver, propertyType, Root); propertyInjection.Value.Visit(valueContext); var injection = new InjectionProperty(propertyInjection.Name, valueContext.Injection); diff --git a/Implab.ServiceHost/Unity/TypeResolutionContext.cs b/Implab.ServiceHost/src/Unity/TypeResolutionContext.cs rename from Implab.ServiceHost/Unity/TypeResolutionContext.cs rename to Implab.ServiceHost/src/Unity/TypeResolutionContext.cs diff --git a/Implab.ServiceHost/Unity/TypeResolver.cs b/Implab.ServiceHost/src/Unity/TypeResolver.cs rename from Implab.ServiceHost/Unity/TypeResolver.cs rename to Implab.ServiceHost/src/Unity/TypeResolver.cs diff --git a/Implab.ServiceHost/Unity/UnityContainerExtensions.cs b/Implab.ServiceHost/src/Unity/UnityContainerExtensions.cs rename from Implab.ServiceHost/Unity/UnityContainerExtensions.cs rename to Implab.ServiceHost/src/Unity/UnityContainerExtensions.cs diff --git a/Implab.ServiceHost/Unity/ValueElement.cs b/Implab.ServiceHost/src/Unity/ValueElement.cs rename from Implab.ServiceHost/Unity/ValueElement.cs rename to Implab.ServiceHost/src/Unity/ValueElement.cs diff --git a/Implab.ServiceHost/Unity/ValueParameterElement.cs b/Implab.ServiceHost/src/Unity/ValueParameterElement.cs rename from Implab.ServiceHost/Unity/ValueParameterElement.cs rename to Implab.ServiceHost/src/Unity/ValueParameterElement.cs diff --git a/Implab.Test/DiagnosticsTest.cs b/Implab.Test/src/DiagnosticsTest.cs rename from Implab.Test/DiagnosticsTest.cs rename to Implab.Test/src/DiagnosticsTest.cs diff --git a/Implab.Test/JsonTests.cs b/Implab.Test/src/JsonTests.cs rename from Implab.Test/JsonTests.cs rename to Implab.Test/src/JsonTests.cs diff --git a/Implab.Test/MockPollComponent.cs b/Implab.Test/src/MockPollComponent.cs rename from Implab.Test/MockPollComponent.cs rename to Implab.Test/src/MockPollComponent.cs diff --git a/Implab.Test/Model/Person.cs b/Implab.Test/src/Model/Person.cs rename from Implab.Test/Model/Person.cs rename to Implab.Test/src/Model/Person.cs diff --git a/Implab.Test/PromiseHelper.cs b/Implab.Test/src/PromiseHelper.cs rename from Implab.Test/PromiseHelper.cs rename to Implab.Test/src/PromiseHelper.cs diff --git a/Implab.Test/RunnableComponentTests.cs b/Implab.Test/src/RunnableComponentTests.cs rename from Implab.Test/RunnableComponentTests.cs rename to Implab.Test/src/RunnableComponentTests.cs diff --git a/Implab.sln b/Implab.sln --- a/Implab.sln +++ b/Implab.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.ServiceHost", "Implab.ServiceHost\Implab.ServiceHost.csproj", "{8B79FCBE-50DD-40A0-9B5E-E572072E4868}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.ServiceHost.Test", "Implab.ServiceHost.Test\Implab.ServiceHost.Test.csproj", "{CB844F94-E555-4F25-A932-7CB85C98CF86}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,18 @@ Global {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x64.Build.0 = Release|x64 {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x86.ActiveCfg = Release|x86 {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x86.Build.0 = Release|x86 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|x64.ActiveCfg = Debug|x64 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|x64.Build.0 = Debug|x64 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|x86.ActiveCfg = Debug|x86 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Debug|x86.Build.0 = Debug|x86 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|Any CPU.Build.0 = Release|Any CPU + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|x64.ActiveCfg = Release|x64 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|x64.Build.0 = Release|x64 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|x86.ActiveCfg = Release|x86 + {CB844F94-E555-4F25-A932-7CB85C98CF86}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Implab/Implab.csproj b/Implab/Implab.csproj --- a/Implab/Implab.csproj +++ b/Implab/Implab.csproj @@ -20,7 +20,7 @@ - + diff --git a/Implab/AbstractEvent.cs b/Implab/src/AbstractEvent.cs rename from Implab/AbstractEvent.cs rename to Implab/src/AbstractEvent.cs diff --git a/Implab/Automaton/AutomatonConst.cs b/Implab/src/Automaton/AutomatonConst.cs rename from Implab/Automaton/AutomatonConst.cs rename to Implab/src/Automaton/AutomatonConst.cs diff --git a/Implab/Automaton/AutomatonTransition.cs b/Implab/src/Automaton/AutomatonTransition.cs rename from Implab/Automaton/AutomatonTransition.cs rename to Implab/src/Automaton/AutomatonTransition.cs diff --git a/Implab/Automaton/DFATable.cs b/Implab/src/Automaton/DFATable.cs rename from Implab/Automaton/DFATable.cs rename to Implab/src/Automaton/DFATable.cs diff --git a/Implab/Automaton/IAlphabet.cs b/Implab/src/Automaton/IAlphabet.cs rename from Implab/Automaton/IAlphabet.cs rename to Implab/src/Automaton/IAlphabet.cs diff --git a/Implab/Automaton/IAlphabetBuilder.cs b/Implab/src/Automaton/IAlphabetBuilder.cs rename from Implab/Automaton/IAlphabetBuilder.cs rename to Implab/src/Automaton/IAlphabetBuilder.cs diff --git a/Implab/Automaton/IDFATable.cs b/Implab/src/Automaton/IDFATable.cs rename from Implab/Automaton/IDFATable.cs rename to Implab/src/Automaton/IDFATable.cs diff --git a/Implab/Automaton/IDFATableBuilder.cs b/Implab/src/Automaton/IDFATableBuilder.cs rename from Implab/Automaton/IDFATableBuilder.cs rename to Implab/src/Automaton/IDFATableBuilder.cs diff --git a/Implab/Automaton/IndexedAlphabetBase.cs b/Implab/src/Automaton/IndexedAlphabetBase.cs rename from Implab/Automaton/IndexedAlphabetBase.cs rename to Implab/src/Automaton/IndexedAlphabetBase.cs diff --git a/Implab/Automaton/MapAlphabet.cs b/Implab/src/Automaton/MapAlphabet.cs rename from Implab/Automaton/MapAlphabet.cs rename to Implab/src/Automaton/MapAlphabet.cs diff --git a/Implab/Automaton/ParserException.cs b/Implab/src/Automaton/ParserException.cs rename from Implab/Automaton/ParserException.cs rename to Implab/src/Automaton/ParserException.cs diff --git a/Implab/Automaton/RegularExpressions/AltToken.cs b/Implab/src/Automaton/RegularExpressions/AltToken.cs rename from Implab/Automaton/RegularExpressions/AltToken.cs rename to Implab/src/Automaton/RegularExpressions/AltToken.cs diff --git a/Implab/Automaton/RegularExpressions/BinaryToken.cs b/Implab/src/Automaton/RegularExpressions/BinaryToken.cs rename from Implab/Automaton/RegularExpressions/BinaryToken.cs rename to Implab/src/Automaton/RegularExpressions/BinaryToken.cs diff --git a/Implab/Automaton/RegularExpressions/CatToken.cs b/Implab/src/Automaton/RegularExpressions/CatToken.cs rename from Implab/Automaton/RegularExpressions/CatToken.cs rename to Implab/src/Automaton/RegularExpressions/CatToken.cs diff --git a/Implab/Automaton/RegularExpressions/EmptyToken.cs b/Implab/src/Automaton/RegularExpressions/EmptyToken.cs rename from Implab/Automaton/RegularExpressions/EmptyToken.cs rename to Implab/src/Automaton/RegularExpressions/EmptyToken.cs diff --git a/Implab/Automaton/RegularExpressions/EndToken.cs b/Implab/src/Automaton/RegularExpressions/EndToken.cs rename from Implab/Automaton/RegularExpressions/EndToken.cs rename to Implab/src/Automaton/RegularExpressions/EndToken.cs diff --git a/Implab/Automaton/RegularExpressions/EndTokenT.cs b/Implab/src/Automaton/RegularExpressions/EndTokenT.cs rename from Implab/Automaton/RegularExpressions/EndTokenT.cs rename to Implab/src/Automaton/RegularExpressions/EndTokenT.cs diff --git a/Implab/Automaton/RegularExpressions/ITaggedDFABuilder.cs b/Implab/src/Automaton/RegularExpressions/ITaggedDFABuilder.cs rename from Implab/Automaton/RegularExpressions/ITaggedDFABuilder.cs rename to Implab/src/Automaton/RegularExpressions/ITaggedDFABuilder.cs diff --git a/Implab/Automaton/RegularExpressions/IVisitor.cs b/Implab/src/Automaton/RegularExpressions/IVisitor.cs rename from Implab/Automaton/RegularExpressions/IVisitor.cs rename to Implab/src/Automaton/RegularExpressions/IVisitor.cs diff --git a/Implab/Automaton/RegularExpressions/RegularDFA.cs b/Implab/src/Automaton/RegularExpressions/RegularDFA.cs rename from Implab/Automaton/RegularExpressions/RegularDFA.cs rename to Implab/src/Automaton/RegularExpressions/RegularDFA.cs diff --git a/Implab/Automaton/RegularExpressions/RegularExpressionVisitor.cs b/Implab/src/Automaton/RegularExpressions/RegularExpressionVisitor.cs rename from Implab/Automaton/RegularExpressions/RegularExpressionVisitor.cs rename to Implab/src/Automaton/RegularExpressions/RegularExpressionVisitor.cs diff --git a/Implab/Automaton/RegularExpressions/RegularExpressionVisitorT.cs b/Implab/src/Automaton/RegularExpressions/RegularExpressionVisitorT.cs rename from Implab/Automaton/RegularExpressions/RegularExpressionVisitorT.cs rename to Implab/src/Automaton/RegularExpressions/RegularExpressionVisitorT.cs diff --git a/Implab/Automaton/RegularExpressions/StarToken.cs b/Implab/src/Automaton/RegularExpressions/StarToken.cs rename from Implab/Automaton/RegularExpressions/StarToken.cs rename to Implab/src/Automaton/RegularExpressions/StarToken.cs diff --git a/Implab/Automaton/RegularExpressions/SymbolToken.cs b/Implab/src/Automaton/RegularExpressions/SymbolToken.cs rename from Implab/Automaton/RegularExpressions/SymbolToken.cs rename to Implab/src/Automaton/RegularExpressions/SymbolToken.cs diff --git a/Implab/Automaton/RegularExpressions/Token.cs b/Implab/src/Automaton/RegularExpressions/Token.cs rename from Implab/Automaton/RegularExpressions/Token.cs rename to Implab/src/Automaton/RegularExpressions/Token.cs diff --git a/Implab/Components/Disposable.cs b/Implab/src/Components/Disposable.cs rename from Implab/Components/Disposable.cs rename to Implab/src/Components/Disposable.cs diff --git a/Implab/Components/DisposablePool.cs b/Implab/src/Components/DisposablePool.cs rename from Implab/Components/DisposablePool.cs rename to Implab/src/Components/DisposablePool.cs diff --git a/Implab/Components/ExecutionState.cs b/Implab/src/Components/ExecutionState.cs rename from Implab/Components/ExecutionState.cs rename to Implab/src/Components/ExecutionState.cs diff --git a/Implab/Components/IAsyncComponent.cs b/Implab/src/Components/IAsyncComponent.cs rename from Implab/Components/IAsyncComponent.cs rename to Implab/src/Components/IAsyncComponent.cs diff --git a/Implab/Components/IFactory.cs b/Implab/src/Components/IFactory.cs rename from Implab/Components/IFactory.cs rename to Implab/src/Components/IFactory.cs diff --git a/Implab/Components/IInitializable.cs b/Implab/src/Components/IInitializable.cs rename from Implab/Components/IInitializable.cs rename to Implab/src/Components/IInitializable.cs diff --git a/Implab/Components/IRunnable.cs b/Implab/src/Components/IRunnable.cs rename from Implab/Components/IRunnable.cs rename to Implab/src/Components/IRunnable.cs diff --git a/Implab/Components/IServiceLocator.cs b/Implab/src/Components/IServiceLocator.cs rename from Implab/Components/IServiceLocator.cs rename to Implab/src/Components/IServiceLocator.cs diff --git a/Implab/Components/LazyAndWeak.cs b/Implab/src/Components/LazyAndWeak.cs rename from Implab/Components/LazyAndWeak.cs rename to Implab/src/Components/LazyAndWeak.cs diff --git a/Implab/Components/ObjectPool.cs b/Implab/src/Components/ObjectPool.cs rename from Implab/Components/ObjectPool.cs rename to Implab/src/Components/ObjectPool.cs diff --git a/Implab/Components/PollingComponent.cs b/Implab/src/Components/PollingComponent.cs rename from Implab/Components/PollingComponent.cs rename to Implab/src/Components/PollingComponent.cs diff --git a/Implab/Components/RunnableComponent.cs b/Implab/src/Components/RunnableComponent.cs rename from Implab/Components/RunnableComponent.cs rename to Implab/src/Components/RunnableComponent.cs diff --git a/Implab/Components/ServiceLocator.cs b/Implab/src/Components/ServiceLocator.cs rename from Implab/Components/ServiceLocator.cs rename to Implab/src/Components/ServiceLocator.cs diff --git a/Implab/Components/StateChangeEventArgs.cs b/Implab/src/Components/StateChangeEventArgs.cs rename from Implab/Components/StateChangeEventArgs.cs rename to Implab/src/Components/StateChangeEventArgs.cs diff --git a/Implab/CustomEqualityComparer.cs b/Implab/src/CustomEqualityComparer.cs rename from Implab/CustomEqualityComparer.cs rename to Implab/src/CustomEqualityComparer.cs diff --git a/Implab/Deferred.cs b/Implab/src/Deferred.cs rename from Implab/Deferred.cs rename to Implab/src/Deferred.cs diff --git a/Implab/Deferred`1.cs b/Implab/src/Deferred`1.cs rename from Implab/Deferred`1.cs rename to Implab/src/Deferred`1.cs diff --git a/Implab/Diagnostics/ActivityScope.cs b/Implab/src/Diagnostics/ActivityScope.cs rename from Implab/Diagnostics/ActivityScope.cs rename to Implab/src/Diagnostics/ActivityScope.cs diff --git a/Implab/Diagnostics/LogicalOperation.cs b/Implab/src/Diagnostics/LogicalOperation.cs rename from Implab/Diagnostics/LogicalOperation.cs rename to Implab/src/Diagnostics/LogicalOperation.cs diff --git a/Implab/Diagnostics/LogicalOperationScope.cs b/Implab/src/Diagnostics/LogicalOperationScope.cs rename from Implab/Diagnostics/LogicalOperationScope.cs rename to Implab/src/Diagnostics/LogicalOperationScope.cs diff --git a/Implab/Diagnostics/SimpleTraceListener.cs b/Implab/src/Diagnostics/SimpleTraceListener.cs rename from Implab/Diagnostics/SimpleTraceListener.cs rename to Implab/src/Diagnostics/SimpleTraceListener.cs diff --git a/Implab/Diagnostics/Trace.cs b/Implab/src/Diagnostics/Trace.cs rename from Implab/Diagnostics/Trace.cs rename to Implab/src/Diagnostics/Trace.cs diff --git a/Implab/Diagnostics/TraceChannel.cs b/Implab/src/Diagnostics/TraceChannel.cs rename from Implab/Diagnostics/TraceChannel.cs rename to Implab/src/Diagnostics/TraceChannel.cs diff --git a/Implab/Diagnostics/TraceEventCodes.cs b/Implab/src/Diagnostics/TraceEventCodes.cs rename from Implab/Diagnostics/TraceEventCodes.cs rename to Implab/src/Diagnostics/TraceEventCodes.cs diff --git a/Implab/Diagnostics/TraceRegistry.cs b/Implab/src/Diagnostics/TraceRegistry.cs rename from Implab/Diagnostics/TraceRegistry.cs rename to Implab/src/Diagnostics/TraceRegistry.cs diff --git a/Implab/Diagnostics/TraceSourceAttribute.cs b/Implab/src/Diagnostics/TraceSourceAttribute.cs rename from Implab/Diagnostics/TraceSourceAttribute.cs rename to Implab/src/Diagnostics/TraceSourceAttribute.cs diff --git a/Implab/Diagnostics/TraceSourceChannel.cs b/Implab/src/Diagnostics/TraceSourceChannel.cs rename from Implab/Diagnostics/TraceSourceChannel.cs rename to Implab/src/Diagnostics/TraceSourceChannel.cs diff --git a/Implab/Diagnostics/TraceSourceChannel`1.cs b/Implab/src/Diagnostics/TraceSourceChannel`1.cs rename from Implab/Diagnostics/TraceSourceChannel`1.cs rename to Implab/src/Diagnostics/TraceSourceChannel`1.cs diff --git a/Implab/ExceptionHelpers.cs b/Implab/src/ExceptionHelpers.cs rename from Implab/ExceptionHelpers.cs rename to Implab/src/ExceptionHelpers.cs diff --git a/Implab/Formats/ByteAlphabet.cs b/Implab/src/Formats/ByteAlphabet.cs rename from Implab/Formats/ByteAlphabet.cs rename to Implab/src/Formats/ByteAlphabet.cs diff --git a/Implab/Formats/CharAlphabet.cs b/Implab/src/Formats/CharAlphabet.cs rename from Implab/Formats/CharAlphabet.cs rename to Implab/src/Formats/CharAlphabet.cs diff --git a/Implab/Formats/CharMap.cs b/Implab/src/Formats/CharMap.cs rename from Implab/Formats/CharMap.cs rename to Implab/src/Formats/CharMap.cs diff --git a/Implab/Formats/FastInpurScanner.cs b/Implab/src/Formats/FastInpurScanner.cs rename from Implab/Formats/FastInpurScanner.cs rename to Implab/src/Formats/FastInpurScanner.cs diff --git a/Implab/Formats/Grammar.cs b/Implab/src/Formats/Grammar.cs rename from Implab/Formats/Grammar.cs rename to Implab/src/Formats/Grammar.cs diff --git a/Implab/Formats/InputScanner.cs b/Implab/src/Formats/InputScanner.cs rename from Implab/Formats/InputScanner.cs rename to Implab/src/Formats/InputScanner.cs diff --git a/Implab/Formats/Json/JsonElementContext.cs b/Implab/src/Formats/Json/JsonElementContext.cs rename from Implab/Formats/Json/JsonElementContext.cs rename to Implab/src/Formats/Json/JsonElementContext.cs diff --git a/Implab/Formats/Json/JsonElementType.cs b/Implab/src/Formats/Json/JsonElementType.cs rename from Implab/Formats/Json/JsonElementType.cs rename to Implab/src/Formats/Json/JsonElementType.cs diff --git a/Implab/Formats/Json/JsonGrammar.cs b/Implab/src/Formats/Json/JsonGrammar.cs rename from Implab/Formats/Json/JsonGrammar.cs rename to Implab/src/Formats/Json/JsonGrammar.cs diff --git a/Implab/Formats/Json/JsonReader.cs b/Implab/src/Formats/Json/JsonReader.cs rename from Implab/Formats/Json/JsonReader.cs rename to Implab/src/Formats/Json/JsonReader.cs diff --git a/Implab/Formats/Json/JsonScanner.cs b/Implab/src/Formats/Json/JsonScanner.cs rename from Implab/Formats/Json/JsonScanner.cs rename to Implab/src/Formats/Json/JsonScanner.cs diff --git a/Implab/Formats/Json/JsonStringScanner.cs b/Implab/src/Formats/Json/JsonStringScanner.cs rename from Implab/Formats/Json/JsonStringScanner.cs rename to Implab/src/Formats/Json/JsonStringScanner.cs diff --git a/Implab/Formats/Json/JsonTextScanner.cs b/Implab/src/Formats/Json/JsonTextScanner.cs rename from Implab/Formats/Json/JsonTextScanner.cs rename to Implab/src/Formats/Json/JsonTextScanner.cs diff --git a/Implab/Formats/Json/JsonTokenType.cs b/Implab/src/Formats/Json/JsonTokenType.cs rename from Implab/Formats/Json/JsonTokenType.cs rename to Implab/src/Formats/Json/JsonTokenType.cs diff --git a/Implab/Formats/Json/JsonWriter.cs b/Implab/src/Formats/Json/JsonWriter.cs rename from Implab/Formats/Json/JsonWriter.cs rename to Implab/src/Formats/Json/JsonWriter.cs diff --git a/Implab/Formats/Json/StringTranslator.cs b/Implab/src/Formats/Json/StringTranslator.cs rename from Implab/Formats/Json/StringTranslator.cs rename to Implab/src/Formats/Json/StringTranslator.cs diff --git a/Implab/IDispatcher.cs b/Implab/src/IDispatcher.cs rename from Implab/IDispatcher.cs rename to Implab/src/IDispatcher.cs diff --git a/Implab/IPromise.cs b/Implab/src/IPromise.cs rename from Implab/IPromise.cs rename to Implab/src/IPromise.cs diff --git a/Implab/IPromiseT.cs b/Implab/src/IPromiseT.cs rename from Implab/IPromiseT.cs rename to Implab/src/IPromiseT.cs diff --git a/Implab/IResolvable.cs b/Implab/src/IResolvable.cs rename from Implab/IResolvable.cs rename to Implab/src/IResolvable.cs diff --git a/Implab/IResolvable`1.cs b/Implab/src/IResolvable`1.cs rename from Implab/IResolvable`1.cs rename to Implab/src/IResolvable`1.cs diff --git a/Implab/Messaging/IConsumer.cs b/Implab/src/Messaging/IConsumer.cs rename from Implab/Messaging/IConsumer.cs rename to Implab/src/Messaging/IConsumer.cs diff --git a/Implab/Messaging/IProducer.cs b/Implab/src/Messaging/IProducer.cs rename from Implab/Messaging/IProducer.cs rename to Implab/src/Messaging/IProducer.cs diff --git a/Implab/Parallels/AsyncQueue.cs b/Implab/src/Parallels/AsyncQueue.cs rename from Implab/Parallels/AsyncQueue.cs rename to Implab/src/Parallels/AsyncQueue.cs diff --git a/Implab/Parallels/BlockingQueue.cs b/Implab/src/Parallels/BlockingQueue.cs rename from Implab/Parallels/BlockingQueue.cs rename to Implab/src/Parallels/BlockingQueue.cs diff --git a/Implab/Parallels/DispatchPool.cs b/Implab/src/Parallels/DispatchPool.cs rename from Implab/Parallels/DispatchPool.cs rename to Implab/src/Parallels/DispatchPool.cs diff --git a/Implab/Parallels/SharedLock.cs b/Implab/src/Parallels/SharedLock.cs rename from Implab/Parallels/SharedLock.cs rename to Implab/src/Parallels/SharedLock.cs diff --git a/Implab/Parallels/Signal.cs b/Implab/src/Parallels/Signal.cs rename from Implab/Parallels/Signal.cs rename to Implab/src/Parallels/Signal.cs diff --git a/Implab/Parallels/SimpleAsyncQueue.cs b/Implab/src/Parallels/SimpleAsyncQueue.cs rename from Implab/Parallels/SimpleAsyncQueue.cs rename to Implab/src/Parallels/SimpleAsyncQueue.cs diff --git a/Implab/Parallels/SyncContextDispatcher.cs b/Implab/src/Parallels/SyncContextDispatcher.cs rename from Implab/Parallels/SyncContextDispatcher.cs rename to Implab/src/Parallels/SyncContextDispatcher.cs diff --git a/Implab/Parallels/ThreadPoolDispatcher.cs b/Implab/src/Parallels/ThreadPoolDispatcher.cs rename from Implab/Parallels/ThreadPoolDispatcher.cs rename to Implab/src/Parallels/ThreadPoolDispatcher.cs diff --git a/Implab/Promise.cs b/Implab/src/Promise.cs rename from Implab/Promise.cs rename to Implab/src/Promise.cs diff --git a/Implab/PromiseActionReaction.cs b/Implab/src/PromiseActionReaction.cs rename from Implab/PromiseActionReaction.cs rename to Implab/src/PromiseActionReaction.cs diff --git a/Implab/PromiseActionReaction`1.cs b/Implab/src/PromiseActionReaction`1.cs rename from Implab/PromiseActionReaction`1.cs rename to Implab/src/PromiseActionReaction`1.cs diff --git a/Implab/PromiseAll.cs b/Implab/src/PromiseAll.cs rename from Implab/PromiseAll.cs rename to Implab/src/PromiseAll.cs diff --git a/Implab/PromiseAll`1.cs b/Implab/src/PromiseAll`1.cs rename from Implab/PromiseAll`1.cs rename to Implab/src/PromiseAll`1.cs diff --git a/Implab/PromiseAwaiter.cs b/Implab/src/PromiseAwaiter.cs rename from Implab/PromiseAwaiter.cs rename to Implab/src/PromiseAwaiter.cs diff --git a/Implab/PromiseAwaiter`1.cs b/Implab/src/PromiseAwaiter`1.cs rename from Implab/PromiseAwaiter`1.cs rename to Implab/src/PromiseAwaiter`1.cs diff --git a/Implab/PromiseExecutor.cs b/Implab/src/PromiseExecutor.cs rename from Implab/PromiseExecutor.cs rename to Implab/src/PromiseExecutor.cs diff --git a/Implab/PromiseExecutor`1.cs b/Implab/src/PromiseExecutor`1.cs rename from Implab/PromiseExecutor`1.cs rename to Implab/src/PromiseExecutor`1.cs diff --git a/Implab/PromiseExtensions.cs b/Implab/src/PromiseExtensions.cs rename from Implab/PromiseExtensions.cs rename to Implab/src/PromiseExtensions.cs diff --git a/Implab/PromiseFuncReaction`1.cs b/Implab/src/PromiseFuncReaction`1.cs rename from Implab/PromiseFuncReaction`1.cs rename to Implab/src/PromiseFuncReaction`1.cs diff --git a/Implab/PromiseFuncReaction`2.cs b/Implab/src/PromiseFuncReaction`2.cs rename from Implab/PromiseFuncReaction`2.cs rename to Implab/src/PromiseFuncReaction`2.cs diff --git a/Implab/PromiseHandler.cs b/Implab/src/PromiseHandler.cs rename from Implab/PromiseHandler.cs rename to Implab/src/PromiseHandler.cs diff --git a/Implab/PromiseState.cs b/Implab/src/PromiseState.cs rename from Implab/PromiseState.cs rename to Implab/src/PromiseState.cs diff --git a/Implab/PromiseTransientException.cs b/Implab/src/PromiseTransientException.cs rename from Implab/PromiseTransientException.cs rename to Implab/src/PromiseTransientException.cs diff --git a/Implab/Promise`1.cs b/Implab/src/Promise`1.cs rename from Implab/Promise`1.cs rename to Implab/src/Promise`1.cs diff --git a/Implab/RejectedPromise.cs b/Implab/src/RejectedPromise.cs rename from Implab/RejectedPromise.cs rename to Implab/src/RejectedPromise.cs diff --git a/Implab/RejectedPromise`1.cs b/Implab/src/RejectedPromise`1.cs rename from Implab/RejectedPromise`1.cs rename to Implab/src/RejectedPromise`1.cs diff --git a/Implab/ResolvedPromise.cs b/Implab/src/ResolvedPromise.cs rename from Implab/ResolvedPromise.cs rename to Implab/src/ResolvedPromise.cs diff --git a/Implab/ResolvedPromise`1.cs b/Implab/src/ResolvedPromise`1.cs rename from Implab/ResolvedPromise`1.cs rename to Implab/src/ResolvedPromise`1.cs diff --git a/Implab/Safe.cs b/Implab/src/Safe.cs rename from Implab/Safe.cs rename to Implab/src/Safe.cs diff --git a/Implab/TaskHelpers.cs b/Implab/src/TaskHelpers.cs rename from Implab/TaskHelpers.cs rename to Implab/src/TaskHelpers.cs diff --git a/Implab/Xml/JsonXmlCaseTransform.cs b/Implab/src/Xml/JsonXmlCaseTransform.cs rename from Implab/Xml/JsonXmlCaseTransform.cs rename to Implab/src/Xml/JsonXmlCaseTransform.cs diff --git a/Implab/Xml/JsonXmlReader.cs b/Implab/src/Xml/JsonXmlReader.cs rename from Implab/Xml/JsonXmlReader.cs rename to Implab/src/Xml/JsonXmlReader.cs diff --git a/Implab/Xml/JsonXmlReaderOptions.cs b/Implab/src/Xml/JsonXmlReaderOptions.cs rename from Implab/Xml/JsonXmlReaderOptions.cs rename to Implab/src/Xml/JsonXmlReaderOptions.cs diff --git a/Implab/Xml/JsonXmlReaderPosition.cs b/Implab/src/Xml/JsonXmlReaderPosition.cs rename from Implab/Xml/JsonXmlReaderPosition.cs rename to Implab/src/Xml/JsonXmlReaderPosition.cs diff --git a/Implab/Xml/SerializationHelpers.cs b/Implab/src/Xml/SerializationHelpers.cs rename from Implab/Xml/SerializationHelpers.cs rename to Implab/src/Xml/SerializationHelpers.cs diff --git a/Implab/Xml/SerializersPool.cs b/Implab/src/Xml/SerializersPool.cs rename from Implab/Xml/SerializersPool.cs rename to Implab/src/Xml/SerializersPool.cs diff --git a/Implab/Xml/XmlDefaultSerializer.cs b/Implab/src/Xml/XmlDefaultSerializer.cs rename from Implab/Xml/XmlDefaultSerializer.cs rename to Implab/src/Xml/XmlDefaultSerializer.cs diff --git a/Implab/Xml/XmlNameContext.cs b/Implab/src/Xml/XmlNameContext.cs rename from Implab/Xml/XmlNameContext.cs rename to Implab/src/Xml/XmlNameContext.cs diff --git a/Implab/Xml/XmlSerializerExtensions.cs b/Implab/src/Xml/XmlSerializerExtensions.cs rename from Implab/Xml/XmlSerializerExtensions.cs rename to Implab/src/Xml/XmlSerializerExtensions.cs diff --git a/Implab/Xml/XmlSimpleAttribute.cs b/Implab/src/Xml/XmlSimpleAttribute.cs rename from Implab/Xml/XmlSimpleAttribute.cs rename to Implab/src/Xml/XmlSimpleAttribute.cs diff --git a/Implab/Xml/XmlToJson.cs b/Implab/src/Xml/XmlToJson.cs rename from Implab/Xml/XmlToJson.cs rename to Implab/src/Xml/XmlToJson.cs diff --git a/Implab/Xml/json.xsl b/Implab/src/Xml/json.xsl rename from Implab/Xml/json.xsl rename to Implab/src/Xml/json.xsl diff --git a/Implab/Xml/readme.txt b/Implab/src/Xml/readme.txt rename from Implab/Xml/readme.txt rename to Implab/src/Xml/readme.txt