Skip to content

Commit

Permalink
Refactor app context and ioc container
Browse files Browse the repository at this point in the history
  • Loading branch information
fahminlb33 committed Feb 28, 2021
1 parent 9e91305 commit 5613378
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

namespace KFlearning.Services
{
public class CustomApplicationContext : ApplicationContext
public class KFlearningApplicationContext : ApplicationContext
{
private readonly ITelemetryService _telemetry;
private Form _mainForm;

public CustomApplicationContext(ITelemetryService telemetryService, StartupForm form)
public KFlearningApplicationContext(ITelemetryService telemetryService, StartupForm form)
{
_telemetry = telemetryService;
_mainForm = form;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
// SOLUTION : KFlearning
// PROJECT : KFlearning
// FILENAME : AppModulesInstaller.cs
// AUTHOR : Fahmi Noor Fiqri, Kodesiana.com
// WEBSITE : https://kodesiana.com
// REPO : https://github.com/Kodesiana or https://github.com/fahminlb33
//
// This file is part of KFlearning, see LICENSE.
// See this code in repository URL above!

using Castle.MicroKernel.Registration;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using KFlearning.TemplateProvider;
using KFlearning.Views;

namespace KFlearning.Services
{
public class AppModulesInstaller : IWindsorInstaller
public class KFlearningModulesInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
Expand All @@ -26,9 +17,9 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
.LifestyleTransient(),

// services
Component.For<CustomApplicationContext>().LifestyleSingleton(),
Component.For<KFlearningApplicationContext>().LifestyleSingleton(),
Classes.FromThisAssembly()
.InSameNamespaceAs<AppModulesInstaller>()
.InSameNamespaceAs<KFlearningModulesInstaller>()
.WithServiceDefaultInterfaces()
.WithServiceAllInterfaces()
.LifestyleSingleton(),
Expand Down

0 comments on commit 5613378

Please sign in to comment.