-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Unity.Lifetime; | ||
using Unity.Policy; | ||
|
||
namespace Unity | ||
{ | ||
/// <summary> | ||
/// Container interface exposing engine to internal container parts | ||
/// </summary> | ||
public interface IContainerContext | ||
{ | ||
/// <summary> | ||
/// The container that this context is associated with. | ||
/// </summary> | ||
/// <value>The <see cref="IUnityContainer"/> object.</value> | ||
IUnityContainer Container { get; } | ||
|
||
/// <summary> | ||
/// The <see cref="ILifetimeContainer"/> that this container uses. | ||
/// </summary> | ||
/// <value>The <see cref="ILifetimeContainer"/> is used to manage <see cref="IDisposable"/> objects that the container is managing.</value> | ||
ILifetimeContainer Lifetime { get; } | ||
|
||
/// <summary> | ||
/// The policies this container uses. | ||
/// </summary> | ||
/// <remarks>The <see cref="IPolicyList"/> the that container uses to build objects.</remarks> | ||
IPolicyList Policies { get; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Unity.Builder; | ||
|
||
namespace Unity.Policy | ||
{ | ||
public class OverriddenBuildPlanMarkerPolicy : IBuildPlanPolicy | ||
{ | ||
/// <summary> | ||
/// Creates an instance of this build plan's type, or fills | ||
/// in the existing type if passed in. | ||
/// </summary> | ||
/// <param name="context">Context used to build up the object.</param> | ||
public void BuildUp(IBuilderContext context) | ||
{ | ||
throw new InvalidOperationException(Constants.MarkerBuildPlanInvoked); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using Unity.Lifetime; | ||
using Unity.Registration; | ||
|
||
namespace Unity.Strategy | ||
{ | ||
public interface IRegisterTypeStrategy | ||
{ | ||
/// <summary> | ||
/// Register a type mapping with the container, where the created instances will use | ||
/// the given <see cref="LifetimeManager"/>. | ||
/// </summary> | ||
/// <param name="policies"><see cref="IPolicyList"/> holding the registration.</param> | ||
/// <param name="typeFrom"><see cref="Type"/> that will be requested.</param> | ||
/// <param name="typeTo"><see cref="Type"/> that will actually be returned.</param> | ||
/// <param name="name">Name to use for registration, null if a default registration.</param> | ||
/// <param name="lifetimeManager">The <see cref="LifetimeManager"/> that controls the lifetime | ||
/// of the returned instance.</param> | ||
/// <param name="injectionMembers">Injection configuration objects. Can be null.</param> | ||
void RegisterType(IContainerContext context, Type typeFrom, Type typeTo, string name, LifetimeManager lifetimeManager, params InjectionMember[] injectionMembers); | ||
} | ||
} |