From d5b1db61732efcb957bdf30231606fc3d8e3ac13 Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Tue, 4 Jun 2019 22:31:45 +0200 Subject: [PATCH] - add registration base interfaces --- .../Registrations/IDefaultRegistration.cs | 38 +++++++++++++++++++ .../Registrations/IRegistrationBase.cs | 24 ++++++++++++ .../ITypedFactoryRegistration.cs | 20 ++++++++++ 3 files changed, 82 insertions(+) create mode 100644 LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs create mode 100644 LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs create mode 100644 LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs diff --git a/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs new file mode 100644 index 0000000..56428c4 --- /dev/null +++ b/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.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 +{ + /// + /// The default registration that is used to register a Type for the Interface it implements + /// + /// The registered Interface + public interface IDefaultRegistration : IRegistrationBase + { + /// + /// The Type that implements the that is registered with this + /// + Type ImplementationType { get; } + + /// + /// The Lifestyle of Instances that are created with this + /// + Lifestyle Lifestyle { get; } + + /// + /// This action is invoked when an instance of this type is created. + /// Can be set in the by calling + /// + Action OnCreateAction { get; } + + /// + /// Pass an action that will be invoked when an instance of this type is created + /// + /// The action + /// The current instance of this + IDefaultRegistration OnCreate(Action action); + } +} \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs new file mode 100644 index 0000000..1b8e176 --- /dev/null +++ b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs @@ -0,0 +1,24 @@ +// Author: simon.gockner +// Created: 2019-05-20 +// Copyright(c) 2019 SimonG. All Rights Reserved. + +using System; + +namespace LightweightIocContainer.Interfaces.Registrations +{ + /// + /// The base registration that is used to register an Interface + /// + public interface IRegistrationBase + { + /// + /// The name of the + /// + string Name { get; } + + /// + /// The Type of the Interface that is registered with this + /// + Type InterfaceType { get; } + } +} \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs new file mode 100644 index 0000000..584a290 --- /dev/null +++ b/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs @@ -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 +{ + /// + /// The registration that is used to register an abstract typed factory + /// + /// The type of the abstract typed factory + public interface ITypedFactoryRegistration : IRegistrationBase + { + /// + /// The class that contains the implemented abstract factory of this + /// + ITypedFactory Factory { get; } + } +} \ No newline at end of file