From bc1421189cc0908c225e5a3c31bcf5ce6510c680 Mon Sep 17 00:00:00 2001 From: Eugene Sadovoi Date: Thu, 16 Nov 2017 20:32:53 -0500 Subject: [PATCH] Added IRequireBuildUpPolicy --- src/Builder/UnityBuildStage.cs | 10 +++++----- src/Lifetime/PerResolveLifetimeManager.cs | 4 +++- src/Policy/IRequireBuildUpPolicy.cs | 10 ++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 src/Policy/IRequireBuildUpPolicy.cs diff --git a/src/Builder/UnityBuildStage.cs b/src/Builder/UnityBuildStage.cs index 9d8b4a08..42189e4c 100644 --- a/src/Builder/UnityBuildStage.cs +++ b/src/Builder/UnityBuildStage.cs @@ -13,17 +13,17 @@ public enum UnityBuildStage /// Setup, - /// - /// Second stage. Type mapping occurs here. - /// - TypeMapping, - /// /// Third stage. lifetime managers are checked here, /// and if they're available the rest of the pipeline is skipped. /// Lifetime, + /// + /// Second stage. Type mapping occurs here. + /// + TypeMapping, + /// /// Fourth stage. Reflection over constructors, properties, etc. is /// performed here. diff --git a/src/Lifetime/PerResolveLifetimeManager.cs b/src/Lifetime/PerResolveLifetimeManager.cs index 146e569e..dfe78d64 100644 --- a/src/Lifetime/PerResolveLifetimeManager.cs +++ b/src/Lifetime/PerResolveLifetimeManager.cs @@ -1,5 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. +using Unity.Policy; + namespace Unity.Lifetime { /// @@ -7,7 +9,7 @@ namespace Unity.Lifetime /// but also provides a signal to the default build plan, marking the type so that /// instances are reused across the build up object graph. /// - public class PerResolveLifetimeManager : LifetimeManager + public class PerResolveLifetimeManager : LifetimeManager, IRequireBuildUpPolicy { protected object value; diff --git a/src/Policy/IRequireBuildUpPolicy.cs b/src/Policy/IRequireBuildUpPolicy.cs new file mode 100644 index 00000000..25d20285 --- /dev/null +++ b/src/Policy/IRequireBuildUpPolicy.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Unity.Policy +{ + public interface IRequireBuildUpPolicy + { + } +}