File tree Expand file tree Collapse file tree
src/UnityContainerAttributeRegistration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace UnityContainerAttributeRegistration . Adapter
66{
7+ /// <summary>
8+ /// Wrapper to provide <see cref="IList{Assembly}"/> instead of using <see cref="System.AppDomain"/>
9+ /// </summary>
710 public interface IAppDomainAdapter
811 {
12+ /// <summary>
13+ /// Provice <see cref="Assembly"/>s of an AppDomain
14+ /// </summary>
15+ /// <returns><see cref="Assembly"/>s which are used to populate </returns>
916 public IList < Assembly > GetAssemblies ( ) ;
1017 }
1118}
Original file line number Diff line number Diff line change 55
66namespace UnityContainerAttributeRegistration . Attribute
77{
8+ /// <summary>
9+ /// Mark a class to be registered to an <see cref="Unity.IUnityContainer"/>
10+ /// </summary>
811 [ AttributeUsage ( AttributeTargets . Class ) ]
912 public class RegisterTypeAttribute : System . Attribute
1013 {
14+ /// <param name="from"><see cref="Type"/> that will be requested.</param>
15+ /// <param name="lifetimeManager">The <see cref="Unity.Lifetime.ITypeLifetimeManager"/> that controls the lifetime of the returned instance.</param>
1116 public RegisterTypeAttribute ( [ CanBeNull ] Type from = null ,
1217 [ CanBeNull ] Type lifetimeManager = null )
1318 {
Original file line number Diff line number Diff line change 11namespace UnityContainerAttributeRegistration
22{
3- public enum TypeDefined
3+ internal enum TypeDefined
44 {
55 Inherit ,
66 NotInherit
Original file line number Diff line number Diff line change 1414
1515namespace UnityContainerAttributeRegistration
1616{
17+ /// <summary>
18+ /// Creates a populated or populates an <see cref="Unity.IUnityContainer" />, depending on the provided assemblies
19+ /// </summary>
1720 public sealed class UnityContainerPopulator
1821 {
1922 private readonly IAppDomainAdapter appDomain ;
2023
24+ /// <summary>
25+ /// Use <see cref="System.AppDomain.CurrentDomain"/> to populate an <see cref="Unity.IUnityContainer" />
26+ /// </summary>
2127 public UnityContainerPopulator ( ) : this ( new AppDomainAdapter ( ) )
2228 {
2329 }
2430
31+ /// <summary>
32+ /// Use <paramref name="appDomain"/> to populate an <see cref="Unity.IUnityContainer" />
33+ /// </summary>
34+ /// <param name="appDomain">Custom <see cref="UnityContainerAttributeRegistration.Adapter.IAppDomainAdapter"/></param>
2535 public UnityContainerPopulator ( [ NotNull ] IAppDomainAdapter appDomain )
2636 {
2737 this . appDomain = appDomain ;
2838 }
2939
40+ /// <summary>
41+ /// Create and populate a new <see cref="Unity.UnityContainer"/>
42+ /// </summary>
43+ /// <returns>New <see cref="Unity.UnityContainer"/> with registered types</returns>
3044 public IUnityContainer Populate ( )
3145 {
3246 return Populate ( new UnityContainer ( ) ) ;
3347 }
3448
49+ /// <summary>
50+ /// Populate <paramref name="container"/>
51+ /// </summary>
52+ /// <param name="container"><see cref="Unity.IUnityContainer"/> to register types</param>
53+ /// <returns><paramref name="container"/></returns>
3554 public IUnityContainer Populate ( [ NotNull ] IUnityContainer container )
3655 {
3756 RegisterByTypeAttribute ( container ) ;
You can’t perform that action at this time.
0 commit comments