From c24abaed59a5dce82e94e0e9ee6fedf1f63d1a46 Mon Sep 17 00:00:00 2001 From: Eugene Sadovoi Date: Sun, 8 Oct 2017 16:29:02 -0400 Subject: [PATCH] Moved Lifetime managers into Abstractions --- src/ContainerIntegration/AdditionalInterface.cs | 1 + src/ContainerIntegration/DefaultInterceptionBehavior.cs | 1 + src/ContainerIntegration/DefaultInterceptor.cs | 2 ++ src/ContainerIntegration/InterceptionBehavior.cs | 1 + src/ContainerIntegration/InterceptionBehaviorBase.cs | 2 ++ src/ContainerIntegration/InterceptionMember.cs | 1 + src/ContainerIntegration/Interceptor.cs | 1 + .../ObjectBuilder/AdditionalInterfacesPolicy.cs | 1 + .../ObjectBuilder/FixedInstanceInterceptionPolicy.cs | 1 + .../ObjectBuilder/FixedTypeInterceptionPolicy.cs | 1 + .../ObjectBuilder/IAdditionalInterfacesPolicy.cs | 1 + .../ObjectBuilder/IInstanceInterceptionPolicy.cs | 1 + .../ObjectBuilder/IInterceptionBehaviorsPolicy.cs | 1 + .../ObjectBuilder/ITypeInterceptionPolicy.cs | 1 + .../ObjectBuilder/InstanceInterceptionStrategy.cs | 1 + .../ObjectBuilder/InterceptionBehaviorsPolicy.cs | 2 ++ .../ObjectBuilder/ResolvedInstanceInterceptionPolicy.cs | 1 + .../ObjectBuilder/ResolvedTypeInterceptionPolicy.cs | 1 + .../ObjectBuilder/TypeInterceptionStrategy.cs | 2 ++ src/ContainerIntegration/PolicyDefinition.cs | 2 ++ .../ConstructorWithResolverKeysSelectorPolicy.cs | 2 ++ tests/ConvenienceConfigurationFixture.cs | 1 + tests/EventInterceptionFixture.cs | 1 + tests/InterceptionFixture.Desktop.cs | 1 + tests/InterceptionFixture.cs | 1 + .../ContainerInterfaceInterceptionFixture.cs | 1 + tests/TestSupport/MockBuilderContext.cs | 6 ++++++ tests/TestSupport/RegistrationsToAssertOn.cs | 1 + tests/TestSupport/SessionLifetimeManager.cs | 1 + .../ContainerVirtualMethodInterceptionFixture.cs | 1 + 30 files changed, 41 insertions(+) diff --git a/src/ContainerIntegration/AdditionalInterface.cs b/src/ContainerIntegration/AdditionalInterface.cs index df3379c..6b525fe 100644 --- a/src/ContainerIntegration/AdditionalInterface.cs +++ b/src/ContainerIntegration/AdditionalInterface.cs @@ -6,6 +6,7 @@ using Microsoft.Practices.ObjectBuilder2; using Unity.Interception.Properties; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/DefaultInterceptionBehavior.cs b/src/ContainerIntegration/DefaultInterceptionBehavior.cs index 322c57a..0bd7f55 100644 --- a/src/ContainerIntegration/DefaultInterceptionBehavior.cs +++ b/src/ContainerIntegration/DefaultInterceptionBehavior.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/DefaultInterceptor.cs b/src/ContainerIntegration/DefaultInterceptor.cs index 9b45382..f64128d 100644 --- a/src/ContainerIntegration/DefaultInterceptor.cs +++ b/src/ContainerIntegration/DefaultInterceptor.cs @@ -4,6 +4,8 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Policy; +using Unity.Registration; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/InterceptionBehavior.cs b/src/ContainerIntegration/InterceptionBehavior.cs index efc5059..b1891a1 100644 --- a/src/ContainerIntegration/InterceptionBehavior.cs +++ b/src/ContainerIntegration/InterceptionBehavior.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/InterceptionBehaviorBase.cs b/src/ContainerIntegration/InterceptionBehaviorBase.cs index c9680a3..0d25c7c 100644 --- a/src/ContainerIntegration/InterceptionBehaviorBase.cs +++ b/src/ContainerIntegration/InterceptionBehaviorBase.cs @@ -4,6 +4,8 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Lifetime; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/InterceptionMember.cs b/src/ContainerIntegration/InterceptionMember.cs index 2806011..667a7c1 100644 --- a/src/ContainerIntegration/InterceptionMember.cs +++ b/src/ContainerIntegration/InterceptionMember.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. using Unity; +using Unity.Registration; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/Interceptor.cs b/src/ContainerIntegration/Interceptor.cs index f2df0eb..fce416e 100644 --- a/src/ContainerIntegration/Interceptor.cs +++ b/src/ContainerIntegration/Interceptor.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/AdditionalInterfacesPolicy.cs b/src/ContainerIntegration/ObjectBuilder/AdditionalInterfacesPolicy.cs index 9bdcf65..3f2b34d 100644 --- a/src/ContainerIntegration/ObjectBuilder/AdditionalInterfacesPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/AdditionalInterfacesPolicy.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/FixedInstanceInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/FixedInstanceInterceptionPolicy.cs index dbca542..0708771 100644 --- a/src/ContainerIntegration/ObjectBuilder/FixedInstanceInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/FixedInstanceInterceptionPolicy.cs @@ -2,6 +2,7 @@ using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/FixedTypeInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/FixedTypeInterceptionPolicy.cs index 222b058..f3e2b6e 100644 --- a/src/ContainerIntegration/ObjectBuilder/FixedTypeInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/FixedTypeInterceptionPolicy.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/IAdditionalInterfacesPolicy.cs b/src/ContainerIntegration/ObjectBuilder/IAdditionalInterfacesPolicy.cs index 25d2b08..3235018 100644 --- a/src/ContainerIntegration/ObjectBuilder/IAdditionalInterfacesPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/IAdditionalInterfacesPolicy.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/IInstanceInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/IInstanceInterceptionPolicy.cs index a694db1..065ecb4 100644 --- a/src/ContainerIntegration/ObjectBuilder/IInstanceInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/IInstanceInterceptionPolicy.cs @@ -2,6 +2,7 @@ using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/IInterceptionBehaviorsPolicy.cs b/src/ContainerIntegration/ObjectBuilder/IInterceptionBehaviorsPolicy.cs index a1510f4..1498807 100644 --- a/src/ContainerIntegration/ObjectBuilder/IInterceptionBehaviorsPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/IInterceptionBehaviorsPolicy.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/ITypeInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/ITypeInterceptionPolicy.cs index bb1f4d2..b6e8834 100644 --- a/src/ContainerIntegration/ObjectBuilder/ITypeInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/ITypeInterceptionPolicy.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Text; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/InstanceInterceptionStrategy.cs b/src/ContainerIntegration/ObjectBuilder/InstanceInterceptionStrategy.cs index a13b75f..e9f3756 100644 --- a/src/ContainerIntegration/ObjectBuilder/InstanceInterceptionStrategy.cs +++ b/src/ContainerIntegration/ObjectBuilder/InstanceInterceptionStrategy.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/InterceptionBehaviorsPolicy.cs b/src/ContainerIntegration/ObjectBuilder/InterceptionBehaviorsPolicy.cs index e3acd7c..d491313 100644 --- a/src/ContainerIntegration/ObjectBuilder/InterceptionBehaviorsPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/InterceptionBehaviorsPolicy.cs @@ -4,6 +4,8 @@ using System; using System.Collections.Generic; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/ResolvedInstanceInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/ResolvedInstanceInterceptionPolicy.cs index 0b38ef4..ec19433 100644 --- a/src/ContainerIntegration/ObjectBuilder/ResolvedInstanceInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/ResolvedInstanceInterceptionPolicy.cs @@ -3,6 +3,7 @@ using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/ResolvedTypeInterceptionPolicy.cs b/src/ContainerIntegration/ObjectBuilder/ResolvedTypeInterceptionPolicy.cs index 99c7c99..baaa070 100644 --- a/src/ContainerIntegration/ObjectBuilder/ResolvedTypeInterceptionPolicy.cs +++ b/src/ContainerIntegration/ObjectBuilder/ResolvedTypeInterceptionPolicy.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Builder; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/ObjectBuilder/TypeInterceptionStrategy.cs b/src/ContainerIntegration/ObjectBuilder/TypeInterceptionStrategy.cs index cdb07fd..718345b 100644 --- a/src/ContainerIntegration/ObjectBuilder/TypeInterceptionStrategy.cs +++ b/src/ContainerIntegration/ObjectBuilder/TypeInterceptionStrategy.cs @@ -7,6 +7,8 @@ using System.Reflection; using Microsoft.Practices.ObjectBuilder2; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Builder; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/ContainerIntegration/PolicyDefinition.cs b/src/ContainerIntegration/PolicyDefinition.cs index a3bacc7..e8242e4 100644 --- a/src/ContainerIntegration/PolicyDefinition.cs +++ b/src/ContainerIntegration/PolicyDefinition.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Microsoft.Practices.Unity.Utility; using Unity; +using Unity.Lifetime; +using Unity.Registration; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/src/Interceptors/TypeInterceptors/VirtualMethodInterception/ConstructorWithResolverKeysSelectorPolicy.cs b/src/Interceptors/TypeInterceptors/VirtualMethodInterception/ConstructorWithResolverKeysSelectorPolicy.cs index ce9b844..f5f8f26 100644 --- a/src/Interceptors/TypeInterceptors/VirtualMethodInterception/ConstructorWithResolverKeysSelectorPolicy.cs +++ b/src/Interceptors/TypeInterceptors/VirtualMethodInterception/ConstructorWithResolverKeysSelectorPolicy.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Text; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; +using Unity.Policy; namespace Microsoft.Practices.Unity.InterceptionExtension { diff --git a/tests/ConvenienceConfigurationFixture.cs b/tests/ConvenienceConfigurationFixture.cs index 1d0a0a3..3c23a74 100644 --- a/tests/ConvenienceConfigurationFixture.cs +++ b/tests/ConvenienceConfigurationFixture.cs @@ -7,6 +7,7 @@ using Microsoft.Practices.Unity.InterceptionExtension.Tests.ObjectsUnderTest; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests { diff --git a/tests/EventInterceptionFixture.cs b/tests/EventInterceptionFixture.cs index a4ae759..364e3ba 100644 --- a/tests/EventInterceptionFixture.cs +++ b/tests/EventInterceptionFixture.cs @@ -7,6 +7,7 @@ using System.Text; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests { diff --git a/tests/InterceptionFixture.Desktop.cs b/tests/InterceptionFixture.Desktop.cs index b65d09f..ce1413b 100644 --- a/tests/InterceptionFixture.Desktop.cs +++ b/tests/InterceptionFixture.Desktop.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests { diff --git a/tests/InterceptionFixture.cs b/tests/InterceptionFixture.cs index be1655e..cbe798e 100644 --- a/tests/InterceptionFixture.cs +++ b/tests/InterceptionFixture.cs @@ -4,6 +4,7 @@ using Microsoft.Practices.Unity.InterceptionExtension.Tests.ObjectsUnderTest; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests { diff --git a/tests/InterfaceInterception/ContainerInterfaceInterceptionFixture.cs b/tests/InterfaceInterception/ContainerInterfaceInterceptionFixture.cs index 33918c7..2350287 100644 --- a/tests/InterfaceInterception/ContainerInterfaceInterceptionFixture.cs +++ b/tests/InterfaceInterception/ContainerInterfaceInterceptionFixture.cs @@ -7,6 +7,7 @@ using Microsoft.Practices.Unity.InterceptionExtension.Tests.ObjectsUnderTest; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests.InterfaceInterception { diff --git a/tests/TestSupport/MockBuilderContext.cs b/tests/TestSupport/MockBuilderContext.cs index 802c2dd..9e9e345 100644 --- a/tests/TestSupport/MockBuilderContext.cs +++ b/tests/TestSupport/MockBuilderContext.cs @@ -4,6 +4,12 @@ using System; using System.Collections.Generic; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Builder; +using Unity.Exceptions; +using Unity.Lifetime; +using Unity.Policy; +using Unity.Resolve; +using Unity.Strategy; namespace Microsoft.Practices.Unity.TestSupport { diff --git a/tests/TestSupport/RegistrationsToAssertOn.cs b/tests/TestSupport/RegistrationsToAssertOn.cs index 94fb0f8..cfcd94f 100644 --- a/tests/TestSupport/RegistrationsToAssertOn.cs +++ b/tests/TestSupport/RegistrationsToAssertOn.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.TestSupport { diff --git a/tests/TestSupport/SessionLifetimeManager.cs b/tests/TestSupport/SessionLifetimeManager.cs index 609dc89..13631d4 100644 --- a/tests/TestSupport/SessionLifetimeManager.cs +++ b/tests/TestSupport/SessionLifetimeManager.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using System.Globalization; using Microsoft.Practices.ObjectBuilder2; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.TestSupport { diff --git a/tests/VirtualMethodInterception/ContainerVirtualMethodInterceptionFixture.cs b/tests/VirtualMethodInterception/ContainerVirtualMethodInterceptionFixture.cs index bf0b76d..be038dd 100644 --- a/tests/VirtualMethodInterception/ContainerVirtualMethodInterceptionFixture.cs +++ b/tests/VirtualMethodInterception/ContainerVirtualMethodInterceptionFixture.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using Microsoft.Practices.Unity.TestSupport; using Microsoft.VisualStudio.TestTools.UnitTesting; using Unity; +using Unity.Lifetime; namespace Microsoft.Practices.Unity.InterceptionExtension.Tests.VirtualMethodInterception {