- add registration base interfaces

pull/32/head
Simon Gockner 7 years ago
parent 46f5f93e0c
commit d5b1db6173
  1. 38
      LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs
  2. 24
      LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs
  3. 20
      LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs

@ -0,0 +1,38 @@
// Author: simon.gockner
// Created: 2019-05-20
// Copyright(c) 2019 SimonG. All Rights Reserved.
using System;
namespace LightweightIocContainer.Interfaces.Registrations
{
/// <summary>
/// The default registration that is used to register a Type for the Interface it implements
/// </summary>
/// <typeparam name="TInterface">The registered Interface</typeparam>
public interface IDefaultRegistration<TInterface> : IRegistrationBase
{
/// <summary>
/// The Type that implements the <see cref="IRegistrationBase.InterfaceType"/> that is registered with this <see cref="IDefaultRegistration{TInterface}"/>
/// </summary>
Type ImplementationType { get; }
/// <summary>
/// The Lifestyle of Instances that are created with this <see cref="IDefaultRegistration{TInterface}"/>
/// </summary>
Lifestyle Lifestyle { get; }
/// <summary>
/// This action is invoked when an instance of this type is created.
/// <para>Can be set in the <see cref="IInjectorInstaller"/> by calling <see cref="OnCreate"/></para>
/// </summary>
Action<TInterface> OnCreateAction { get; }
/// <summary>
/// Pass an action that will be invoked when an instance of this type is created
/// </summary>
/// <param name="action">The action</param>
/// <returns>The current instance of this <see cref="IDefaultRegistration{TInterface}"/></returns>
IDefaultRegistration<TInterface> OnCreate(Action<TInterface> action);
}
}

@ -0,0 +1,24 @@
// Author: simon.gockner
// Created: 2019-05-20
// Copyright(c) 2019 SimonG. All Rights Reserved.
using System;
namespace LightweightIocContainer.Interfaces.Registrations
{
/// <summary>
/// The base registration that is used to register an Interface
/// </summary>
public interface IRegistrationBase
{
/// <summary>
/// The name of the <see cref="IRegistrationBase"/>
/// </summary>
string Name { get; }
/// <summary>
/// The Type of the Interface that is registered with this <see cref="IRegistrationBase"/>
/// </summary>
Type InterfaceType { get; }
}
}

@ -0,0 +1,20 @@
// Author: simon.gockner
// Created: 2019-05-20
// Copyright(c) 2019 SimonG. All Rights Reserved.
using LightweightIocContainer.Interfaces.Factories;
namespace LightweightIocContainer.Interfaces.Registrations
{
/// <summary>
/// The registration that is used to register an abstract typed factory
/// </summary>
/// <typeparam name="TFactory">The type of the abstract typed factory</typeparam>
public interface ITypedFactoryRegistration<TFactory> : IRegistrationBase
{
/// <summary>
/// The class that contains the implemented abstract factory of this <see cref="ITypedFactoryRegistration{TFactory}"/>
/// </summary>
ITypedFactory<TFactory> Factory { get; }
}
}
Loading…
Cancel
Save